Re: [PATCH 01/12] drm/panthor: Disable reset work before unplug

Boris Brezillon <[email protected]>
Newsgroups gmane.linux.kernel,gmane.comp.video.dri.devel
Organization Collabora
Message-ID <[email protected]>
On Tue, 04 Aug 2026 12:09:40 +0200
Boris Brezillon <[email protected]> wrote:

> Make sure we're not interrupted by resets while we're unplugging.
> 
> Signed-off-by: Boris Brezillon <[email protected]>
> ---
>  drivers/gpu/drm/panthor/panthor_device.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
> index 0b25abebb803..e7f5744bc1e3 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.c
> +++ b/drivers/gpu/drm/panthor/panthor_device.c
> @@ -86,6 +86,9 @@ void panthor_device_unplug(struct panthor_device *ptdev)
>  	 */
>  	drm_dev_unplug(&ptdev->base);
>  
> +	/* Make sure we're not interrupted by resets while we're unplugging. */
> +	disable_work_sync(&ptdev->reset.work);

As Sashiko pointed out, this introduces a deadlock, which I fixed in
patch 12 thinking it was something introduced before this patchset :-(.
I'll address that by pulling the from_reset_work argument into this
commit commits, and making the fake_failure bits its own commit.

> +
>  	/* We do the rest of the unplug with the unplug lock released,
>  	 * future callers will wait on ptdev->unplug.done anyway.
>  	 */
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.