From: Matthew Brost <matthew.brost@intel.com>
To: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH v2 1/2] drm/xe/gt: Synchronize GT reset with device unbind
Date: Fri, 31 Oct 2025 08:39:17 -0700 [thread overview]
Message-ID: <aQTYJbU0qtl1CMYw@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20251030151122.3021436-5-balasubramani.vivekanandan@intel.com>
On Thu, Oct 30, 2025 at 08:41:24PM +0530, Balasubramani Vivekanandan wrote:
> When unbinding wait for any GT reset in progress to complete. Unbinding
> will release the mmio mapping but mmio operations are performed during
> GT reset causing Kernel panic.
>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
> ---
> v2:
> - Use the managed resource release function to wait for GT reset during
> unbind (Lucas)
> ---
> drivers/gpu/drm/xe/xe_gt.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 89808b33d0a8..d0f8c40bc51e 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -607,6 +607,8 @@ static void xe_gt_fini(void *arg)
> struct xe_gt *gt = arg;
> int i;
>
> + disable_work_sync(>->reset.worker);
We recently made a change [1] so if GT reset worker is queued it holds a PM ref.
So if disable_work_sync returns true [2], I think a PM ref needs to be dropped here.
Matt
[1] https://patchwork.freedesktop.org/patch/682622/?series=156292&rev=1
[2] https://elixir.bootlin.com/linux/v6.17.6/source/kernel/workqueue.c#L4471
>
> for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
> xe_hw_fence_irq_finish(>->fence_irq[i]);
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2025-10-31 15:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 15:11 [PATCH v2 0/2] Fix user-after-free during driver unbind Balasubramani Vivekanandan
2025-10-30 15:11 ` [PATCH v2 1/2] drm/xe/gt: Synchronize GT reset with device unbind Balasubramani Vivekanandan
2025-10-30 17:37 ` Summers, Stuart
2025-10-31 14:44 ` Vivekanandan, Balasubramani
2025-10-31 15:39 ` Matthew Brost [this message]
2025-10-31 16:17 ` Lucas De Marchi
2025-10-31 16:32 ` Matthew Brost
2025-10-30 15:11 ` [PATCH v2 2/2] drm/xe/guc: Synchronize Dead CT worker with unbind Balasubramani Vivekanandan
2025-10-30 17:38 ` Summers, Stuart
2025-10-31 14:53 ` Vivekanandan, Balasubramani
2025-10-31 16:10 ` Summers, Stuart
2025-10-30 16:25 ` ✓ CI.KUnit: success for Fix user-after-free during driver unbind (rev2) Patchwork
2025-10-30 17:03 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-30 19:44 ` ✓ Xe.CI.Full: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-10-30 8:26 [PATCH v2 0/2] Fix user-after-free during driver unbind Balasubramani Vivekanandan
2025-10-30 8:26 ` [PATCH v2 1/2] drm/xe/gt: Synchronize GT reset with device unbind Balasubramani Vivekanandan
2025-10-30 21:21 ` Lucas De Marchi
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=aQTYJbU0qtl1CMYw@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=balasubramani.vivekanandan@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox