Re: [PATCH] reset: gpio: Parent the reset-gpio device to the GPIO controller

From: Bartosz Golaszewski

Date: Fri Nov 06 2026 - 05:12:11 EST


On Mon, Oct 26, 2026 at 02:21:55PM +0200, Abel Vesa wrote:
> The reset-gpio auxiliary device is a child of the GPIO device providing
> the reset line. That GPIO device is unregistered when its controller is
> unbound, which removes the sysfs directory of the reset-gpio device with
> it, while the reset-gpio device itself stays registered. When the
> controller is bound again, probing the reset-gpio device fails:
>
> reset_gpio reset.gpio.0: really_probe: driver_sysfs_add failed
>
> and so do the consumers of its reset line. This happens for example with
> the LPASS LPI pin controller, which goes away together with the ADSP.
>
> Make the controller the parent instead, which stays registered while it
> is unbound and gets a new GPIO device when it is bound again. Keep using
> the GPIO device if it has no parent.
>

I believe the commit message is a bit imprecise and mixes up the naming
of actors.

We have the "GPIO parent" - the optional[1] device that's bound to a driver
and calls gpiochip_add_data() - and the "GPIO controller" device which is the
device we register (and optionally bind to the GPIO stub driver) which is the
one exposing the lines.

I'd reword it to:

"The reset-gpio auxiliary device is the child of the GPIO controller device
providing the reset line. That device is unregistered when its parent if
unbound, which removes (...). When the parent is bound again, probing
reset-gpio device fails: (...).

(...)

Make the parent of the GPIO controller, the parent of the reset-gpio
auxiliary device too (...)."

I still need to test it and Tyler's fix with my reset-gpio +
gpio-shared-proxy setup.

Thanks,
Bartosz

[1] Unlikely but there are still legacy platforms which register GPIO
controllers directly from platform code in board files. In case of
reset-gpio it will always be bound to a driver.