From 4055235829c1cee7475696c3da70944b2ab1e01d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Oct 2025 11:30:59 +0000 Subject: [PATCH] Revert "genirq: Provide new interfaces for affinity hints" This reverts commit 7b2a67322aff353c70ba215b7c7f15df6810f274 which is commit 65c7cdedeb3026fabcc967a7aae2f755ad4d0783 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: Ic50159039a689542f5d6d0e773464263e9d33be4 Signed-off-by: Greg Kroah-Hartman --- include/linux/interrupt.h | 53 +-------------------------------------- kernel/irq/manage.c | 8 +++--- 2 files changed, 5 insertions(+), 56 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 45e58b4298b8..c7b86df86a32 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -309,46 +309,7 @@ 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); -extern int __irq_apply_affinity_hint(unsigned int irq, const struct cpumask *m, - bool setaffinity); - -/** - * irq_update_affinity_hint - Update the affinity hint - * @irq: Interrupt to update - * @m: cpumask pointer (NULL to clear the hint) - * - * Updates the affinity hint, but does not change the affinity of the interrupt. - */ -static inline int -irq_update_affinity_hint(unsigned int irq, const struct cpumask *m) -{ - return __irq_apply_affinity_hint(irq, m, false); -} - -/** - * irq_set_affinity_and_hint - Update the affinity hint and apply the provided - * cpumask to the interrupt - * @irq: Interrupt to update - * @m: cpumask pointer (NULL to clear the hint) - * - * Updates the affinity hint and if @m is not NULL it applies it as the - * affinity of that interrupt. - */ -static inline int -irq_set_affinity_and_hint(unsigned int irq, const struct cpumask *m) -{ - return __irq_apply_affinity_hint(irq, m, true); -} - -/* - * Deprecated. Use irq_update_affinity_hint() or irq_set_affinity_and_hint() - * instead. - */ -static inline int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) -{ - return irq_set_affinity_and_hint(irq, m); -} - +extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); extern int irq_update_affinity_desc(unsigned int irq, struct irq_affinity_desc *affinity); @@ -380,18 +341,6 @@ static inline int irq_can_set_affinity(unsigned int irq) static inline int irq_select_affinity(unsigned int irq) { return 0; } -static inline int irq_update_affinity_hint(unsigned int irq, - const struct cpumask *m) -{ - return -EINVAL; -} - -static inline int irq_set_affinity_and_hint(unsigned int irq, - const struct cpumask *m) -{ - return -EINVAL; -} - static inline int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) { diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 32513a2e26eb..05601bcd3011 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -448,8 +448,7 @@ int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask) } EXPORT_SYMBOL_GPL(irq_force_affinity); -int __irq_apply_affinity_hint(unsigned int irq, const struct cpumask *m, - bool setaffinity) +int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) { unsigned long flags; struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL); @@ -458,11 +457,12 @@ int __irq_apply_affinity_hint(unsigned int irq, const struct cpumask *m, return -EINVAL; desc->affinity_hint = m; irq_put_desc_unlock(desc, flags); - if (m && setaffinity) + /* set the initial affinity to prevent every interrupt being on CPU0 */ + if (m) __irq_set_affinity(irq, m, false); return 0; } -EXPORT_SYMBOL_GPL(__irq_apply_affinity_hint); +EXPORT_SYMBOL_GPL(irq_set_affinity_hint); static void irq_affinity_notify(struct work_struct *work) {