summaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-06-29 17:33:36 -0400
committerThomas Gleixner <tglx@linutronix.de>2017-07-04 06:46:15 -0400
commit3a90795e1e885167209056a1a90be965add30e25 (patch)
treec43c934f393205ad3ee7d9092cb3724e0a69fe37 /kernel/irq/manage.c
parent2372a519f63829b8effcdde5f4564a7e036294f0 (diff)
genirq: Move bus locking into __setup_irq()
There is no point in having the irq_bus_lock() protection around all callers to __setup_irq(). Move it into __setup_irq(). This is also a preparatory patch for addressing the issues with the irq resource callbacks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Julia Cartwright <julia@ni.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Brian Norris <briannorris@chromium.org> Cc: Doug Anderson <dianders@chromium.org> Cc: linux-rockchip@lists.infradead.org Cc: John Keeping <john@metanate.com> Cc: linux-gpio@vger.kernel.org Link: http://lkml.kernel.org/r/20170629214343.960949031@linutronix.de
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 5c11c1730ba5..0934e02fa04e 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1167,6 +1167,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1167 if (desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE) 1167 if (desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)
1168 new->flags &= ~IRQF_ONESHOT; 1168 new->flags &= ~IRQF_ONESHOT;
1169 1169
1170 chip_bus_lock(desc);
1171
1170 /* 1172 /*
1171 * The following block of code has to be executed atomically 1173 * The following block of code has to be executed atomically
1172 */ 1174 */
@@ -1347,6 +1349,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1347 } 1349 }
1348 1350
1349 raw_spin_unlock_irqrestore(&desc->lock, flags); 1351 raw_spin_unlock_irqrestore(&desc->lock, flags);
1352 chip_bus_sync_unlock(desc);
1350 1353
1351 irq_setup_timings(desc, new); 1354 irq_setup_timings(desc, new);
1352 1355
@@ -1378,6 +1381,8 @@ mismatch:
1378out_unlock: 1381out_unlock:
1379 raw_spin_unlock_irqrestore(&desc->lock, flags); 1382 raw_spin_unlock_irqrestore(&desc->lock, flags);
1380 1383
1384 chip_bus_sync_unlock(desc);
1385
1381out_thread: 1386out_thread:
1382 if (new->thread) { 1387 if (new->thread) {
1383 struct task_struct *t = new->thread; 1388 struct task_struct *t = new->thread;
@@ -1417,9 +1422,7 @@ int setup_irq(unsigned int irq, struct irqaction *act)
1417 if (retval < 0) 1422 if (retval < 0)
1418 return retval; 1423 return retval;
1419 1424
1420 chip_bus_lock(desc);
1421 retval = __setup_irq(irq, desc, act); 1425 retval = __setup_irq(irq, desc, act);
1422 chip_bus_sync_unlock(desc);
1423 1426
1424 if (retval) 1427 if (retval)
1425 irq_chip_pm_put(&desc->irq_data); 1428 irq_chip_pm_put(&desc->irq_data);
@@ -1674,9 +1677,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
1674 return retval; 1677 return retval;
1675 } 1678 }
1676 1679
1677 chip_bus_lock(desc);
1678 retval = __setup_irq(irq, desc, action); 1680 retval = __setup_irq(irq, desc, action);
1679 chip_bus_sync_unlock(desc);
1680 1681
1681 if (retval) { 1682 if (retval) {
1682 irq_chip_pm_put(&desc->irq_data); 1683 irq_chip_pm_put(&desc->irq_data);
@@ -1924,9 +1925,7 @@ int setup_percpu_irq(unsigned int irq, struct irqaction *act)
1924 if (retval < 0) 1925 if (retval < 0)
1925 return retval; 1926 return retval;
1926 1927
1927 chip_bus_lock(desc);
1928 retval = __setup_irq(irq, desc, act); 1928 retval = __setup_irq(irq, desc, act);
1929 chip_bus_sync_unlock(desc);
1930 1929
1931 if (retval) 1930 if (retval)
1932 irq_chip_pm_put(&desc->irq_data); 1931 irq_chip_pm_put(&desc->irq_data);
@@ -1980,9 +1979,7 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
1980 return retval; 1979 return retval;
1981 } 1980 }
1982 1981
1983 chip_bus_lock(desc);
1984 retval = __setup_irq(irq, desc, action); 1982 retval = __setup_irq(irq, desc, action);
1985 chip_bus_sync_unlock(desc);
1986 1983
1987 if (retval) { 1984 if (retval) {
1988 irq_chip_pm_put(&desc->irq_data); 1985 irq_chip_pm_put(&desc->irq_data);