--- zzzz-none-000/linux-4.19.183/kernel/irq/cpuhotplug.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/kernel/irq/cpuhotplug.c 2023-06-28 08:54:21.000000000 +0000 @@ -15,6 +15,10 @@ #include "internals.h" +#ifdef CONFIG_BCM_KF_CPU_AFFINITY_HINT +#include +#endif + /* For !GENERIC_IRQ_EFFECTIVE_AFF_MASK this looks at general affinity mask */ static inline bool irq_needs_fixup(struct irq_data *d) { @@ -119,6 +123,13 @@ irq_shutdown_and_deactivate(desc); return false; } +#ifdef CONFIG_BCM_KF_CPU_AFFINITY_HINT + // affine cpu is offline; any hinted cpu online? + if (desc->affinity_hint && cpumask_any_and(desc->affinity_hint, + cpu_online_mask) < nr_cpu_ids) + affinity = desc->affinity_hint; + else +#endif affinity = cpu_online_mask; brokeaff = true; } @@ -208,6 +219,9 @@ desc = irq_to_desc(irq); raw_spin_lock_irq(&desc->lock); irq_restore_affinity_of_irq(desc, cpu); +#ifdef CONFIG_BCM_KF_CPU_AFFINITY_HINT + bcm63xx_rehint_one_irq(desc, cpu); +#endif raw_spin_unlock_irq(&desc->lock); } irq_unlock_sparse();