kernel: backport commit reverting genirq patch causing regressions
[openwrt/staging/chunkeey.git] / target / linux / generic / patches-4.4 / 005-Revert-genirq-Use-irqd_get_trigger_type-to-compare-t.patch
1 From 6f879697d6393aa6918537c4c46e44c8579dd2a1 Mon Sep 17 00:00:00 2001
2 From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 Date: Fri, 30 Mar 2018 10:53:44 +0200
4 Subject: [PATCH] Revert "genirq: Use irqd_get_trigger_type to compare the
5 trigger type for shared IRQs"
6
7 This reverts commit 9d0273bb1c4b645817eccfe5c5975ea29add3300 which is
8 commit 382bd4de61827dbaaf5fb4fb7b1f4be4a86505e7 upstream.
9
10 It causes too many problems with the stable tree, and would require too
11 many other things to be backported, so just revert it.
12
13 Reported-by: Guenter Roeck <linux@roeck-us.net>
14 Cc: Thomas Gleixner <tglx@linutronix.de>
15 Cc: Hans de Goede <hdegoede@redhat.com>
16 Cc: Marc Zyngier <marc.zyngier@arm.com>
17 Cc: Thomas Gleixner <tglx@linutronix.de>
18 Cc: Sasha Levin <alexander.levin@microsoft.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 kernel/irq/manage.c | 4 +---
22 1 file changed, 1 insertion(+), 3 deletions(-)
23
24 --- a/kernel/irq/manage.c
25 +++ b/kernel/irq/manage.c
26 @@ -1189,10 +1189,8 @@ __setup_irq(unsigned int irq, struct irq
27 * set the trigger type must match. Also all must
28 * agree on ONESHOT.
29 */
30 - unsigned int oldtype = irqd_get_trigger_type(&desc->irq_data);
31 -
32 if (!((old->flags & new->flags) & IRQF_SHARED) ||
33 - (oldtype != (new->flags & IRQF_TRIGGER_MASK)) ||
34 + ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) ||
35 ((old->flags ^ new->flags) & IRQF_ONESHOT))
36 goto mismatch;
37