From: Matthew Brost <matthew.brost@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Bart Van Assche" <bvanassche@acm.org>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH] drm/pagemap: Unlock cache->lock before freeing it
Date: Tue, 24 Feb 2026 07:52:15 -0800 [thread overview]
Message-ID: <aZ3JL1u1HVogDPeo@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <8001c470-ca46-4390-be3c-f078b5fce498@linux.intel.com>
On Tue, Feb 24, 2026 at 02:39:17PM +0100, Maarten Lankhorst wrote:
> Hey,
>
> Den 2026-02-23 kl. 23:29, skrev Matthew Brost:
> > From: Bart Van Assche <bvanassche@acm.org>
> >
> > Although freeing a spinlock without unlocking it is fine, this confuses
> > static analyzers. Hence this patch.
> >
> > Fixes: 77f14f2f2d73 ("drm/pagemap: Add a drm_pagemap cache and shrinker")
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> > Cc: Matthew Brost <matthew.brost@intel.com>
> > Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> > Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> > ---
> > drivers/gpu/drm/drm_pagemap_util.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_pagemap_util.c b/drivers/gpu/drm/drm_pagemap_util.c
> > index 14ddb948a32e..50cb5f9cdac5 100644
> > --- a/drivers/gpu/drm/drm_pagemap_util.c
> > +++ b/drivers/gpu/drm/drm_pagemap_util.c
> > @@ -74,6 +74,8 @@ static void drm_pagemap_cache_fini(void *arg)
> > cache->dpagemap = NULL;
> > spin_unlock(&cache->lock);
> > drm_pagemap_destroy(dpagemap, false);
> > + } else {
> > + spin_unlock(&cache->lock);
> > }
> >
> > out:
>
> What about this idea?
>
> https://lore.kernel.org/all/791538fb-56e5-4ca5-9484-1180cc928a70@linux.intel.com/
Yes, that's better - I reposted this yesterday while a bit overloaded to
make sure this didn't get lost. Let's use the a version posted in the
above link.
Matt
prev parent reply other threads:[~2026-02-24 15:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 22:29 [PATCH] drm/pagemap: Unlock cache->lock before freeing it Matthew Brost
2026-02-23 22:36 ` ✓ CI.KUnit: success for " Patchwork
2026-02-24 13:39 ` [PATCH] " Maarten Lankhorst
2026-02-24 15:52 ` Matthew Brost [this message]
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=aZ3JL1u1HVogDPeo@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=bvanassche@acm.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tzimmermann@suse.de \
/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