Re: [PATCH v3 1/3] drm/bridge: ti-sn65dsi83: Propagate error in sn65dsi83_reset_pipe()

[email protected] Mon, 03 Aug 2026 15:04:12 +0000
Newsgroups org.freedesktop.lists.dri-devel
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(=
s) to consider:
- [High] Leaking an SRCU read lock on the error path in `sn65dsi83_reset_wo=
rk()` due to an early return without calling `drm_bridge_exit()`.
--

--- Patch [1]: [PATCH v3 1/3] drm/bridge: ti-sn65dsi83: Propagate error in =
sn65dsi83_reset_pipe() ---
commit d19637cc30dea31a13c6747fe2aa3733116ec5e5
Author: Esben Haabendal <[email protected]>

drm/bridge: ti-sn65dsi83: Propagate error in sn65dsi83_reset_pipe()
   =20
Propagate the error code from drm_bridge_helper_reset_crtc(), so that
callers has a chance to handle the failure.

> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/brid=
ge/ti-sn65dsi83.c
> index 42b451432bbb6..476f255bd34dd 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -403,7 +403,7 @@ static int sn65dsi83_reset_pipe(struct sn65dsi83 *sn6=
5dsi83)
>  	drm_modeset_drop_locks(&ctx);
>  	drm_modeset_acquire_fini(&ctx);
> =20
> -	return 0;
> +	return err;
>  }
> =20
>  static void sn65dsi83_reset_work(struct work_struct *ws)

[Severity: High]
Does propagating the error here cause an SRCU read lock leak?

By propagating the error from sn65dsi83_reset_pipe(), it is now possible
to hit the early return path in sn65dsi83_reset_work():

	if (!drm_bridge_enter(&ctx->bridge, &idx))
		return;

	/* Reset the pipe */
	ret =3D sn65dsi83_reset_pipe(ctx);
	if (ret) {
		dev_err(ctx->dev, "reset pipe failed %pe\n", ERR_PTR(ret));
		return;
	}

Because this early return skips the call to drm_bridge_exit(idx) at the
end of the function, wouldn't this leak the lock and cause a system hang
during drm_bridge_unplug() when synchronize_srcu() is called?

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260803-ti-sn65dsi=
[email protected]?part=3D1