[PATCH 0/3] gpio: improve claim diagnostics and fix gpio-delay offset handling
Pranav Sanwal
pranav.sanwal at amd.com
Thu Jul 9 16:28:58 CEST 2026
This series improves diagnosability of GPIO offset collisions in the
uclass layer and fixes two related bugs in the gpio-delay driver that
were uncovered while debugging such a collision.
Patch 1 adds a dev_warn() in dm_gpio_request() that prints which
label already holds a GPIO offset when a new request collides with
it, so an -EBUSY failure can be root-caused instead of failing
silently.
Patch 2 fixes gpio_delay_probe()/gpio_delay_xlate() to size and
validate against the driver's actual GPIO count (from its "gpios"
property) instead of a hardcoded 32, matching the pattern used by the
generic uclass xlate implementation and correctly sizing the
claimed/name tracking arrays.
Patch 3 fixes gpio_delay_xlate() to propagate the requested index
into desc->offset. Previously every consumer's descriptor came back
with offset 0 regardless of which index was requested, so on boards
where gpio-delay wraps more than one real GPIO line, every consumer
past the first silently collided with the first consumer's
already-claimed offset 0 and was never toggled. This was the root
cause behind the series; patches 1 and 2 are diagnostic and
robustness fixes found along the way.
Patches 2 and 3 are tagged Fixes: c866f2f197e2 ("gpio: Add GPIO
delay driver").
Pranav Sanwal (3):
gpio: uclass: warn when a gpio offset is already claimed
gpio: delay: set gpio_count and validate index against it
gpio: delay: fix offset propagation in gpio_delay_xlate()
drivers/gpio/gpio-delay.c | 8 +++++++-
drivers/gpio/gpio-uclass.c | 6 +++++-
2 files changed, 12 insertions(+), 2 deletions(-)
--
2.34.1
More information about the U-Boot
mailing list