From: Boris Brezillon <boris.brezillon@collabora.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dmitry.osipenko@collabora.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, airlied@gmail.com, simona@ffwll.ch,
dri-devel@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/5] drm/tests: shmem: Add clean-up action to unpin pages
Date: Fri, 19 Dec 2025 14:04:40 +0100 [thread overview]
Message-ID: <20251219140440.0b38aa5b@fedora> (raw)
In-Reply-To: <20251212160317.287409-3-tzimmermann@suse.de>
On Fri, 12 Dec 2025 17:00:33 +0100
Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Automatically unpin pages on cleanup. The test currently fails with
> the error
>
> [ 58.246263] drm-kunit-mock-device drm_gem_shmem_test_get_sg_table.drm-kunit-mock-device: [drm] drm_WARN_ON(refcount_read(&shmem->pages_pin_count))
>
> while cleaning up the GEM object. The pin count has to be zero at this
> point.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Fixes: d586b535f144 ("drm/shmem-helper: Add and use pages_pin_count")
> Cc: dri-devel@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v6.16+
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> drivers/gpu/drm/tests/drm_gem_shmem_test.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> index 872881ec9c30..1d50bab51ef3 100644
> --- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> +++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> @@ -34,6 +34,9 @@ KUNIT_DEFINE_ACTION_WRAPPER(sg_free_table_wrapper, sg_free_table,
> KUNIT_DEFINE_ACTION_WRAPPER(drm_gem_shmem_free_wrapper, drm_gem_shmem_free,
> struct drm_gem_shmem_object *);
>
> +KUNIT_DEFINE_ACTION_WRAPPER(drm_gem_shmem_unpin_wrapper, drm_gem_shmem_unpin,
> + struct drm_gem_shmem_object *);
> +
> /*
> * Test creating a shmem GEM object backed by shmem buffer. The test
> * case succeeds if the GEM object is successfully allocated with the
> @@ -212,6 +215,9 @@ static void drm_gem_shmem_test_get_sg_table(struct kunit *test)
> ret = drm_gem_shmem_pin(shmem);
> KUNIT_ASSERT_EQ(test, ret, 0);
>
> + ret = kunit_add_action_or_reset(test, drm_gem_shmem_unpin_wrapper, shmem);
> + KUNIT_ASSERT_EQ(test, ret, 0);
> +
> sgt = drm_gem_shmem_get_sg_table(shmem);
> KUNIT_ASSERT_NOT_ERR_OR_NULL(test, sgt);
> KUNIT_EXPECT_NULL(test, shmem->sgt);
next prev parent reply other threads:[~2025-12-19 13:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251212160317.287409-1-tzimmermann@suse.de>
2025-12-12 16:00 ` [PATCH 1/5] drm/tests: shmem: Swap names of export tests Thomas Zimmermann
2025-12-19 13:03 ` Boris Brezillon
2025-12-12 16:00 ` [PATCH 2/5] drm/tests: shmem: Add clean-up action to unpin pages Thomas Zimmermann
2025-12-19 13:04 ` Boris Brezillon [this message]
2025-12-12 16:00 ` [PATCH 3/5] drm/tests: shmem: Hold reservation lock around vmap/vunmap Thomas Zimmermann
2025-12-19 13:05 ` Boris Brezillon
2025-12-12 16:00 ` [PATCH 4/5] drm/tests: shmem: Hold reservation lock around madvise Thomas Zimmermann
2025-12-19 13:06 ` Boris Brezillon
2025-12-12 16:00 ` [PATCH 5/5] drm/tests: shmem: Hold reservation lock around purge Thomas Zimmermann
2025-12-19 13:06 ` Boris Brezillon
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=20251219140440.0b38aa5b@fedora \
--to=boris.brezillon@collabora.com \
--cc=airlied@gmail.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).