From: sashiko-bot@kernel.org
To: "Boris Brezillon" <boris.brezillon@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 01/12] drm/panthor: Disable reset work before unplug
Date: Tue, 04 Aug 2026 10:21:04 +0000 [thread overview]
Message-ID: <20260804102105.8C3DD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260804-panthor-unplug-fixes-v1-1-abbbd2d41b13@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Deadlock (both self-deadlock and AB-BA) between `panthor_device_unplug()` and `panthor_device_reset_work()`.
--
--- Patch [1]: [PATCH 01/12] drm/panthor: Disable reset work before unplug ---
commit 116cfe13ccbee774afdfc7f2e6251c1738450020
Author: Boris Brezillon <boris.brezillon@collabora.com>
drm/panthor: Disable reset work before unplug
This commit disables the reset work during the unplug process to prevent
interruptions.
> diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
> index 0b25abebb803c..e7f5744bc1e31 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);
[Severity: High]
Does this introduce a deadlock when the reset work fails?
Looking at panthor_device_reset_work(), if the reset fails, it calls
panthor_device_unplug(). This would result in panthor_device_unplug() calling
disable_work_sync() on the currently executing work item, causing a
self-deadlock:
panthor_device_reset_work() {
...
if (ret) {
panthor_device_unplug(ptdev);
...
disable_work_sync(&ptdev->reset.work);
Additionally, since panthor_device_unplug() acquires ptdev->unplug.lock
before calling disable_work_sync(), does this create an AB-BA deadlock if
driver removal happens concurrently with a reset failure?
The driver removal thread would acquire ptdev->unplug.lock and wait in
disable_work_sync(), while the reset work would block trying to acquire
ptdev->unplug.lock inside its call to panthor_device_unplug().
> /* We do the rest of the unplug with the unplug lock released,
> * future callers will wait on ptdev->unplug.done anyway.
> */
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260804-panthor-unplug-fixes-v1-0-abbbd2d41b13@collabora.com?part=1
next prev parent reply other threads:[~2026-08-04 10:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 10:09 [PATCH 00/12] drm/panthor: Fix the unplug logic Boris Brezillon
2026-08-04 10:09 ` [PATCH 01/12] drm/panthor: Disable reset work before unplug Boris Brezillon
2026-08-04 10:21 ` sashiko-bot [this message]
2026-08-04 10:46 ` Boris Brezillon
2026-08-04 10:09 ` [PATCH 02/12] drm/panthor: Further delay reset work enablement Boris Brezillon
2026-08-04 10:35 ` sashiko-bot
2026-08-04 10:09 ` [PATCH 03/12] drm/panthor: Move the debugfs initialization to panthor_device.c Boris Brezillon
2026-08-04 12:50 ` Liviu Dudau
2026-08-04 10:09 ` [PATCH 04/12] drm/panthor: Flush the cleanup_wq before destroying the drm_device Boris Brezillon
2026-08-04 10:55 ` sashiko-bot
2026-08-04 10:09 ` [PATCH 05/12] drm/panthor: Drop unused vm argument passed to panthor_vm_prepare_sync_only_op_ctx() Boris Brezillon
2026-08-04 10:09 ` [PATCH 06/12] drm/panthor: Split panthor_vm Boris Brezillon
2026-08-04 10:09 ` [PATCH 07/12] drm/panthor: Add fine-grained restrictions on VMs Boris Brezillon
2026-08-04 13:27 ` sashiko-bot
2026-08-04 10:09 ` [PATCH 08/12] drm/panthor: Check AS state before disabling Boris Brezillon
2026-08-04 10:09 ` [PATCH 09/12] drm/panthor: Don't pre-allocate VMAs or page tables when preparing a full VM unmap Boris Brezillon
2026-08-04 10:09 ` [PATCH 10/12] drm/panthor: Make the VM cleanup path more robust against UAF Boris Brezillon
2026-08-04 15:23 ` sashiko-bot
2026-08-04 10:09 ` [PATCH 11/12] drm/panthor: Make the unplug logic more robust Boris Brezillon
2026-08-04 15:53 ` sashiko-bot
2026-08-04 10:09 ` [PATCH 12/12] drm/panthor: Fix unplug in the reset path Boris Brezillon
2026-08-04 16:01 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804102105.8C3DD1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.