From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
Qiang Yu <yuq825@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Rob Herring <robh@kernel.org>,
Steven Price <steven.price@arm.com>,
Sumit Semwal <sumit.semwal@linaro.org>,
Christian Koenig= <christian.koenig@amd.com>,
Dmitry Osipenko <dmitry.osipenko@collabora.com>,
Zack Rusin <zack.rusin@broadcom.com>,
kernel@collabora.com, dri-devel@lists.freedesktop.org,
lima@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH v3 0/2] drm: Fix dma_resv deadlock at drm object pin time
Date: Tue, 21 May 2024 18:18:17 +0200 [thread overview]
Message-ID: <20240521181817.097af5e1@collabora.com> (raw)
In-Reply-To: <t64xneene7m7x2akecvrmr44yottiicy2mle7e5fimg7vacb4n@n4cjdf7g3nlp>
On Fri, 17 May 2024 19:16:21 +0100
Adrián Larumbe <adrian.larumbe@collabora.com> wrote:
> Hi Boris and Thomas,
>
> On 02.05.2024 14:18, Thomas Zimmermann wrote:
> > Hi
> >
> > Am 02.05.24 um 14:00 schrieb Boris Brezillon:
> > > On Thu, 2 May 2024 13:59:41 +0200
> > > Boris Brezillon <boris.brezillon@collabora.com> wrote:
> > >
> > > > Hi Thomas,
> > > >
> > > > On Thu, 2 May 2024 13:51:16 +0200
> > > > Thomas Zimmermann <tzimmermann@suse.de> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > ignoring my r-b on patch 1, I'd like to rethink the current patches in
> > > > > general.
> > > > >
> > > > > I think drm_gem_shmem_pin() should become the locked version of _pin(),
> > > > > so that drm_gem_shmem_object_pin() can call it directly. The existing
> > > > > _pin_unlocked() would not be needed any longer. Same for the _unpin()
> > > > > functions. This change would also fix the consistency with the semantics
> > > > > of the shmem _vmap() functions, which never take reservation locks.
> > > > >
> > > > > There are only two external callers of drm_gem_shmem_pin(): the test
> > > > > case and panthor. These assume that drm_gem_shmem_pin() acquires the
> > > > > reservation lock. The test case should likely call drm_gem_pin()
> > > > > instead. That would acquire the reservation lock and the test would
> > > > > validate that shmem's pin helper integrates well into the overall GEM
> > > > > framework. The way panthor uses drm_gem_shmem_pin() looks wrong to me.
> > > > > For now, it could receive a wrapper that takes the lock and that's it.
> > > > I do agree that the current inconsistencies in the naming is
> > > > troublesome (sometimes _unlocked, sometimes _locked, with the version
> > > > without any suffix meaning either _locked or _unlocked depending on
> > > > what the suffixed version does), and that's the very reason I asked
> > > > Dmitry to address that in his shrinker series [1]. So, ideally I'd
> > > > prefer if patches from Dmitry's series were applied instead of
> > > > trying to fix that here (IIRC, we had an ack from Maxime).
> > > With the link this time :-).
> > >
> > > [1]https://lore.kernel.org/lkml/20240105184624.508603-1-dmitry.osipenko@collabora.com/T/
> >
> > Thanks. I remember these patches. Somehow I thought they would have been
> > merged already. I wasn't super happy about the naming changes in patch 5,
> > because the names of the GEM object callbacks do no longer correspond with
> > their implementations. But anyway.
> >
> > If we go that direction, we should here simply push drm_gem_shmem_pin() and
> > drm_gem_shmem_unpin() into panthor and update the shmem tests with
> > drm_gem_pin(). Panfrost and lima would call drm_gem_shmem_pin_locked(). IMHO
> > we should not promote the use of drm_gem_shmem_object_*() functions, as they
> > are meant to be callbacks for struct drm_gem_object_funcs. (Auto-generating
> > them would be nice.)
>
> I'll be doing this in the next patch series iteration, casting the pin function's
> drm object parameter to an shmem object.
>
> Also for the sake of leaving things in a consistent state, and against Boris' advice,
> I think I'll leave the drm WARN statement inside drm_gem_shmem_pin_locked.
Sure, that's fine.
prev parent reply other threads:[~2024-05-21 16:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-01 6:55 [PATCH v3 0/2] drm: Fix dma_resv deadlock at drm object pin time Adrián Larumbe
2024-05-01 6:55 ` [PATCH v3 1/2] drm/panfrost: " Adrián Larumbe
2024-05-02 7:09 ` Boris Brezillon
2024-05-02 11:14 ` Thomas Zimmermann
2024-05-01 6:56 ` [PATCH v3 2/2] drm/gem-shmem: Add import attachment warning to locked pin function Adrián Larumbe
2024-05-02 7:01 ` Boris Brezillon
2024-05-02 11:51 ` [PATCH v3 0/2] drm: Fix dma_resv deadlock at drm object pin time Thomas Zimmermann
2024-05-02 11:59 ` Boris Brezillon
2024-05-02 12:00 ` Boris Brezillon
2024-05-02 12:18 ` Thomas Zimmermann
2024-05-17 18:16 ` Adrián Larumbe
2024-05-21 16:18 ` Boris Brezillon [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=20240521181817.097af5e1@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=lima@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robh@kernel.org \
--cc=steven.price@arm.com \
--cc=sumit.semwal@linaro.org \
--cc=tzimmermann@suse.de \
--cc=yuq825@gmail.com \
--cc=zack.rusin@broadcom.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