]> git.ipfire.org Git - thirdparty/linux.git/commit
gpio: shared: fix a false-positive sharing detection with reset-gpios
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 8 Jan 2026 13:39:19 +0000 (14:39 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Fri, 9 Jan 2026 08:56:46 +0000 (09:56 +0100)
commitd578b31856cec31315f27b3ba97b212e4c6989b3
treed29cc084d841368a081d621843c41de5cf394e5e
parent36f597bba049928004a050c132ab787ba0eba524
gpio: shared: fix a false-positive sharing detection with reset-gpios

After scanning the devicetree, we remove all entries that have only one
reference, while creating GPIO shared proxies for the remaining, shared
entries. However: for the reset-gpio corner-case, we will have two
references for a "reset-gpios" pin that's not really shared. In this
case one will come from the actual consumer fwnode and the other from
the potential auxiliary reset-gpio device. This causes the GPIO core to
create unnecessary GPIO shared proxy devices for pins that are not
really shared.

Add a function that can detect this situation and remove entries that
have exactly two references but one of them is a reset-gpio.

Fixes: 7b78b26757e0 ("gpio: shared: handle the reset-gpios corner case")
Link: https://lore.kernel.org/r/20260108-gpio-shared-false-positive-v1-1-5dbf8d1b2f7d@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpiolib-shared.c