[PATCH v2 0/4] gpio: shared: replace platform lookup with dummy software nodes
From: Bartosz Golaszewski
Date: Thu Oct 01 2026 - 10:55:20 EST
Abel reported to me a crash on Eliza linked to fwnode GPIO lookup for
shared GPIOs. Turns out we don't support no-device, fwnode-based lookup
for shared GPIOs. In fact: we trigger a NULL-pointer deference.
Making it work requires a more serious rework. This is what patch 4/4
does with 3/4 doing a non-functional renaming for clarity.
The second patch fixes the NULL-pointer dereference in favor of
gracefully returning an error. The first patch fixes another problem the
clanker found during review.
Tested that the issue no longer happens and that fwnode-based sharing of
GPIOs works on Qualcomm Eliza.
Patches 1-2 should go into v7.3 and stable. Patches 3-4 are v7.4
material.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Rework the shared GPIO management to replace platform lookup with
software nodes associated with proxy GPIO controllers
- Link to v1: https://patch.msgid.link/20260929-gpio-shared-fwnode-lookup-v1-0-57d54811de1a@xxxxxxxxxxxxxxxx
---
Bartosz Golaszewski (4):
gpio: shared: fix use-after-free bug when adding shared proxies
gpio: shared: gracefully handle no-device lookup of shared GPIOs
gpio: shared: rename the aux device field in struct gpio_shared_ref
gpio: shared: convert to using software nodes for GPIO shared proxy lookup
drivers/gpio/gpiolib-shared.c | 118 ++++++++++++++++++++----------------------
drivers/gpio/gpiolib-shared.h | 15 +++---
drivers/gpio/gpiolib.c | 20 +------
3 files changed, 64 insertions(+), 89 deletions(-)
---
base-commit: 6c2cb8b8b843d216ab549b678a0d8831c43153e0
change-id: 20260929-gpio-shared-fwnode-lookup-e866faeb5bde
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>