Re: [PATCH] kunit: drm: make DRM buddy test compatible with other pages sizes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 19 Apr 2023 at 01:15, Nico Pache <npache@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>
> ---

Nice catch! This makes sense to me (and doesn't regress anything on my
various 4k-page machines, at least).

Reviewed-by: David Gow <davidgow@xxxxxxxxxx>

Cheers,
-- David


>  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
>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux