From: Cheick Traore cheick.traore@foss.st.com
[ Upstream commit 4c5cc2f65386e22166ce006efe515c667aa075e4 ]
Trying to set the affinity of the interrupts associated to stm32 pinctrl results in a write error.
Fill struct irq_chip::irq_set_affinity to use the default helper function.
Signed-off-by: Cheick Traore cheick.traore@foss.st.com Signed-off-by: Antonio Borneo antonio.borneo@foss.st.com Link: https://lore.kernel.org/20250610143042.295376-3-antonio.borneo@foss.st.com Signed-off-by: Linus Walleij linus.walleij@linaro.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
Based on my analysis, here's my assessment:
**Backport Status: YES**
This commit should be backported to stable kernel trees for the following reasons:
1. **Fixes a real bug**: The commit message explicitly states "Trying to set the affinity of the interrupts associated to stm32 pinctrl results in a write error." This is a functional bug that affects users trying to configure IRQ affinity on STM32 platforms.
2. **Small and contained fix**: The change is minimal - just adding a single line: ```c .irq_set_affinity = IS_ENABLED(CONFIG_SMP) ? irq_chip_set_affinity_parent : NULL, ``` This is a one-line fix that adds the missing callback to the irq_chip structure.
3. **Follows established patterns**: My analysis shows that other GPIO/pinctrl drivers already implement this callback in the same way: - `drivers/pinctrl/renesas/pinctrl-rzg2l.c` - `drivers/gpio/gpio-thunderx.c` - `drivers/gpio/gpio-msc313.c`
The STM32 driver was missing this standard callback that other similar drivers have.
4. **No architectural changes**: This is purely a bug fix that enables existing kernel functionality (IRQ affinity setting) to work properly. It doesn't introduce new features or change any architecture.
5. **Minimal regression risk**: The fix uses the standard `irq_chip_set_affinity_parent` helper function that's already well- tested in the kernel. The conditional compilation with `IS_ENABLED(CONFIG_SMP)` ensures it's only enabled on SMP systems where it's relevant.
6. **Related to known issues**: My search found related commits like `3e17683ff4a8` ("irqchip/stm32-exti: Fix irq_set_affinity return value") showing that the STM32 platform has had IRQ affinity issues that needed fixing.
7. **Clear user impact**: Without this fix, users cannot set IRQ affinity for GPIO interrupts on STM32 platforms, which can impact system performance optimization and interrupt load balancing on multi-core STM32 systems.
The commit meets all the stable tree criteria: it fixes an important bug, is small and self-contained, has minimal risk, and doesn't introduce new functionality. This is exactly the type of fix that should be backported to ensure stable kernels have proper functionality.
drivers/pinctrl/stm32/pinctrl-stm32.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index ba49d48c3a1d..e6ad63df82b7 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -411,6 +411,7 @@ static struct irq_chip stm32_gpio_irq_chip = { .irq_set_wake = irq_chip_set_wake_parent, .irq_request_resources = stm32_gpio_irq_request_resources, .irq_release_resources = stm32_gpio_irq_release_resources, + .irq_set_affinity = IS_ENABLED(CONFIG_SMP) ? irq_chip_set_affinity_parent : NULL, };
static int stm32_gpio_domain_translate(struct irq_domain *d,