[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <175052300141.406.12227606749602048237.tip-bot2@tip-bot2>
Date: Sat, 21 Jun 2025 16:23:21 -0000
From: "tip-bot2 for Markus Stockhausen" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Sebastian Gottschall <s.gottschall@...wrt.com>,
Markus Stockhausen <markus.stockhausen@....de>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: irq/drivers] irqchip/mips-gic: Allow forced affinity
The following commit has been merged into the irq/drivers branch of tip:
Commit-ID: 2250db8628a0d8293ad2e0671138b848a185fba1
Gitweb: https://git.kernel.org/tip/2250db8628a0d8293ad2e0671138b848a185fba1
Author: Markus Stockhausen <markus.stockhausen@....de>
AuthorDate: Sat, 21 Jun 2025 01:49:51 -04:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Sat, 21 Jun 2025 18:20:54 +02:00
irqchip/mips-gic: Allow forced affinity
Devices of the Realtek MIPS Otto platform use the official rtl-otto-timer
as clock event generator and CPU clocksource. It is registered for each CPU
startup via cpuhp_setup_state() and forces the affinity of the clockevent
interrupts to the appropriate CPU via irq_force_affinity().
On the "smaller" devices with a vendor specific interrupt controller
(supported by irq-realtek-rtl) the registration works fine. The "larger"
RTL931x series is based on a MIPS interAptiv dual core with a MIPS GIC
controller. Interrupt routing setup is cancelled because gic_set_affinity()
does not accept the current (not yet online) CPU as a target.
Relax the checks by evaluating the force parameter that is provided for
exactly this purpose like in other drivers. With this the affinity can be
set as follows:
- force = false: allow to set affinity to any online cpu
- force = true: allow to set affinity to any cpu
Co-developed-by: Sebastian Gottschall <s.gottschall@...wrt.com>
Signed-off-by: Sebastian Gottschall <s.gottschall@...wrt.com>
Signed-off-by: Markus Stockhausen <markus.stockhausen@....de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lore.kernel.org/all/20250621054952.380374-1-markus.stockhausen@gmx.de
---
drivers/irqchip/irq-mips-gic.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index 34e8d09..19a57c5 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -375,9 +375,13 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
/*
* The GIC specifies that we can only route an interrupt to one VP(E),
* ie. CPU in Linux parlance, at a time. Therefore we always route to
- * the first online CPU in the mask.
+ * the first forced or online CPU in the mask.
*/
- cpu = cpumask_first_and(cpumask, cpu_online_mask);
+ if (force)
+ cpu = cpumask_first(cpumask);
+ else
+ cpu = cpumask_first_and(cpumask, cpu_online_mask);
+
if (cpu >= NR_CPUS)
return -EINVAL;
Powered by blists - more mailing lists