Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1466563
| From | Paul Burton <paul.burton@imgtec.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] irqchip: mips-gic: Cleanup chip & handler setup |
| Date | 2016-08-19 19:10 +0200 |
| Message-ID | <s7VsR-8o7-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
gic_shared_irq_domain_map() is called from gic_irq_domain_alloc() where
the wrong chip has been set, and is then overwritten. Tidy this up by
setting the correct chip the first time, and setting the
handle_level_irq handler from gic_irq_domain_alloc() too.
gic_shared_irq_domain_map() is also called from gic_irq_domain_map(),
which now calls irq_set_chip_and_handler() to retain its previous
behaviour.
This patch also prepares for a follow-on which will call
gic_shared_irq_domain_map() from a callback where the lock on the struct
irq_desc is held, which without this change would cause the call to
irq_set_chip_and_handler() to lead to a deadlock.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Fixes: c98c1822ee13 ("irqchip/mips-gic: Add device hierarchy domain")
Cc: stable@vger.kernel.org # v4.6+
---
Marked with the Fixes: tag as it's a prerequisite for the following bug fix
patch. Feel free to drop the tag if it's considered clearer without.
---
drivers/irqchip/irq-mips-gic.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index 70ed1d0..d7ec984 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -713,9 +713,6 @@ static int gic_shared_irq_domain_map(struct irq_domain *d, unsigned int virq,
unsigned long flags;
int i;
- irq_set_chip_and_handler(virq, &gic_level_irq_controller,
- handle_level_irq);
-
spin_lock_irqsave(&gic_lock, flags);
gic_map_to_pin(intr, gic_cpu_pin);
gic_map_to_vpe(intr, mips_cm_vp_id(vpe));
@@ -732,6 +729,10 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq,
{
if (GIC_HWIRQ_TO_LOCAL(hw) < GIC_NUM_LOCAL_INTRS)
return gic_local_irq_domain_map(d, virq, hw);
+
+ irq_set_chip_and_handler(virq, &gic_level_irq_controller,
+ handle_level_irq);
+
return gic_shared_irq_domain_map(d, virq, hw, 0);
}
@@ -771,11 +772,13 @@ static int gic_irq_domain_alloc(struct irq_domain *d, unsigned int virq,
hwirq = GIC_SHARED_TO_HWIRQ(base_hwirq + i);
ret = irq_domain_set_hwirq_and_chip(d, virq + i, hwirq,
- &gic_edge_irq_controller,
+ &gic_level_irq_controller,
NULL);
if (ret)
goto error;
+ irq_set_handler(virq + i, handle_level_irq);
+
ret = gic_shared_irq_domain_map(d, virq + i, hwirq, cpu);
if (ret)
goto error;
--
2.9.3
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/2] irqchip: mips-gic: Cleanup chip & handler setup Paul Burton <paul.burton@imgtec.com> - 2016-08-19 19:10 +0200
[PATCH 2/2] irqchip: mips-gic: Implement activate op for device domain Paul Burton <paul.burton@imgtec.com> - 2016-08-19 19:10 +0200
[tip:x86/urgent] irqchip/mips-gic: Implement activate op for device domain tip-bot for Paul Burton <tipbot@zytor.com> - 2016-08-22 17:20 +0200
[tip:irq/urgent] irqchip/mips-gic: Implement activate op for device domain tip-bot for Paul Burton <tipbot@zytor.com> - 2016-08-22 18:50 +0200
[tip:x86/urgent] irqchip/mips-gic: Cleanup chip and handler setup tip-bot for Paul Burton <tipbot@zytor.com> - 2016-08-22 17:20 +0200
[tip:irq/urgent] irqchip/mips-gic: Cleanup chip and handler setup tip-bot for Paul Burton <tipbot@zytor.com> - 2016-08-22 18:50 +0200
csiph-web