From: Nico Pache <npache@redhat.com>
To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: matthew.auld@intel.com, arunpravin.paneerselvam@amd.com,
arthurgrillo@riseup.net, davidgow@google.com, javierm@redhat.com,
christian.koenig@amd.com, mairacanal@riseup.net, daniel@ffwll.ch,
airlied@gmail.com, ddutile@redhat.com,
kunit-dev@googlegroups.com
Subject: [PATCH] kunit: drm: make DRM buddy test compatible with other pages sizes
Date: Tue, 18 Apr 2023 11:15:24 -0600 [thread overview]
Message-ID: <20230418171524.274386-1-npache@redhat.com> (raw)
The DRM buddy test uses a fixed 12 bit shift to covert from pages to
bytes. This number is then used to confirm that (chunk_size < PAGE_SIZE)
which can lead to a failing drm_buddy_init on systems with PAGE_SIZE > 4k.
Fixes: 92937f170d3f ("drm/selftests: add drm buddy alloc range testcase")
Signed-off-by: Nico Pache <npache@redhat.com>
---
drivers/gpu/drm/tests/drm_buddy_test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
index 09ee6f6af896..a62b2690d3c2 100644
--- a/drivers/gpu/drm/tests/drm_buddy_test.c
+++ b/drivers/gpu/drm/tests/drm_buddy_test.c
@@ -318,8 +318,8 @@ static void mm_config(u64 *size, u64 *chunk_size)
s &= -ms;
/* Convert from pages to bytes */
- *chunk_size = (u64)ms << 12;
- *size = (u64)s << 12;
+ *chunk_size = (u64)ms << PAGE_SHIFT;
+ *size = (u64)s << PAGE_SHIFT;
}
static void drm_test_buddy_alloc_pathological(struct kunit *test)
--
2.39.2
next reply other threads:[~2023-04-18 17:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 17:15 Nico Pache [this message]
2023-04-19 8:27 ` David Gow
2023-04-19 8:30 ` Christian König
2023-06-26 15:27 ` Nico Pache
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=20230418171524.274386-1-npache@redhat.com \
--to=npache@redhat.com \
--cc=airlied@gmail.com \
--cc=arthurgrillo@riseup.net \
--cc=arunpravin.paneerselvam@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=davidgow@google.com \
--cc=ddutile@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mairacanal@riseup.net \
--cc=matthew.auld@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
all inboxes | Powered by JetHome®