]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 09:11:08 +0000 (10:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 09:11:08 +0000 (10:11 +0100)
added patches:
genirq-irqdomain-add-an-irq_create_mapping_affinity-function.patch

queue-4.9/genirq-irqdomain-add-an-irq_create_mapping_affinity-function.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/genirq-irqdomain-add-an-irq_create_mapping_affinity-function.patch b/queue-4.9/genirq-irqdomain-add-an-irq_create_mapping_affinity-function.patch
new file mode 100644 (file)
index 0000000..994b506
--- /dev/null
@@ -0,0 +1,104 @@
+From bb4c6910c8b41623104c2e64a30615682689a54d Mon Sep 17 00:00:00 2001
+From: Laurent Vivier <lvivier@redhat.com>
+Date: Thu, 26 Nov 2020 09:28:51 +0100
+Subject: genirq/irqdomain: Add an irq_create_mapping_affinity() function
+
+From: Laurent Vivier <lvivier@redhat.com>
+
+commit bb4c6910c8b41623104c2e64a30615682689a54d upstream.
+
+There is currently no way to convey the affinity of an interrupt
+via irq_create_mapping(), which creates issues for devices that
+expect that affinity to be managed by the kernel.
+
+In order to sort this out, rename irq_create_mapping() to
+irq_create_mapping_affinity() with an additional affinity parameter that
+can be passed down to irq_domain_alloc_descs().
+
+irq_create_mapping() is re-implemented as a wrapper around
+irq_create_mapping_affinity().
+
+No functional change.
+
+Fixes: e75eafb9b039 ("genirq/msi: Switch to new irq spreading infrastructure")
+Signed-off-by: Laurent Vivier <lvivier@redhat.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Reviewed-by: Greg Kurz <groug@kaod.org>
+Cc: Michael Ellerman <mpe@ellerman.id.au>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20201126082852.1178497-2-lvivier@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/irqdomain.h |   12 ++++++++++--
+ kernel/irq/irqdomain.c    |   13 ++++++++-----
+ 2 files changed, 18 insertions(+), 7 deletions(-)
+
+--- a/include/linux/irqdomain.h
++++ b/include/linux/irqdomain.h
+@@ -314,11 +314,19 @@ extern void irq_domain_associate_many(st
+ extern void irq_domain_disassociate(struct irq_domain *domain,
+                                   unsigned int irq);
+-extern unsigned int irq_create_mapping(struct irq_domain *host,
+-                                     irq_hw_number_t hwirq);
++extern unsigned int irq_create_mapping_affinity(struct irq_domain *host,
++                                    irq_hw_number_t hwirq,
++                                    const struct irq_affinity_desc *affinity);
+ extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec);
+ extern void irq_dispose_mapping(unsigned int virq);
++static inline unsigned int irq_create_mapping(struct irq_domain *host,
++                                            irq_hw_number_t hwirq)
++{
++      return irq_create_mapping_affinity(host, hwirq, NULL);
++}
++
++
+ /**
+  * irq_linear_revmap() - Find a linux irq from a hw irq number.
+  * @domain: domain owning this hardware interrupt
+--- a/kernel/irq/irqdomain.c
++++ b/kernel/irq/irqdomain.c
+@@ -443,17 +443,19 @@ unsigned int irq_create_direct_mapping(s
+ EXPORT_SYMBOL_GPL(irq_create_direct_mapping);
+ /**
+- * irq_create_mapping() - Map a hardware interrupt into linux irq space
++ * irq_create_mapping_affinity() - Map a hardware interrupt into linux irq space
+  * @domain: domain owning this hardware interrupt or NULL for default domain
+  * @hwirq: hardware irq number in that domain space
++ * @affinity: irq affinity
+  *
+  * Only one mapping per hardware interrupt is permitted. Returns a linux
+  * irq number.
+  * If the sense/trigger is to be specified, set_irq_type() should be called
+  * on the number returned from that call.
+  */
+-unsigned int irq_create_mapping(struct irq_domain *domain,
+-                              irq_hw_number_t hwirq)
++unsigned int irq_create_mapping_affinity(struct irq_domain *domain,
++                                     irq_hw_number_t hwirq,
++                                     const struct irq_affinity_desc *affinity)
+ {
+       struct device_node *of_node;
+       int virq;
+@@ -479,7 +481,8 @@ unsigned int irq_create_mapping(struct i
+       }
+       /* Allocate a virtual interrupt number */
+-      virq = irq_domain_alloc_descs(-1, 1, hwirq, of_node_to_nid(of_node), NULL);
++      virq = irq_domain_alloc_descs(-1, 1, hwirq, of_node_to_nid(of_node),
++                                    affinity);
+       if (virq <= 0) {
+               pr_debug("-> virq allocation failed\n");
+               return 0;
+@@ -495,7 +498,7 @@ unsigned int irq_create_mapping(struct i
+       return virq;
+ }
+-EXPORT_SYMBOL_GPL(irq_create_mapping);
++EXPORT_SYMBOL_GPL(irq_create_mapping_affinity);
+ /**
+  * irq_create_strict_mappings() - Map a range of hw irqs to fixed linux irqs
index 9995de53353fcf3ab0e67950dbe586c0439bae77..4f3a623a4e8a0d8e4972ba5bf41c1ec41ff0ac1f 100644 (file)
@@ -31,4 +31,5 @@ alsa-hda-generic-add-option-to-enforce-preferred_dacs-pairs.patch
 tty-fix-session-locking.patch
 ftrace-fix-updating-ftrace_fl_tramp.patch
 cifs-fix-potential-use-after-free-in-cifs_echo_request.patch
+genirq-irqdomain-add-an-irq_create_mapping_affinity-function.patch
 powerpc-pseries-pass-msi-affinity-to-irq_create_mapping.patch