linux/drivers/gpio
Asmaa Mnebhi aad4183232 gpio: mlxbf3: Support shutdown() function
During Linux graceful reboot, the GPIO interrupts are not disabled.
Since the drivers are not removed during graceful reboot,
the logic to call mlxbf3_gpio_irq_disable() is not triggered.
Interrupts that remain enabled can cause issues on subsequent boots.

For example, the mlxbf-gige driver contains PHY logic to bring up the link.
If the gpio-mlxbf3 driver loads first, the mlxbf-gige driver
will use a GPIO interrupt to bring up the link.
Otherwise, it will use polling.
The next time Linux boots and loads the drivers in this order, we encounter the issue:
- mlxbf-gige loads first and uses polling while the GPIO10
  interrupt is still enabled from the previous boot. So if
  the interrupt triggers, there is nothing to clear it.
- gpio-mlxbf3 loads.
- i2c-mlxbf loads. The interrupt doesn't trigger for I2C
  because it is shared with the GPIO interrupt line which
  was not cleared.

The solution is to add a shutdown function to the GPIO driver to clear and disable
all interrupts. Also clear the interrupt after disabling it in mlxbf3_gpio_irq_disable().

Fixes: 38a700efc5 ("gpio: mlxbf3: Add gpio driver support")
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Reviewed-by: David Thompson <davthompson@nvidia.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240611171509.22151-1-asmaa@nvidia.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-08-10 21:35:16 +02:00
..
gpio-74x164.c
gpio-74xx-mmio.c
gpio-104-dio-48e.c
gpio-104-idi-48.c
gpio-104-idio-16.c
gpio-adnp.c
gpio-adp5520.c
gpio-aggregator.c
gpio-altera-a10sr.c
gpio-altera.c
gpio-amd-fch.c
gpio-amd8111.c gpio: amd8111: Convert PCIBIOS_* return codes to errnos 2024-05-30 11:20:53 +02:00
gpio-amdpt.c
gpio-arizona.c
gpio-aspeed-sgpio.c
gpio-aspeed.c
gpio-ath79.c gpio: ath79: convert to dynamic GPIO base allocation 2024-06-26 10:39:08 +02:00
gpio-bcm-kona.c
gpio-bd9571mwv.c
gpio-bd71815.c
gpio-bd71828.c
gpio-brcmstb.c of: remove internal arguments from of_property_for_each_u32() 2024-07-25 06:53:47 -05:00
gpio-bt8xx.c
gpio-cadence.c
gpio-clps711x.c
gpio-creg-snps.c
gpio-cros-ec.c
gpio-crystalcove.c
gpio-cs5535.c
gpio-da9052.c
gpio-da9055.c
gpio-davinci.c gpio: davinci: Validate the obtained number of IRQs 2024-06-24 13:24:59 +02:00
gpio-dln2.c
gpio-ds4520.c
gpio-dwapb.c
gpio-eic-sprd.c
gpio-elkhartlake.c
gpio-em.c
gpio-en7523.c
gpio-ep93xx.c
gpio-exar.c
gpio-f7188x.c
gpio-ftgpio010.c
gpio-fxl6408.c
gpio-ge.c
gpio-gpio-mm.c
gpio-graniterapids.c gpio: graniterapids: Add missing raw_spinlock_init() 2024-06-26 10:18:19 +02:00
gpio-grgpio.c
gpio-gw-pld.c gpio: add missing MODULE_DESCRIPTION() macros 2024-06-07 10:05:21 +02:00
gpio-hisi.c
gpio-hlwd.c
gpio-htc-egpio.c
gpio-i8255.c
gpio-i8255.h
gpio-ich.c
gpio-idio-16.c
gpio-idio-16.h
gpio-idt3243x.c
gpio-imx-scu.c
gpio-it87.c
gpio-ixp4xx.c
gpio-janz-ttl.c
gpio-kempld.c
gpio-latch.c
gpio-ljca.c
gpio-logicvc.c
gpio-loongson-64bit.c
gpio-loongson.c
gpio-loongson1.c
gpio-lp873x.c
gpio-lp3943.c
gpio-lp87565.c
gpio-lpc18xx.c
gpio-lpc32xx.c
gpio-madera.c
gpio-max730x.c
gpio-max732x.c
gpio-max3191x.c
gpio-max7300.c
gpio-max7301.c
gpio-max77620.c
gpio-max77650.c
gpio-mb86s7x.c
gpio-mc33880.c gpio updates for v6.11-rc1 2024-07-15 17:53:24 -07:00
gpio-menz127.c
gpio-merrifield.c
gpio-ml-ioh.c
gpio-mlxbf.c
gpio-mlxbf2.c
gpio-mlxbf3.c gpio: mlxbf3: Support shutdown() function 2024-08-10 21:35:16 +02:00
gpio-mm-lantiq.c
gpio-mmio.c gpio: mmio: do not calculate bgpio_bits via "ngpios" 2024-07-03 15:27:59 +02:00
gpio-mockup.c
gpio-moxtet.c
gpio-mpc8xxx.c
gpio-mpc5200.c
gpio-msc313.c
gpio-mt7621.c
gpio-mvebu.c
gpio-mxc.c
gpio-mxs.c
gpio-nomadik.c
gpio-npcm-sgpio.c
gpio-octeon.c
gpio-omap.c
gpio-palmas.c
gpio-pca953x.c gpio updates for v6.11-rc1 2024-07-15 17:53:24 -07:00
gpio-pca9570.c
gpio-pcf857x.c gpio: add missing MODULE_DESCRIPTION() macros 2024-06-07 10:05:21 +02:00
gpio-pch.c
gpio-pci-idio-16.c
gpio-pcie-idio-24.c
gpio-pisosr.c
gpio-pl061.c gpio: add missing MODULE_DESCRIPTION() macros 2024-06-07 10:05:21 +02:00
gpio-pmic-eic-sprd.c
gpio-pxa.c
gpio-raspberrypi-exp.c
gpio-rc5t583.c
gpio-rcar.c
gpio-rda.c
gpio-rdc321x.c gpio: rdc321x: Convert PCIBIOS_* return codes to errnos 2024-05-30 11:21:05 +02:00
gpio-realtek-otto.c
gpio-reg.c
gpio-regmap.c
gpio-rockchip.c
gpio-rtd.c
gpio-sa1100.c
gpio-sama5d2-piobu.c
gpio-sch.c
gpio-sch311x.c
gpio-sifive.c
gpio-sim.c gpio: sim: lock GPIOs as interrupts when they are requested 2024-07-04 09:25:59 +02:00
gpio-siox.c
gpio-sl28cpld.c
gpio-sloppy-logic-analyzer.c gpio: add sloppy logic analyzer using polling 2024-07-01 10:54:11 +02:00
gpio-sodaville.c
gpio-spear-spics.c
gpio-sprd.c
gpio-stmpe.c
gpio-stp-xway.c
gpio-syscon.c gpio: syscon: do not report bogus error 2024-05-29 13:18:12 +02:00
gpio-tangier.c
gpio-tangier.h
gpio-tb10x.c
gpio-tc3589x.c
gpio-tegra.c
gpio-tegra186.c
gpio-thunderx.c
gpio-timberdale.c
gpio-tn48m.c
gpio-tpic2810.c
gpio-tps6586x.c
gpio-tps65086.c
gpio-tps65218.c
gpio-tps65219.c
gpio-tps65910.c
gpio-tps65912.c
gpio-tps68470.c
gpio-tqmx86.c gpio: tqmx86: fix broken IRQ_TYPE_EDGE_BOTH interrupt type 2024-06-03 14:13:13 +02:00
gpio-ts4800.c
gpio-ts4900.c
gpio-ts5500.c
gpio-twl4030.c
gpio-twl6040.c
gpio-uniphier.c
gpio-vf610.c
gpio-viperboard.c
gpio-virtio.c virtio: rename virtio_find_vqs_info() to virtio_find_vqs() 2024-07-17 05:20:58 -04:00
gpio-virtuser.c gpio: virtuser: avoid non-constant format string 2024-07-19 16:56:27 +02:00
gpio-visconti.c
gpio-vx855.c
gpio-wcd934x.c
gpio-wcove.c
gpio-winbond.c
gpio-wm831x.c
gpio-wm8350.c
gpio-wm8994.c
gpio-ws16c48.c
gpio-xgene-sb.c
gpio-xgene.c
gpio-xgs-iproc.c
gpio-xilinx.c
gpio-xlp.c
gpio-xra1403.c
gpio-xtensa.c
gpio-zevio.c
gpio-zynq.c
gpio-zynqmp-modepin.c
gpiolib-acpi.c gpiolib: put gpio_suffixes in a single compilation unit 2024-06-14 09:14:58 +02:00
gpiolib-acpi.h
gpiolib-cdev.c gpio updates for v6.11-rc1 2024-07-15 17:53:24 -07:00
gpiolib-cdev.h
gpiolib-devres.c
gpiolib-legacy.c
gpiolib-of.c gpio updates for v6.11-rc1 2024-07-15 17:53:24 -07:00
gpiolib-of.h
gpiolib-swnode.c
gpiolib-swnode.h
gpiolib-sysfs.c
gpiolib-sysfs.h
gpiolib.c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
gpiolib.h gpiolib: unexport gpiochip_get_desc() 2024-07-02 11:40:37 +02:00
Kconfig gpio updates for v6.11-rc1 2024-07-15 17:53:24 -07:00
Makefile gpio: virtuser: new virtual testing driver for the GPIO API 2024-07-09 09:39:54 +02:00
TODO