linux-stable/drivers/pinctrl
Rafael J. Wysocki 5543766d4b genirq: Introduce IRQF_COND_ONESHOT and use it in pinctrl-amd
commit c2ddeb2961 upstream.

There is a problem when a driver requests a shared interrupt line to run a
threaded handler on it without IRQF_ONESHOT set if that flag has been set
already for the IRQ in question by somebody else.  Namely, the request
fails which usually leads to a probe failure even though the driver might
have worked just fine with IRQF_ONESHOT, but it does not want to use it by
default.  Currently, the only way to handle this is to try to request the
IRQ without IRQF_ONESHOT, but with IRQF_PROBE_SHARED set and if this fails,
try again with IRQF_ONESHOT set.  However, this is a bit cumbersome and not
very clean.

When commit 7a36b901a6 ("ACPI: OSL: Use a threaded interrupt handler for
SCI") switched the ACPI subsystem over to using a threaded interrupt
handler for the SCI, it had to use IRQF_ONESHOT for it because that's
required due to the way the SCI handler works (it needs to walk all of the
enabled GPEs before the interrupt line can be unmasked). The SCI interrupt
line is not shared with other users very often due to the SCI handling
overhead, but on sone systems it is shared and when the other user of it
attempts to install a threaded handler, a flags mismatch related to
IRQF_ONESHOT may occur.

As it turned out, that happened to the pinctrl-amd driver and so commit
4451e8e841 ("pinctrl: amd: Add IRQF_ONESHOT to the interrupt request")
attempted to address the issue by adding IRQF_ONESHOT to the interrupt
flags in that driver, but this is now causing an IRQF_ONESHOT-related
mismatch to occur on another system which cannot boot as a result of it.

Clearly, pinctrl-amd can work with IRQF_ONESHOT if need be, but it should
not set that flag by default, so it needs a way to indicate that to the
interrupt subsystem.

To that end, introdcuce a new interrupt flag, IRQF_COND_ONESHOT, which will
only have effect when the IRQ line is shared and IRQF_ONESHOT has been set
for it already, in which case it will be promoted to the latter.

This is sufficient for drivers sharing the interrupt line with the SCI as
it is requested by the ACPI subsystem before any drivers are probed, so
they will always see IRQF_ONESHOT set for the interrupt in question.

Fixes: 4451e8e841 ("pinctrl: amd: Add IRQF_ONESHOT to the interrupt request")
Reported-by: Francisco Ayala Le Brun <francisco@videowindow.eu>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: 6.8+ <stable@vger.kernel.org> # 6.8+
Closes: https://lore.kernel.org/lkml/CAN-StX1HqWqi+YW=t+V52-38Mfp5fAz7YHx4aH-CQjgyNiKx3g@mail.gmail.com/
Link: https://lore.kernel.org/r/12417336.O9o76ZdvQC@kreacher
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-03 15:32:45 +02:00
..
actions
aspeed pinctrl: aspeed: Allow changing SPI mode from hardware strap defaults 2023-10-10 14:01:30 +02:00
bcm pinctrl: bcm: Convert to use grp member 2023-12-12 00:47:52 +01:00
berlin pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
cirrus pinctrl: lochnagar: Don't build on MIPS 2023-11-16 14:40:38 +01:00
freescale pinctrl: imx: Convert to use grp member 2023-12-12 00:47:52 +01:00
intel intel-pinctrl for v6.8-1 2023-12-18 23:42:42 +01:00
mediatek pinctrl: mediatek: Drop bogus slew rate register range for MT8192 2024-03-26 18:17:03 -04:00
meson pinctrl: Add driver support for Amlogic T7 SoCs 2023-09-25 15:49:18 +02:00
mvebu pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
nomadik gpio: nomadik: fix offset bug in nmk_pmx_set() 2024-03-26 18:17:15 -04:00
nuvoton pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP() 2023-12-07 10:53:57 +01:00
nxp pinctrl: s32cc: Avoid possible string truncation 2023-11-14 14:43:37 +01:00
pxa
qcom pinctrl: qcom: sm8650-lpass-lpi: correct Kconfig name 2024-04-03 15:32:05 +02:00
realtek pinctrl: realtek: Fix logical error when finding descriptor 2023-11-24 10:39:20 +01:00
renesas pinctrl: renesas: Allow the compiler to optimize away sh_pfc_pm 2024-03-26 18:17:09 -04:00
samsung pinctrl: samsung: constify iomem pointers 2023-12-28 22:13:17 +01:00
spear treewide: rename pinctrl_gpio_free_new() 2023-11-04 10:23:21 +01:00
sprd pinctrl: sprd-sc9860: Convert to platform remove callback returning void 2023-10-10 15:47:50 +02:00
starfive This is the main pin control pull request for the v6.8 kernel series. 2024-01-17 15:55:33 -08:00
stm32 pinctrl: stm32: fix PM support for stm32mp257 2024-02-13 09:42:22 +01:00
sunplus pinctrl: sppctl: use gpiochip_dup_line_label() 2023-12-08 09:26:37 +01:00
sunxi pinctrl: sunxi: h616: add extra gpio banks 2023-09-25 15:26:33 +02:00
tegra pinctrl: tegra: Display pin function in pinconf-groups 2023-11-13 14:57:22 +01:00
ti pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
uniphier pinctrl: uniphier: Annotate struct uniphier_pinctrl_reg_region with __counted_by 2023-09-27 10:59:06 +02:00
visconti
vt8500 pinctrl: vt8500: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
core.c pinctrl: don't put the reference to GPIO device in pinctrl_pins_show() 2024-02-29 14:36:40 +01:00
core.h pinctrl: core: Remove unused members from struct group_desc 2023-12-12 00:47:52 +01:00
devicetree.c pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
devicetree.h
Kconfig Immutable tag for the PEF2256 framer 2023-12-12 23:08:30 +01:00
Makefile Immutable tag for the PEF2256 framer 2023-12-12 23:08:30 +01:00
pinconf-generic.c pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinconf.c pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinconf.h pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinctrl-amd.c genirq: Introduce IRQF_COND_ONESHOT and use it in pinctrl-amd 2024-04-03 15:32:45 +02:00
pinctrl-amd.h pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend 2023-12-04 15:46:02 +01:00
pinctrl-apple-gpio.c
pinctrl-artpec6.c pinctrl: artpec6: Convert to platform remove callback returning void 2023-10-10 15:39:10 +02:00
pinctrl-as3722.c pinctrl: as3722: Use devm_gpiochip_add_data() to simplify remove path 2023-11-24 11:22:12 +01:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: use dedicated lock class for IRQ 2023-12-21 09:05:02 +01:00
pinctrl-at91.c pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
pinctrl-at91.h
pinctrl-axp209.c pinctrl: axp209: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
pinctrl-bm1880.c
pinctrl-cy8c95x0.c This is the main pin control pull request for the v6.8 kernel series. 2024-01-17 15:55:33 -08:00
pinctrl-da850-pupd.c
pinctrl-da9062.c
pinctrl-digicolor.c
pinctrl-equilibrium.c pinctrl: equilibrium: Convert to use grp member 2023-12-12 00:47:52 +01:00
pinctrl-equilibrium.h
pinctrl-falcon.c
pinctrl-gemini.c
pinctrl-ingenic.c pinctrl: ingenic: Convert to use grp member 2023-12-12 00:47:52 +01:00
pinctrl-k210.c
pinctrl-keembay.c pinctrl: keembay: Convert to use grp member 2023-12-12 00:47:52 +01:00
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-loongson2.c
pinctrl-lpc18xx.c
pinctrl-max77620.c
pinctrl-mcp23s08.c
pinctrl-mcp23s08.h pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() 2023-10-10 13:39:38 +02:00
pinctrl-mcp23s08_i2c.c pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() 2023-10-10 13:39:38 +02:00
pinctrl-mcp23s08_spi.c pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() 2023-10-10 13:39:38 +02:00
pinctrl-microchip-sgpio.c
pinctrl-mlxbf3.c
pinctrl-ocelot.c pinctrl: ocelot: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:23 +01:00
pinctrl-palmas.c
pinctrl-pef2256.c pinctrl: Add support for the Lantic PEF2256 pinmux 2023-12-12 23:05:24 +01:00
pinctrl-pic32.c
pinctrl-pic32.h
pinctrl-pistachio.c
pinctrl-rk805.c pinctrl: rk805: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:23 +01:00
pinctrl-rockchip.c pinctrl: rockchip: Convert to platform remove callback returning void 2023-10-10 15:40:22 +02:00
pinctrl-rockchip.h
pinctrl-single.c pinctrl: pinctrl-single: add ti,j7200-padconf compatible 2023-12-04 15:32:42 +01:00
pinctrl-st.c pinctrl: st: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
pinctrl-stmfx.c pinctrl: stmfx: Convert to platform remove callback returning void 2023-10-10 15:41:35 +02:00
pinctrl-sx150x.c pinctrl: sx150x: Simplify probe() 2023-09-12 10:12:36 +02:00
pinctrl-tb10x.c pinctrl: tb10x: Convert to platform remove callback returning void 2023-10-10 15:42:07 +02:00
pinctrl-tps6594.c pinctrl: tps6594: Add driver for TPS6594 pinctrl and GPIOs 2023-11-14 14:45:35 +01:00
pinctrl-utils.c pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinctrl-utils.h pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinctrl-xway.c pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
pinctrl-zynq.c
pinctrl-zynqmp.c
pinmux.c pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinmux.h pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00