From: Matthew Brost <matthew.brost@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/2] drm/xe/gt: Synchronize GT reset with device unbind
Date: Fri, 31 Oct 2025 09:32:06 -0700 [thread overview]
Message-ID: <aQTkhpPCuIi5KQPB@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <dfzjptjbgrawrl4evjyubgtqc6uag3sj7ntxkjrxp3f7ssyzsv@a5zdt4oqvhgl>
On Fri, Oct 31, 2025 at 11:17:02AM -0500, Lucas De Marchi wrote:
> On Fri, Oct 31, 2025 at 08:39:17AM -0700, Matthew Brost wrote:
> > 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
>
> yep, it looks like there are 2 v2 of this series. I replied that
> yesterday in the other thread:
>
> https://lore.kernel.org/all/faewe43nslu62dt5donrrddkbzspnwicrsrm3llwp4xg4tdq7l@zxc7u6vd5ceh
>
+1, we have the same comment.
Matt
> Lucas De Marchi
>
> >
> > >
> > > 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 16:32 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
2025-10-31 16:17 ` Lucas De Marchi
2025-10-31 16:32 ` Matthew Brost [this message]
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=aQTkhpPCuIi5KQPB@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