Re: [PATCH v4 2/2] reset: gpio: Set can_sleep for the shared reset serialization

From: Alvin Šipraga

Date: Fri Oct 23 2026 - 04:46:53 EST


On Fri, Oct 23, 2026 at 03:16:09PM +0800, shengjiu.wang@xxxxxxxxxxx wrote:
> From: Shengjiu Wang <shengjiu.wang@xxxxxxx>
>
> reset-gpio drives the line with gpiod_set_value_cansleep(), so its reset
> ops may sleep. Set reset_controller_dev::can_sleep so the core serializes
> the shared refcount update and the hardware op under its per-control mutex,
> preventing a concurrent consumer from returning before the op has finished.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@xxxxxxx>

Reviewed-by: Alvin Šipraga <alvin.sipraga@xxxxxxxxxx>

> ---
> drivers/reset/reset-gpio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/reset/reset-gpio.c b/drivers/reset/reset-gpio.c
> index bf95296a512e..b4a198792107 100644
> --- a/drivers/reset/reset-gpio.c
> +++ b/drivers/reset/reset-gpio.c
> @@ -67,6 +67,7 @@ static int reset_gpio_probe(struct auxiliary_device *adev,
> "Could not get reset gpios\n");
>
> priv->rc.ops = &reset_gpio_ops;
> + priv->rc.can_sleep = true;
> priv->rc.owner = THIS_MODULE;
> priv->rc.dev = dev;
>
> --
> 2.34.1
>