]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Mar 2018 08:48:03 +0000 (10:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Mar 2018 08:48:03 +0000 (10:48 +0200)
added patches:
revert-genirq-use-irqd_get_trigger_type-to-compare-the.patch

queue-4.9/genirq-track-whether-the-trigger-type-has-been-set.patch [deleted file]
queue-4.9/revert-genirq-use-irqd_get_trigger_type-to-compare-the.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/genirq-track-whether-the-trigger-type-has-been-set.patch b/queue-4.9/genirq-track-whether-the-trigger-type-has-been-set.patch
deleted file mode 100644 (file)
index 07e135b..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-From 4f8413a3a799c958f7a10a6310a451e6b8aef5ad Mon Sep 17 00:00:00 2001
-From: Marc Zyngier <marc.zyngier@arm.com>
-Date: Thu, 9 Nov 2017 14:17:59 +0000
-Subject: genirq: Track whether the trigger type has been set
-
-From: Marc Zyngier <marc.zyngier@arm.com>
-
-commit 4f8413a3a799c958f7a10a6310a451e6b8aef5ad upstream.
-
-When requesting a shared interrupt, we assume that the firmware
-support code (DT or ACPI) has called irqd_set_trigger_type
-already, so that we can retrieve it and check that the requester
-is being reasonnable.
-
-Unfortunately, we still have non-DT, non-ACPI systems around,
-and these guys won't call irqd_set_trigger_type before requesting
-the interrupt. The consequence is that we fail the request that
-would have worked before.
-
-We can either chase all these use cases (boring), or address it
-in core code (easier). Let's have a per-irq_desc flag that
-indicates whether irqd_set_trigger_type has been called, and
-let's just check it when checking for a shared interrupt.
-If it hasn't been set, just take whatever the interrupt
-requester asks.
-
-Fixes: 382bd4de6182 ("genirq: Use irqd_get_trigger_type to compare the trigger type for shared IRQs")
-Cc: stable@vger.kernel.org
-Reported-and-tested-by: Petr Cvek <petrcvekcz@gmail.com>
-Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- include/linux/irq.h |   11 ++++++++++-
- kernel/irq/manage.c |   13 ++++++++++++-
- 2 files changed, 22 insertions(+), 2 deletions(-)
-
---- a/include/linux/irq.h
-+++ b/include/linux/irq.h
-@@ -199,6 +199,7 @@ struct irq_data {
-  * IRQD_WAKEUP_ARMED          - Wakeup mode armed
-  * IRQD_FORWARDED_TO_VCPU     - The interrupt is forwarded to a VCPU
-  * IRQD_AFFINITY_MANAGED      - Affinity is auto-managed by the kernel
-+ * IRQD_DEFAULT_TRIGGER_SET   - Expected trigger already been set
-  */
- enum {
-       IRQD_TRIGGER_MASK               = 0xf,
-@@ -216,6 +217,7 @@ enum {
-       IRQD_WAKEUP_ARMED               = (1 << 19),
-       IRQD_FORWARDED_TO_VCPU          = (1 << 20),
-       IRQD_AFFINITY_MANAGED           = (1 << 21),
-+      IRQD_DEFAULT_TRIGGER_SET        = (1 << 25),
- };
- #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
-@@ -245,18 +247,25 @@ static inline void irqd_mark_affinity_wa
-       __irqd_to_state(d) |= IRQD_AFFINITY_SET;
- }
-+static inline bool irqd_trigger_type_was_set(struct irq_data *d)
-+{
-+      return __irqd_to_state(d) & IRQD_DEFAULT_TRIGGER_SET;
-+}
-+
- static inline u32 irqd_get_trigger_type(struct irq_data *d)
- {
-       return __irqd_to_state(d) & IRQD_TRIGGER_MASK;
- }
- /*
-- * Must only be called inside irq_chip.irq_set_type() functions.
-+ * Must only be called inside irq_chip.irq_set_type() functions or
-+ * from the DT/ACPI setup code.
-  */
- static inline void irqd_set_trigger_type(struct irq_data *d, u32 type)
- {
-       __irqd_to_state(d) &= ~IRQD_TRIGGER_MASK;
-       __irqd_to_state(d) |= type & IRQD_TRIGGER_MASK;
-+      __irqd_to_state(d) |= IRQD_DEFAULT_TRIGGER_SET;
- }
- static inline bool irqd_is_level_type(struct irq_data *d)
---- a/kernel/irq/manage.c
-+++ b/kernel/irq/manage.c
-@@ -1210,7 +1210,18 @@ __setup_irq(unsigned int irq, struct irq
-                * set the trigger type must match. Also all must
-                * agree on ONESHOT.
-                */
--              unsigned int oldtype = irqd_get_trigger_type(&desc->irq_data);
-+              unsigned int oldtype;
-+
-+              /*
-+               * If nobody did set the configuration before, inherit
-+               * the one provided by the requester.
-+               */
-+              if (irqd_trigger_type_was_set(&desc->irq_data)) {
-+                      oldtype = irqd_get_trigger_type(&desc->irq_data);
-+              } else {
-+                      oldtype = new->flags & IRQF_TRIGGER_MASK;
-+                      irqd_set_trigger_type(&desc->irq_data, oldtype);
-+              }
-               if (!((old->flags & new->flags) & IRQF_SHARED) ||
-                   (oldtype != (new->flags & IRQF_TRIGGER_MASK)) ||
diff --git a/queue-4.9/revert-genirq-use-irqd_get_trigger_type-to-compare-the.patch b/queue-4.9/revert-genirq-use-irqd_get_trigger_type-to-compare-the.patch
new file mode 100644 (file)
index 0000000..be2c217
--- /dev/null
@@ -0,0 +1,38 @@
+From 399af491b3f604277121f817ab0da9be6801bcef Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Fri, 30 Mar 2018 10:43:30 +0200
+Subject: [PATCH] Revert "genirq: Use irqd_get_trigger_type to compare the
+ trigger type for shared IRQs"
+
+This reverts commit f2596a9808acfd02ce1ee389f0e1c37e64aec5f6 which is
+commit 382bd4de61827dbaaf5fb4fb7b1f4be4a86505e7 upstream.
+
+It causes too many problems with the stable tree, and would require too
+many other things to be backported, so just revert it.
+
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Hans de Goede <hdegoede@redhat.com>
+Cc: Marc Zyngier <marc.zyngier@arm.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Sasha Levin <alexander.levin@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/irq/manage.c |    4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/kernel/irq/manage.c
++++ b/kernel/irq/manage.c
+@@ -1210,10 +1210,8 @@ __setup_irq(unsigned int irq, struct irq
+                * set the trigger type must match. Also all must
+                * agree on ONESHOT.
+                */
+-              unsigned int oldtype = irqd_get_trigger_type(&desc->irq_data);
+-
+               if (!((old->flags & new->flags) & IRQF_SHARED) ||
+-                  (oldtype != (new->flags & IRQF_TRIGGER_MASK)) ||
++                  ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) ||
+                   ((old->flags ^ new->flags) & IRQF_ONESHOT))
+                       goto mismatch;
index 48fe49baf612f7f4bfb3e4b3a9cf6968bc1c9de4..f0e0f9b8232111bc87488983af07338fdd632e00 100644 (file)
@@ -1,5 +1,5 @@
 scsi-sg-don-t-return-bogus-sg_requests.patch
-genirq-track-whether-the-trigger-type-has-been-set.patch
+revert-genirq-use-irqd_get_trigger_type-to-compare-the.patch
 net-sched-actions-return-explicit-error-when-tunnel_key-mode-is-not-specified.patch
 ppp-avoid-loop-in-xmit-recursion-detection-code.patch
 rhashtable-fix-rhlist-duplicates-insertion.patch