* [PATCH v2] MIPS: SiByte: Update effective IRQ affinity
@ 2026-11-09 18:26 Florian Fainelli
2026-12-05 10:56 ` Thomas Bogendoerfer
0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2026-11-09 18:26 UTC (permalink / raw)
To: linux-mips
Cc: macro, Florian Fainelli, Thomas Bogendoerfer, Thomas Gleixner,
open list
Booting an SB1250 kernel with CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
enabled reports:
genirq: irq_chip SB1250-IMR did not update eff. affinity mask of irq 2
The interrupt mapper selects the first online CPU in the requested mask,
but sb1250_set_affinity() does not update the effective affinity mask.
Returning IRQ_SET_MASK_OK makes the IRQ core copy the requested mask to
irq_common_data.affinity, but leaves the separate effective affinity mask
empty, triggering irq_validate_effective_affinity().
Update the effective affinity with the single logical CPU selected as
the hardware target. Apply the same update to the analogous BCM1480
callback, and use IRQ_SET_MASK_OK explicitly in both callbacks.
The IRQ core already rejects masks without an online CPU for normal
affinity changes, so no additional mask validation is needed here.
Fixes: 421d1563c662 ("mips: Validate online cpus in irq_set_affinity() callbacks")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:
- update commit message
- cover bcm1480, remove the check on nr_cpu_ids
arch/mips/sibyte/bcm1480/irq.c | 3 ++-
arch/mips/sibyte/sb1250/irq.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 7929bee911eb..4c18a2c755d2 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -113,9 +113,10 @@ static int bcm1480_set_affinity(struct irq_data *d, const struct cpumask *mask,
____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
}
}
+ irq_data_update_effective_affinity(d, cpumask_of(i));
raw_spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
- return 0;
+ return IRQ_SET_MASK_OK;
}
#endif
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index d7a656cd7ec0..a971bdfac356 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -108,7 +108,7 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask,
irq_data_update_effective_affinity(d, cpumask_of(i));
raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
- return 0;
+ return IRQ_SET_MASK_OK;
}
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] MIPS: SiByte: Update effective IRQ affinity
2026-11-09 18:26 [PATCH v2] MIPS: SiByte: Update effective IRQ affinity Florian Fainelli
@ 2026-12-05 10:56 ` Thomas Bogendoerfer
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2026-12-05 10:56 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mips, macro, Thomas Gleixner, open list
On Mon, Nov 09, 2026 at 10:26:22AM -0800, Florian Fainelli wrote:
> Booting an SB1250 kernel with CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
> enabled reports:
>
> genirq: irq_chip SB1250-IMR did not update eff. affinity mask of irq 2
>
> The interrupt mapper selects the first online CPU in the requested mask,
> but sb1250_set_affinity() does not update the effective affinity mask.
> Returning IRQ_SET_MASK_OK makes the IRQ core copy the requested mask to
> irq_common_data.affinity, but leaves the separate effective affinity mask
> empty, triggering irq_validate_effective_affinity().
>
> Update the effective affinity with the single logical CPU selected as
> the hardware target. Apply the same update to the analogous BCM1480
> callback, and use IRQ_SET_MASK_OK explicitly in both callbacks.
>
> The IRQ core already rejects masks without an online CPU for normal
> affinity changes, so no additional mask validation is needed here.
>
> Fixes: 421d1563c662 ("mips: Validate online cpus in irq_set_affinity() callbacks")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> Changes in v2:
>
> - update commit message
> - cover bcm1480, remove the check on nr_cpu_ids
while you removed the nr_cpu_ids check compared to your v1 version,
you are missing
+ irq_data_update_effective_affinity(d, cpumask_of(i));
As I have not reverted the applied v1, I need either a v3 with
the part the added line above or something which gets mips-next
fixed correctly. I'm fine with both.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-05 11:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09 18:26 [PATCH v2] MIPS: SiByte: Update effective IRQ affinity Florian Fainelli
2026-12-05 10:56 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox