android_kernel_xiaomi_sm8350/drivers/gpio
Boerge Struempfel 05918dec9a gpiolib: sysfs: Fix error handling on failed export
[ Upstream commit 95dd1e34ff5bbee93a28ff3947eceaf6de811b1a ]

If gpio_set_transitory() fails, we should free the GPIO again. Most
notably, the flag FLAG_REQUESTED has previously been set in
gpiod_request_commit(), and should be reset on failure.

To my knowledge, this does not affect any current users, since the
gpio_set_transitory() mainly returns 0 and -ENOTSUPP, which is converted
to 0. However the gpio_set_transitory() function calles the .set_config()
function of the corresponding GPIO chip and there are some GPIO drivers in
which some (unlikely) branches return other values like -EPROBE_DEFER,
and -EINVAL. In these cases, the above mentioned FLAG_REQUESTED would not
be reset, which results in the pin being blocked until the next reboot.

Fixes: e10f72bf4b ("gpio: gpiolib: Generalise state persistence beyond sleep")
Signed-off-by: Boerge Struempfel <boerge.struempfel@gmail.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:18:15 +01: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 Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-adp5588.c
gpio-altera-a10sr.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-altera.c
gpio-amd8111.c gpio: amd8111: Fix PCI device reference count leak 2022-12-14 11:30:44 +01:00
gpio-amd-fch.c
gpio-amdpt.c
gpio-arizona.c
gpio-aspeed.c gpio: aspeed: fix the GPIO number passed to pinctrl_gpio_set_config() 2023-10-10 21:46:45 +02:00
gpio-ath79.c Bulk GPIO changes for the v5.3 kernel cycle: 2019-07-09 09:07:00 -07:00
gpio-bcm-kona.c
gpio-bd9571mwv.c
gpio-bd70528.c
gpio-brcmstb.c
gpio-bt8xx.c
gpio-cadence.c
gpio-clps711x.c
gpio-creg-snps.c
gpio-crystalcove.c
gpio-cs5535.c
gpio-da9052.c
gpio-da9055.c
gpio-davinci.c gpio: davinci: Add irq chip flag to skip set wake 2023-04-20 12:07:33 +02:00
gpio-dln2.c
gpio-dwapb.c gpio: dwapb: Append MODULE_ALIAS for platform driver 2020-06-24 17:50:21 +02:00
gpio-eic-sprd.c gpio: eic-sprd: break loop when getting NULL device resource 2020-12-30 11:50:55 +01:00
gpio-em.c
gpio-ep93xx.c
gpio-exar.c
gpio-f7188x.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-ftgpio010.c
gpio-ge.c gpio: ge: Fix build warning 2018-05-16 14:35:24 +02:00
gpio-gpio-mm.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-grgpio.c gpio: gpio-grgpio: fix possible sleep-in-atomic-context bugs in grgpio_irq_map/unmap() 2020-02-24 08:36:26 +01:00
gpio-gw-pld.c gpio: Add a Gateworks PLD GPIO driver 2019-02-09 11:33:37 +01:00
gpio-hlwd.c gpio: hlwd: Pass irqchip when adding gpiochip 2019-08-15 09:57:29 +02:00
gpio-htc-egpio.c
gpio-ich.c
gpio-intel-mid.c gpio: intel-mid: Move hardware initialization to callback 2019-10-15 01:18:51 +02:00
gpio-iop.c
gpio-it87.c
gpio-ixp4xx.c
gpio-janz-ttl.c
gpio-kempld.c
gpio-loongson1.c drivers: gpio: loongon1: use devm_platform_ioremap_resource() 2019-04-05 00:04:26 +07:00
gpio-loongson.c
gpio-lp873x.c
gpio-lp3943.c
gpio-lp87565.c
gpio-lpc18xx.c
gpio-lpc32xx.c
gpio-lynxpoint.c gpio: lynxpoint: Setup correct IRQ handlers 2020-01-04 19:18:20 +01:00
gpio-madera.c gpio: madera: Add support for Cirrus Logic CS47L92 2019-08-05 11:45:24 +02:00
gpio-max730x.c
gpio-max732x.c
gpio-max3191x.c
gpio-max7300.c
gpio-max7301.c
gpio-max77620.c gpio: max77620: Fixup debounce delays 2019-11-12 11:13:54 +01:00
gpio-max77650.c
gpio-mb86s7x.c gpiolib: acpi: Split ACPI stuff to gpiolib-acpi.h 2019-07-31 00:57:21 +02:00
gpio-mc9s08dz60.c
gpio-mc33880.c
gpio-menz127.c
gpio-merrifield.c
gpio-ml-ioh.c
gpio-mlxbf.c
gpio-mm-lantiq.c
gpio-mmio.c
gpio-mockup.c gpio: mockup: Fix mode of debugfs files 2023-05-30 12:44:09 +01:00
gpio-moxtet.c
gpio-mpc8xxx.c gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx 2022-09-28 11:03:57 +02:00
gpio-mpc5200.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-msic.c gpio: msic: Convert to use SPDX identifier 2019-02-08 15:55:41 +02:00
gpio-mt7621.c
gpio-mvebu.c
gpio-mxc.c gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode 2023-02-06 07:52:37 +01:00
gpio-mxs.c
gpio-octeon.c
gpio-omap.c gpio: omap: Save and restore sysconfig 2021-04-28 13:19:14 +02:00
gpio-palmas.c
gpio-pca953x.c gpio: pca953x: Add mutex_lock for regcache sync in PM 2022-09-15 12:04:52 +02:00
gpio-pcf857x.c
gpio-pch.c gpio: pch: Use dev_get_drvdata 2019-07-23 18:59:05 +03:00
gpio-pci-idio-16.c
gpio-pcie-idio-24.c
gpio-pisosr.c
gpio-pl061.c
gpio-pmic-eic-sprd.c gpio: pmic-eic-sprd: Add can_sleep flag for PMIC EIC chip 2023-10-10 21:46:39 +02:00
gpio-pxa.c gpio: pxa: disable pinctrl calls for MMP_GPIO 2023-10-10 21:46:45 +02:00
gpio-raspberrypi-exp.c
gpio-rc5t583.c
gpio-rcar.c gpio: rcar: Fix runtime PM imbalance on error 2020-10-01 13:18:04 +02:00
gpio-rdc321x.c
gpio-reg.c
gpio-sa1100.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-sama5d2-piobu.c
gpio-sch311x.c
gpio-sch.c
gpio-siox.c gpio: siox: explicitly support only threaded irqs 2020-10-07 08:01:23 +02:00
gpio-sodaville.c gpio: sodaville: Convert to use SPDX identifier 2018-12-07 17:34:08 +02:00
gpio-spear-spics.c drivers: gpio: spear-spics: use devm_platform_ioremap_resource() 2019-04-05 00:04:27 +07:00
gpio-sprd.c gpio: sprd: Clear interrupt when setting the type as edge 2020-10-07 08:01:27 +02:00
gpio-sta2x11.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-stmpe.c
gpio-stp-xway.c
gpio-syscon.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
gpio-tb10x.c gpio: tb10x: Fix an error handling path in tb10x_gpio_probe() 2023-10-10 21:46:38 +02:00
gpio-tc3589x.c
gpio-tegra186.c
gpio-tegra.c
gpio-thunderx.c
gpio-timberdale.c gpio: timberdale: Fix potential deadlock on &tgpio->lock 2023-10-25 11:53:23 +02:00
gpio-tpic2810.c gpio: constify gpio_chip structures 2016-09-13 10:35:56 +02:00
gpio-tps6586x.c
gpio-tps65086.c
gpio-tps65218.c
gpio-tps65910.c
gpio-tps65912.c
gpio-tps68470.c gpio: tps68470: Make tps68470_gpio_output() always set the initial value 2023-08-11 11:53:44 +02:00
gpio-tqmx86.c
gpio-ts4800.c
gpio-ts4900.c
gpio-ts5500.c
gpio-twl4030.c
gpio-twl6040.c
gpio-ucb1400.c
gpio-uniphier.c
gpio-vf610.c gpio: vf610: set value before the direction to avoid a glitch 2023-10-25 11:53:24 +02:00
gpio-viperboard.c
gpio-vr41xx.c
gpio-vx855.c
gpio-wcove.c
gpio-winbond.c
gpio-wm831x.c
gpio-wm8350.c gpio: wm8xxx: Cut down on boilerplate 2018-09-17 10:55:24 -07:00
gpio-wm8994.c
gpio-ws16c48.c
gpio-xgene-sb.c
gpio-xgene.c
gpio-xilinx.c
gpio-xlp.c gpio: xlp: Pass irqchip when adding gpiochip 2019-08-15 09:55:07 +02:00
gpio-xra1403.c
gpio-xtensa.c gpio: xtensa: fix driver build 2020-01-09 10:19:59 +01:00
gpio-zevio.c
gpio-zx.c
gpio-zynq.c gpio: zynq: Check return value of pm_runtime_get_sync 2021-07-20 16:10:44 +02:00
gpiolib-acpi.c
gpiolib-acpi.h
gpiolib-devprop.c
gpiolib-devres.c
gpiolib-legacy.c
gpiolib-of.c gpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data() 2022-08-25 11:17:57 +02:00
gpiolib-of.h
gpiolib-sysfs.c gpiolib: sysfs: Fix error handling on failed export 2023-12-13 18:18:15 +01:00
gpiolib.c
gpiolib.h
Kconfig
Makefile
sgpio-aspeed.c
TODO