kernel/kernel-std/debian/patches/0017-genirq-Export-affinity-setter-for-modules.patch
Li Zhou 998d337c2b Debian: porting kernel commits from centos
To keep kernel debian stx aligned with centos stx, porting below commits
from centos stx to debian stx:
(1)patches related
   ef3c9a4 kernel: Add auxiliary bus support
   19ca0df kernel: Backport IRQ affinity patches
   a10b746 workqueue affinity: Remove unused variable
   8fde1a8 kthread_cpus: Avoid large stack allocation
   bb6ec66 scsi: Make the disk detection order more consistent
   bf940a8 rcu: Avoid RCU-related unexpected reboot
   cfe452a workqueue: Affine rescuer threads and unbound wqs
(2)config related
   6fe8d60 kernel: Disable NVMe multi-path kconfig option
   c9cdb90 Fixup recent kconfig cleanup
   8551799 Resolve v5.10 kernel configuration file differences
(3)kernel-modules related
   7ded004 kernel-modules: IRQ affinity hint fix-ups

Please pay attention to:
[ef3c9a4 kernel: Add auxiliary bus support]
which is not only related with kernel patches but also related with
kernel-modules.
It removes the auxiliary.ko from the oot ice package because auxiliary
bus device driver is built into kernel. But the detecting of builtin
auxiliary driver in intel-iavf/intel-ice oot driver will fail because
debian has 2 linux header packages. So extra patches are added for
intel-iavf and intel-ice to pass linux common header to check_aux_bus
to make builtin auxiliary driver detected. At the same time the patch
[check_aux_bus: Look for kernel headers in the right location]
for the oot drivers is removed because it isn't needed any more if
the right header path is passed.

Test Plan:
 - PASS: Build kernel-std/kernel-rt.
 - PASS: Build the 7 oot kernel modules for kernel-std/kernel-rt.
 - PASS: Build the iso for kernel-std and modules and boot up on qemu.
 - PASS: Build the test iso for kernel-rt and modules and boot up
         on qemu.

Story: 2009221
Task: 44989
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Change-Id: Ic7cddc068eab1516800e90bfe431d042274f86d3
2022-04-14 21:33:05 -04:00

125 lines
4.1 KiB
Diff

From 7c2dc6277376104f8cfe7f8d07c77f6d7155fb73 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 18 May 2021 11:17:26 +0200
Subject: [PATCH] genirq: Export affinity setter for modules
Perf modules abuse irq_set_affinity_hint() to set the affinity of system
PMU interrupts just because irq_set_affinity() was not exported.
The fact that irq_set_affinity_hint() actually sets the affinity is a
non-documented side effect and the name is clearly saying it's a hint.
To clean this up, export the real affinity setter.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20210518093117.968251441@linutronix.de
(cherry picked from commit 4d80d6ca5d77fde9880da8466e5b64f250e5bf82)
[mvb: Adjust context for a function that does not exist in v5.10.]
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
---
include/linux/interrupt.h | 35 ++---------------------------------
kernel/irq/manage.c | 33 ++++++++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index ee8299eb1f52..087a1cfad35c 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -314,39 +314,8 @@ struct irq_affinity_desc {
extern cpumask_var_t irq_default_affinity;
-/* Internal implementation. Use the helpers below */
-extern int __irq_set_affinity(unsigned int irq, const struct cpumask *cpumask,
- bool force);
-
-/**
- * irq_set_affinity - Set the irq affinity of a given irq
- * @irq: Interrupt to set affinity
- * @cpumask: cpumask
- *
- * Fails if cpumask does not contain an online CPU
- */
-static inline int
-irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
-{
- return __irq_set_affinity(irq, cpumask, false);
-}
-
-/**
- * irq_force_affinity - Force the irq affinity of a given irq
- * @irq: Interrupt to set affinity
- * @cpumask: cpumask
- *
- * Same as irq_set_affinity, but without checking the mask against
- * online cpus.
- *
- * Solely for low level cpu hotplug code, where we need to make per
- * cpu interrupts affine before the cpu becomes online.
- */
-static inline int
-irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
-{
- return __irq_set_affinity(irq, cpumask, true);
-}
+extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
+extern int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask);
extern int irq_can_set_affinity(unsigned int irq);
extern int irq_select_affinity(unsigned int irq);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 420b5ce0bf89..eeedb6224e2f 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -371,7 +371,8 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
return ret;
}
-int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force)
+static int __irq_set_affinity(unsigned int irq, const struct cpumask *mask,
+ bool force)
{
struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
@@ -386,6 +387,36 @@ int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force)
return ret;
}
+/**
+ * irq_set_affinity - Set the irq affinity of a given irq
+ * @irq: Interrupt to set affinity
+ * @cpumask: cpumask
+ *
+ * Fails if cpumask does not contain an online CPU
+ */
+int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
+{
+ return __irq_set_affinity(irq, cpumask, false);
+}
+EXPORT_SYMBOL_GPL(irq_set_affinity);
+
+/**
+ * irq_force_affinity - Force the irq affinity of a given irq
+ * @irq: Interrupt to set affinity
+ * @cpumask: cpumask
+ *
+ * Same as irq_set_affinity, but without checking the mask against
+ * online cpus.
+ *
+ * Solely for low level cpu hotplug code, where we need to make per
+ * cpu interrupts affine before the cpu becomes online.
+ */
+int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
+{
+ return __irq_set_affinity(irq, cpumask, true);
+}
+EXPORT_SYMBOL_GPL(irq_force_affinity);
+
int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m)
{
unsigned long flags;
--
2.29.2