Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373772
b: refs/heads/master
c: 5fe0c1f
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed May 6, 2013
1 parent 21071b0 commit c9bd6db
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3d40c2532fee15a30d7a364ac365c21748a4a95
refs/heads/master: 5fe0c1f2f0dca3351536284b0180a79f341b7854
14 changes: 11 additions & 3 deletions trunk/arch/powerpc/sysdev/mpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,12 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq,

if (hw == mpic->spurious_vec)
return -EINVAL;
if (mpic->protected && test_bit(hw, mpic->protected))
return -EINVAL;
if (mpic->protected && test_bit(hw, mpic->protected)) {
pr_warning("mpic: Mapping of source 0x%x failed, "
"source protected by firmware !\n",\
(unsigned int)hw);
return -EPERM;
}

#ifdef CONFIG_SMP
else if (hw >= mpic->ipi_vecs[0]) {
Expand All @@ -1029,8 +1033,12 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq,
if (mpic_map_error_int(mpic, virq, hw))
return 0;

if (hw >= mpic->num_sources)
if (hw >= mpic->num_sources) {
pr_warning("mpic: Mapping of source 0x%x failed, "
"source out of range !\n",\
(unsigned int)hw);
return -EINVAL;
}

mpic_msi_reserve_hwirq(mpic, hw);

Expand Down
20 changes: 17 additions & 3 deletions trunk/kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,23 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
if (domain->ops->map) {
ret = domain->ops->map(domain, virq, hwirq);
if (ret != 0) {
pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n",
virq, hwirq, ret);
WARN_ON(1);
/*
* If map() returns -EPERM, this interrupt is protected
* by the firmware or some other service and shall not
* be mapped.
*
* Since on some platforms we blindly try to map everything
* we end up with a log full of backtraces.
*
* So instead, we silently fail on -EPERM, it is the
* responsibility of the PIC driver to display a relevant
* message if needed.
*/
if (ret != -EPERM) {
pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n",
virq, hwirq, ret);
WARN_ON(1);
}
irq_data->domain = NULL;
irq_data->hwirq = 0;
goto err_unmap;
Expand Down

0 comments on commit c9bd6db

Please sign in to comment.