diff mbox series

[1/6] drm/tests/drm_buddy: fix 32b build

Message ID 20240215174431.285069-7-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/6] drm/tests/drm_buddy: fix 32b build | expand

Commit Message

Matthew Auld Feb. 15, 2024, 5:44 p.m. UTC
Doesn't seem to compile on 32b, presumably due to u64 mod/division.
Simplest is to just switch over to u32 here. Also make print modifiers
consistent with that.

Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Maxime Ripard <mripard@redhat.com>
---
 drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Paneer Selvam, Arunpravin Feb. 16, 2024, 11:23 a.m. UTC | #1
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>



On 2/15/2024 11:14 PM, Matthew Auld wrote:
> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
> Simplest is to just switch over to u32 here. Also make print modifiers
> consistent with that.
>
> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test")
> Reported-by: Geert Uytterhoeven<geert@linux-m68k.org>
> Signed-off-by: Matthew Auld<matthew.auld@intel.com>
> Cc: Arunpravin Paneer Selvam<Arunpravin.PaneerSelvam@amd.com>
> Cc: Christian König<christian.koenig@amd.com>
> Cc: Maxime Ripard<mripard@redhat.com>
> ---
>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
> index fee6bec757d1..edacc1adb28f 100644
> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 chunk_size)
>   
>   static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>   {
> -	u64 mm_size, ps = SZ_4K, i, n_pages, total;
> +	u32 mm_size, ps = SZ_4K, i, n_pages, total;
>   	struct drm_buddy_block *block;
>   	struct drm_buddy mm;
>   	LIST_HEAD(left);
> @@ -56,30 +56,30 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>   		KUNIT_ASSERT_FALSE_MSG(test,
>   				       drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							      ps, ps, list, 0),
> -				       "buddy_alloc hit an error size=%d\n",
> +				       "buddy_alloc hit an error size=%u\n",
>   				       ps);
>   	} while (++i < n_pages);
>   
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   3 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%d\n", 3 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 3 * ps);
>   
>   	drm_buddy_free_list(&mm, &middle);
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   3 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%llu\n", 3 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 3 * ps);
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   2 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%llu\n", 2 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 2 * ps);
>   
>   	drm_buddy_free_list(&mm, &right);
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   3 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%llu\n", 3 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 3 * ps);
>   	/*
>   	 * At this point we should have enough contiguous space for 2 blocks,
>   	 * however they are never buddies (since we freed middle and right) so
> @@ -88,13 +88,13 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>   	KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							    2 * ps, ps, &allocated,
>   							    DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc hit an error size=%d\n", 2 * ps);
> +			       "buddy_alloc hit an error size=%u\n", 2 * ps);
>   
>   	drm_buddy_free_list(&mm, &left);
>   	KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							    3 * ps, ps, &allocated,
>   							    DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc hit an error size=%d\n", 3 * ps);
> +			       "buddy_alloc hit an error size=%u\n", 3 * ps);
>   
>   	total = 0;
>   	list_for_each_entry(block, &allocated, link)
Matthew Auld Feb. 19, 2024, 9:42 a.m. UTC | #2
On 15/02/2024 17:44, Matthew Auld wrote:
> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
> Simplest is to just switch over to u32 here. Also make print modifiers
> consistent with that.
> 
> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test")
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Maxime Ripard <mripard@redhat.com>

Any chance someone can push just this single patch here, since it fixes 
32b build? It already has an r-b from Arun.

> ---
>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
> index fee6bec757d1..edacc1adb28f 100644
> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 chunk_size)
>   
>   static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>   {
> -	u64 mm_size, ps = SZ_4K, i, n_pages, total;
> +	u32 mm_size, ps = SZ_4K, i, n_pages, total;
>   	struct drm_buddy_block *block;
>   	struct drm_buddy mm;
>   	LIST_HEAD(left);
> @@ -56,30 +56,30 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>   		KUNIT_ASSERT_FALSE_MSG(test,
>   				       drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							      ps, ps, list, 0),
> -				       "buddy_alloc hit an error size=%d\n",
> +				       "buddy_alloc hit an error size=%u\n",
>   				       ps);
>   	} while (++i < n_pages);
>   
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   3 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%d\n", 3 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 3 * ps);
>   
>   	drm_buddy_free_list(&mm, &middle);
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   3 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%llu\n", 3 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 3 * ps);
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   2 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%llu\n", 2 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 2 * ps);
>   
>   	drm_buddy_free_list(&mm, &right);
>   	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							   3 * ps, ps, &allocated,
>   							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc didn't error size=%llu\n", 3 * ps);
> +			       "buddy_alloc didn't error size=%u\n", 3 * ps);
>   	/*
>   	 * At this point we should have enough contiguous space for 2 blocks,
>   	 * however they are never buddies (since we freed middle and right) so
> @@ -88,13 +88,13 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>   	KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							    2 * ps, ps, &allocated,
>   							    DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc hit an error size=%d\n", 2 * ps);
> +			       "buddy_alloc hit an error size=%u\n", 2 * ps);
>   
>   	drm_buddy_free_list(&mm, &left);
>   	KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
>   							    3 * ps, ps, &allocated,
>   							    DRM_BUDDY_CONTIGUOUS_ALLOCATION),
> -			       "buddy_alloc hit an error size=%d\n", 3 * ps);
> +			       "buddy_alloc hit an error size=%u\n", 3 * ps);
>   
>   	total = 0;
>   	list_for_each_entry(block, &allocated, link)
Christian König Feb. 19, 2024, 9:53 a.m. UTC | #3
Am 19.02.24 um 10:42 schrieb Matthew Auld:
> On 15/02/2024 17:44, Matthew Auld wrote:
>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
>> Simplest is to just switch over to u32 here. Also make print modifiers
>> consistent with that.
>>
>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test")
>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>> Cc: Christian König <christian.koenig@amd.com>
>> Cc: Maxime Ripard <mripard@redhat.com>
>
> Any chance someone can push just this single patch here, since it 
> fixes 32b build? It already has an r-b from Arun.

Already working on this. Just give me a few more minutes.

Thanks,
Christian.

>
>> ---
>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>> index fee6bec757d1..edacc1adb28f 100644
>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 chunk_size)
>>     static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>>   {
>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>       struct drm_buddy_block *block;
>>       struct drm_buddy mm;
>>       LIST_HEAD(left);
>> @@ -56,30 +56,30 @@ static void 
>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>           KUNIT_ASSERT_FALSE_MSG(test,
>>                          drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>                                     ps, ps, list, 0),
>> -                       "buddy_alloc hit an error size=%d\n",
>> +                       "buddy_alloc hit an error size=%u\n",
>>                          ps);
>>       } while (++i < n_pages);
>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>> mm_size,
>>                                  3 * ps, ps, &allocated,
>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>         drm_buddy_free_list(&mm, &middle);
>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>> mm_size,
>>                                  3 * ps, ps, &allocated,
>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>> mm_size,
>>                                  2 * ps, ps, &allocated,
>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>> -                   "buddy_alloc didn't error size=%llu\n", 2 * ps);
>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>         drm_buddy_free_list(&mm, &right);
>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>> mm_size,
>>                                  3 * ps, ps, &allocated,
>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>       /*
>>        * At this point we should have enough contiguous space for 2 
>> blocks,
>>        * however they are never buddies (since we freed middle and 
>> right) so
>> @@ -88,13 +88,13 @@ static void 
>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>> mm_size,
>>                                   2 * ps, ps, &allocated,
>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>         drm_buddy_free_list(&mm, &left);
>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>> mm_size,
>>                                   3 * ps, ps, &allocated,
>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>         total = 0;
>>       list_for_each_entry(block, &allocated, link)
Matthew Auld Feb. 19, 2024, 10:28 a.m. UTC | #4
On 19/02/2024 09:53, Christian König wrote:
> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>> On 15/02/2024 17:44, Matthew Auld wrote:
>>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
>>> Simplest is to just switch over to u32 here. Also make print modifiers
>>> consistent with that.
>>>
>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test")
>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>> Cc: Christian König <christian.koenig@amd.com>
>>> Cc: Maxime Ripard <mripard@redhat.com>
>>
>> Any chance someone can push just this single patch here, since it 
>> fixes 32b build? It already has an r-b from Arun.
> 
> Already working on this. Just give me a few more minutes.

Thanks.

> 
> Thanks,
> Christian.
> 
>>
>>> ---
>>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>>> index fee6bec757d1..edacc1adb28f 100644
>>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 chunk_size)
>>>     static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>   {
>>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>>       struct drm_buddy_block *block;
>>>       struct drm_buddy mm;
>>>       LIST_HEAD(left);
>>> @@ -56,30 +56,30 @@ static void 
>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>           KUNIT_ASSERT_FALSE_MSG(test,
>>>                          drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>>                                     ps, ps, list, 0),
>>> -                       "buddy_alloc hit an error size=%d\n",
>>> +                       "buddy_alloc hit an error size=%u\n",
>>>                          ps);
>>>       } while (++i < n_pages);
>>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>> mm_size,
>>>                                  3 * ps, ps, &allocated,
>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>         drm_buddy_free_list(&mm, &middle);
>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>> mm_size,
>>>                                  3 * ps, ps, &allocated,
>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>> mm_size,
>>>                                  2 * ps, ps, &allocated,
>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>> -                   "buddy_alloc didn't error size=%llu\n", 2 * ps);
>>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>>         drm_buddy_free_list(&mm, &right);
>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>> mm_size,
>>>                                  3 * ps, ps, &allocated,
>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>       /*
>>>        * At this point we should have enough contiguous space for 2 
>>> blocks,
>>>        * however they are never buddies (since we freed middle and 
>>> right) so
>>> @@ -88,13 +88,13 @@ static void 
>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>> mm_size,
>>>                                   2 * ps, ps, &allocated,
>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>>         drm_buddy_free_list(&mm, &left);
>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>> mm_size,
>>>                                   3 * ps, ps, &allocated,
>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>>         total = 0;
>>>       list_for_each_entry(block, &allocated, link)
>
Christian König Feb. 19, 2024, 10:30 a.m. UTC | #5
Am 19.02.24 um 11:28 schrieb Matthew Auld:
> On 19/02/2024 09:53, Christian König wrote:
>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>>> On 15/02/2024 17:44, Matthew Auld wrote:
>>>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
>>>> Simplest is to just switch over to u32 here. Also make print modifiers
>>>> consistent with that.
>>>>
>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test")
>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>> Cc: Christian König <christian.koenig@amd.com>
>>>> Cc: Maxime Ripard <mripard@redhat.com>
>>>
>>> Any chance someone can push just this single patch here, since it 
>>> fixes 32b build? It already has an r-b from Arun.
>>
>> Already working on this. Just give me a few more minutes.
>
> Thanks.

No, problem. I would have pushed this earlier, but my build server 
doesn't want to work any more. Looks like the SSD has passed its warranty :(

Should I push the other three patches to drm-misc-fixes as well? I 
currently can't even build test them.

Thanks,
Christian.

>
>>
>> Thanks,
>> Christian.
>>
>>>
>>>> ---
>>>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>>>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>> index fee6bec757d1..edacc1adb28f 100644
>>>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>>>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 
>>>> chunk_size)
>>>>     static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>   {
>>>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>>>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>       struct drm_buddy_block *block;
>>>>       struct drm_buddy mm;
>>>>       LIST_HEAD(left);
>>>> @@ -56,30 +56,30 @@ static void 
>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>           KUNIT_ASSERT_FALSE_MSG(test,
>>>>                          drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>>>                                     ps, ps, list, 0),
>>>> -                       "buddy_alloc hit an error size=%d\n",
>>>> +                       "buddy_alloc hit an error size=%u\n",
>>>>                          ps);
>>>>       } while (++i < n_pages);
>>>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>> mm_size,
>>>>                                  3 * ps, ps, &allocated,
>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>         drm_buddy_free_list(&mm, &middle);
>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>> mm_size,
>>>>                                  3 * ps, ps, &allocated,
>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>> mm_size,
>>>>                                  2 * ps, ps, &allocated,
>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>> -                   "buddy_alloc didn't error size=%llu\n", 2 * ps);
>>>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>>>         drm_buddy_free_list(&mm, &right);
>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>> mm_size,
>>>>                                  3 * ps, ps, &allocated,
>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>       /*
>>>>        * At this point we should have enough contiguous space for 2 
>>>> blocks,
>>>>        * however they are never buddies (since we freed middle and 
>>>> right) so
>>>> @@ -88,13 +88,13 @@ static void 
>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>> mm_size,
>>>>                                   2 * ps, ps, &allocated,
>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>>>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>>>         drm_buddy_free_list(&mm, &left);
>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>> mm_size,
>>>>                                   3 * ps, ps, &allocated,
>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>>>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>>>         total = 0;
>>>>       list_for_each_entry(block, &allocated, link)
>>
Matthew Auld Feb. 19, 2024, 10:48 a.m. UTC | #6
On 19/02/2024 10:30, Christian König wrote:
> Am 19.02.24 um 11:28 schrieb Matthew Auld:
>> On 19/02/2024 09:53, Christian König wrote:
>>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>>>> On 15/02/2024 17:44, Matthew Auld wrote:
>>>>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
>>>>> Simplest is to just switch over to u32 here. Also make print modifiers
>>>>> consistent with that.
>>>>>
>>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test")
>>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>> Cc: Maxime Ripard <mripard@redhat.com>
>>>>
>>>> Any chance someone can push just this single patch here, since it 
>>>> fixes 32b build? It already has an r-b from Arun.
>>>
>>> Already working on this. Just give me a few more minutes.
>>
>> Thanks.
> 
> No, problem. I would have pushed this earlier, but my build server 
> doesn't want to work any more. Looks like the SSD has passed its 
> warranty :(
> 
> Should I push the other three patches to drm-misc-fixes as well? I 
> currently can't even build test them.

Need to send a v2 for that. One minor change in the test just to be 
consistent with using u32. Thanks.

> 
> Thanks,
> Christian.
> 
>>
>>>
>>> Thanks,
>>> Christian.
>>>
>>>>
>>>>> ---
>>>>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>>>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>>>>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>> index fee6bec757d1..edacc1adb28f 100644
>>>>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 
>>>>> chunk_size)
>>>>>     static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>   {
>>>>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>       struct drm_buddy_block *block;
>>>>>       struct drm_buddy mm;
>>>>>       LIST_HEAD(left);
>>>>> @@ -56,30 +56,30 @@ static void 
>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>           KUNIT_ASSERT_FALSE_MSG(test,
>>>>>                          drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>>>>                                     ps, ps, list, 0),
>>>>> -                       "buddy_alloc hit an error size=%d\n",
>>>>> +                       "buddy_alloc hit an error size=%u\n",
>>>>>                          ps);
>>>>>       } while (++i < n_pages);
>>>>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>> mm_size,
>>>>>                                  3 * ps, ps, &allocated,
>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>         drm_buddy_free_list(&mm, &middle);
>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>> mm_size,
>>>>>                                  3 * ps, ps, &allocated,
>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>> mm_size,
>>>>>                                  2 * ps, ps, &allocated,
>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>> -                   "buddy_alloc didn't error size=%llu\n", 2 * ps);
>>>>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>>>>         drm_buddy_free_list(&mm, &right);
>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>> mm_size,
>>>>>                                  3 * ps, ps, &allocated,
>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>       /*
>>>>>        * At this point we should have enough contiguous space for 2 
>>>>> blocks,
>>>>>        * however they are never buddies (since we freed middle and 
>>>>> right) so
>>>>> @@ -88,13 +88,13 @@ static void 
>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>> mm_size,
>>>>>                                   2 * ps, ps, &allocated,
>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>>>>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>>>>         drm_buddy_free_list(&mm, &left);
>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>> mm_size,
>>>>>                                   3 * ps, ps, &allocated,
>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>>>>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>>>>         total = 0;
>>>>>       list_for_each_entry(block, &allocated, link)
>>>
>
Matthew Auld Feb. 19, 2024, 12:24 p.m. UTC | #7
On 19/02/2024 10:48, Matthew Auld wrote:
> On 19/02/2024 10:30, Christian König wrote:
>> Am 19.02.24 um 11:28 schrieb Matthew Auld:
>>> On 19/02/2024 09:53, Christian König wrote:
>>>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>>>>> On 15/02/2024 17:44, Matthew Auld wrote:
>>>>>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
>>>>>> Simplest is to just switch over to u32 here. Also make print 
>>>>>> modifiers
>>>>>> consistent with that.
>>>>>>
>>>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous 
>>>>>> test")
>>>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>>> Cc: Maxime Ripard <mripard@redhat.com>
>>>>>
>>>>> Any chance someone can push just this single patch here, since it 
>>>>> fixes 32b build? It already has an r-b from Arun.
>>>>
>>>> Already working on this. Just give me a few more minutes.
>>>
>>> Thanks.
>>
>> No, problem. I would have pushed this earlier, but my build server 
>> doesn't want to work any more. Looks like the SSD has passed its 
>> warranty :(
>>
>> Should I push the other three patches to drm-misc-fixes as well? I 
>> currently can't even build test them.
> 
> Need to send a v2 for that. One minor change in the test just to be 
> consistent with using u32. Thanks.

Sent v2. If you could push that when you get a chance. Thanks.

https://patchwork.freedesktop.org/series/130075/

> 
>>
>> Thanks,
>> Christian.
>>
>>>
>>>>
>>>> Thanks,
>>>> Christian.
>>>>
>>>>>
>>>>>> ---
>>>>>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>>>>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>>>>>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>> index fee6bec757d1..edacc1adb28f 100644
>>>>>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 
>>>>>> chunk_size)
>>>>>>     static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>   {
>>>>>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>>       struct drm_buddy_block *block;
>>>>>>       struct drm_buddy mm;
>>>>>>       LIST_HEAD(left);
>>>>>> @@ -56,30 +56,30 @@ static void 
>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>           KUNIT_ASSERT_FALSE_MSG(test,
>>>>>>                          drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>>>>>                                     ps, ps, list, 0),
>>>>>> -                       "buddy_alloc hit an error size=%d\n",
>>>>>> +                       "buddy_alloc hit an error size=%u\n",
>>>>>>                          ps);
>>>>>>       } while (++i < n_pages);
>>>>>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>> mm_size,
>>>>>>                                  3 * ps, ps, &allocated,
>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>         drm_buddy_free_list(&mm, &middle);
>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>> mm_size,
>>>>>>                                  3 * ps, ps, &allocated,
>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>> mm_size,
>>>>>>                                  2 * ps, ps, &allocated,
>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 2 * ps);
>>>>>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>>>>>         drm_buddy_free_list(&mm, &right);
>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>> mm_size,
>>>>>>                                  3 * ps, ps, &allocated,
>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>       /*
>>>>>>        * At this point we should have enough contiguous space for 
>>>>>> 2 blocks,
>>>>>>        * however they are never buddies (since we freed middle and 
>>>>>> right) so
>>>>>> @@ -88,13 +88,13 @@ static void 
>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>> mm_size,
>>>>>>                                   2 * ps, ps, &allocated,
>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>>>>>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>>>>>         drm_buddy_free_list(&mm, &left);
>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>> mm_size,
>>>>>>                                   3 * ps, ps, &allocated,
>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>>>>>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>>>>>         total = 0;
>>>>>>       list_for_each_entry(block, &allocated, link)
>>>>
>>
Matthew Auld Feb. 26, 2024, 9:58 a.m. UTC | #8
On 19/02/2024 12:24, Matthew Auld wrote:
> On 19/02/2024 10:48, Matthew Auld wrote:
>> On 19/02/2024 10:30, Christian König wrote:
>>> Am 19.02.24 um 11:28 schrieb Matthew Auld:
>>>> On 19/02/2024 09:53, Christian König wrote:
>>>>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>>>>>> On 15/02/2024 17:44, Matthew Auld wrote:
>>>>>>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
>>>>>>> Simplest is to just switch over to u32 here. Also make print 
>>>>>>> modifiers
>>>>>>> consistent with that.
>>>>>>>
>>>>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous 
>>>>>>> test")
>>>>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>>>> Cc: Maxime Ripard <mripard@redhat.com>
>>>>>>
>>>>>> Any chance someone can push just this single patch here, since it 
>>>>>> fixes 32b build? It already has an r-b from Arun.
>>>>>
>>>>> Already working on this. Just give me a few more minutes.
>>>>
>>>> Thanks.
>>>
>>> No, problem. I would have pushed this earlier, but my build server 
>>> doesn't want to work any more. Looks like the SSD has passed its 
>>> warranty :(
>>>
>>> Should I push the other three patches to drm-misc-fixes as well? I 
>>> currently can't even build test them.
>>
>> Need to send a v2 for that. One minor change in the test just to be 
>> consistent with using u32. Thanks.
> 
> Sent v2. If you could push that when you get a chance. Thanks.
> 
> https://patchwork.freedesktop.org/series/130075/

Gentle ping on merging v2.

> 
>>
>>>
>>> Thanks,
>>> Christian.
>>>
>>>>
>>>>>
>>>>> Thanks,
>>>>> Christian.
>>>>>
>>>>>>
>>>>>>> ---
>>>>>>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>>>>>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>>>>>>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>> index fee6bec757d1..edacc1adb28f 100644
>>>>>>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 
>>>>>>> chunk_size)
>>>>>>>     static void drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>>   {
>>>>>>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>>>       struct drm_buddy_block *block;
>>>>>>>       struct drm_buddy mm;
>>>>>>>       LIST_HEAD(left);
>>>>>>> @@ -56,30 +56,30 @@ static void 
>>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>>           KUNIT_ASSERT_FALSE_MSG(test,
>>>>>>>                          drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>>>>>>                                     ps, ps, list, 0),
>>>>>>> -                       "buddy_alloc hit an error size=%d\n",
>>>>>>> +                       "buddy_alloc hit an error size=%u\n",
>>>>>>>                          ps);
>>>>>>>       } while (++i < n_pages);
>>>>>>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>> 0, mm_size,
>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>         drm_buddy_free_list(&mm, &middle);
>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>>> mm_size,
>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>>> mm_size,
>>>>>>>                                  2 * ps, ps, &allocated,
>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 2 * ps);
>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>>>>>>         drm_buddy_free_list(&mm, &right);
>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>>> mm_size,
>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * ps);
>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>       /*
>>>>>>>        * At this point we should have enough contiguous space for 
>>>>>>> 2 blocks,
>>>>>>>        * however they are never buddies (since we freed middle 
>>>>>>> and right) so
>>>>>>> @@ -88,13 +88,13 @@ static void 
>>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>>> mm_size,
>>>>>>>                                   2 * ps, ps, &allocated,
>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>>>>>>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>>>>>>         drm_buddy_free_list(&mm, &left);
>>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, 
>>>>>>> mm_size,
>>>>>>>                                   3 * ps, ps, &allocated,
>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>>>>>>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>>>>>>         total = 0;
>>>>>>>       list_for_each_entry(block, &allocated, link)
>>>>>
>>>
Geert Uytterhoeven Feb. 26, 2024, 10:38 a.m. UTC | #9
Hi Matthew,

On Mon, Feb 26, 2024 at 10:58 AM Matthew Auld <matthew.auld@intel.com> wrote:
> On 19/02/2024 12:24, Matthew Auld wrote:
> > On 19/02/2024 10:48, Matthew Auld wrote:
> >> On 19/02/2024 10:30, Christian König wrote:
> >>> Am 19.02.24 um 11:28 schrieb Matthew Auld:
> >>>> On 19/02/2024 09:53, Christian König wrote:
> >>>>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
> >>>>>> On 15/02/2024 17:44, Matthew Auld wrote:
> >>>>>>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
> >>>>>>> Simplest is to just switch over to u32 here. Also make print
> >>>>>>> modifiers
> >>>>>>> consistent with that.
> >>>>>>>
> >>>>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous
> >>>>>>> test")
> >>>>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >>>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> >>>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> >>>>>>> Cc: Christian König <christian.koenig@amd.com>
> >>>>>>> Cc: Maxime Ripard <mripard@redhat.com>
> >>>>>>
> >>>>>> Any chance someone can push just this single patch here, since it
> >>>>>> fixes 32b build? It already has an r-b from Arun.
> >>>>>
> >>>>> Already working on this. Just give me a few more minutes.
> >>>>
> >>>> Thanks.
> >>>
> >>> No, problem. I would have pushed this earlier, but my build server
> >>> doesn't want to work any more. Looks like the SSD has passed its
> >>> warranty :(
> >>>
> >>> Should I push the other three patches to drm-misc-fixes as well? I
> >>> currently can't even build test them.
> >>
> >> Need to send a v2 for that. One minor change in the test just to be
> >> consistent with using u32. Thanks.
> >
> > Sent v2. If you could push that when you get a chance. Thanks.
> >
> > https://patchwork.freedesktop.org/series/130075/
>
> Gentle ping on merging v2.

Your v1 and a fix from Linus already made it upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/drivers/gpu/drm/tests?h=v6.8-rc6

Gr{oetje,eeting}s,

                        Geert
Matthew Auld Feb. 26, 2024, 11:21 a.m. UTC | #10
Hi,

On 26/02/2024 10:38, Geert Uytterhoeven wrote:
> Hi Matthew,
> 
> On Mon, Feb 26, 2024 at 10:58 AM Matthew Auld <matthew.auld@intel.com> wrote:
>> On 19/02/2024 12:24, Matthew Auld wrote:
>>> On 19/02/2024 10:48, Matthew Auld wrote:
>>>> On 19/02/2024 10:30, Christian König wrote:
>>>>> Am 19.02.24 um 11:28 schrieb Matthew Auld:
>>>>>> On 19/02/2024 09:53, Christian König wrote:
>>>>>>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>>>>>>>> On 15/02/2024 17:44, Matthew Auld wrote:
>>>>>>>>> Doesn't seem to compile on 32b, presumably due to u64 mod/division.
>>>>>>>>> Simplest is to just switch over to u32 here. Also make print
>>>>>>>>> modifiers
>>>>>>>>> consistent with that.
>>>>>>>>>
>>>>>>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous
>>>>>>>>> test")
>>>>>>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>>>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>>>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>>>>>> Cc: Maxime Ripard <mripard@redhat.com>
>>>>>>>>
>>>>>>>> Any chance someone can push just this single patch here, since it
>>>>>>>> fixes 32b build? It already has an r-b from Arun.
>>>>>>>
>>>>>>> Already working on this. Just give me a few more minutes.
>>>>>>
>>>>>> Thanks.
>>>>>
>>>>> No, problem. I would have pushed this earlier, but my build server
>>>>> doesn't want to work any more. Looks like the SSD has passed its
>>>>> warranty :(
>>>>>
>>>>> Should I push the other three patches to drm-misc-fixes as well? I
>>>>> currently can't even build test them.
>>>>
>>>> Need to send a v2 for that. One minor change in the test just to be
>>>> consistent with using u32. Thanks.
>>>
>>> Sent v2. If you could push that when you get a chance. Thanks.
>>>
>>> https://patchwork.freedesktop.org/series/130075/
>>
>> Gentle ping on merging v2.
> 
> Your v1 and a fix from Linus already made it upstream:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/drivers/gpu/drm/tests?h=v6.8-rc6

Ah, right. I meant v2 for the remaining drm_buddy patches in this series:
https://patchwork.freedesktop.org/series/130075/

> 
> Gr{oetje,eeting}s,
> 
>                          Geert
>
Christian König Feb. 28, 2024, 7:20 a.m. UTC | #11
Am 26.02.24 um 10:58 schrieb Matthew Auld:
> On 19/02/2024 12:24, Matthew Auld wrote:
>> On 19/02/2024 10:48, Matthew Auld wrote:
>>> On 19/02/2024 10:30, Christian König wrote:
>>>> Am 19.02.24 um 11:28 schrieb Matthew Auld:
>>>>> On 19/02/2024 09:53, Christian König wrote:
>>>>>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>>>>>>> On 15/02/2024 17:44, Matthew Auld wrote:
>>>>>>>> Doesn't seem to compile on 32b, presumably due to u64 
>>>>>>>> mod/division.
>>>>>>>> Simplest is to just switch over to u32 here. Also make print 
>>>>>>>> modifiers
>>>>>>>> consistent with that.
>>>>>>>>
>>>>>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous 
>>>>>>>> test")
>>>>>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>>>>> Cc: Maxime Ripard <mripard@redhat.com>
>>>>>>>
>>>>>>> Any chance someone can push just this single patch here, since 
>>>>>>> it fixes 32b build? It already has an r-b from Arun.
>>>>>>
>>>>>> Already working on this. Just give me a few more minutes.
>>>>>
>>>>> Thanks.
>>>>
>>>> No, problem. I would have pushed this earlier, but my build server 
>>>> doesn't want to work any more. Looks like the SSD has passed its 
>>>> warranty :(
>>>>
>>>> Should I push the other three patches to drm-misc-fixes as well? I 
>>>> currently can't even build test them.
>>>
>>> Need to send a v2 for that. One minor change in the test just to be 
>>> consistent with using u32. Thanks.
>>
>> Sent v2. If you could push that when you get a chance. Thanks.
>>
>> https://patchwork.freedesktop.org/series/130075/
>
> Gentle ping on merging v2.

Pushed all three to drm-misc-fixes.

Regards,
Christian.

>
>>
>>>
>>>>
>>>> Thanks,
>>>> Christian.
>>>>
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Christian.
>>>>>>
>>>>>>>
>>>>>>>> ---
>>>>>>>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>>>>>>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>>>>>>>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>>> index fee6bec757d1..edacc1adb28f 100644
>>>>>>>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 
>>>>>>>> chunk_size)
>>>>>>>>     static void drm_test_buddy_alloc_contiguous(struct kunit 
>>>>>>>> *test)
>>>>>>>>   {
>>>>>>>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>>>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>>>>       struct drm_buddy_block *block;
>>>>>>>>       struct drm_buddy mm;
>>>>>>>>       LIST_HEAD(left);
>>>>>>>> @@ -56,30 +56,30 @@ static void 
>>>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>>>           KUNIT_ASSERT_FALSE_MSG(test,
>>>>>>>> drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>>>>>>>                                     ps, ps, list, 0),
>>>>>>>> -                       "buddy_alloc hit an error size=%d\n",
>>>>>>>> +                       "buddy_alloc hit an error size=%u\n",
>>>>>>>>                          ps);
>>>>>>>>       } while (++i < n_pages);
>>>>>>>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>> 0, mm_size,
>>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>>         drm_buddy_free_list(&mm, &middle);
>>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>> 0, mm_size,
>>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * 
>>>>>>>> ps);
>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>> 0, mm_size,
>>>>>>>>                                  2 * ps, ps, &allocated,
>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 2 * 
>>>>>>>> ps);
>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>>>>>>>         drm_buddy_free_list(&mm, &right);
>>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>> 0, mm_size,
>>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * 
>>>>>>>> ps);
>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>>       /*
>>>>>>>>        * At this point we should have enough contiguous space 
>>>>>>>> for 2 blocks,
>>>>>>>>        * however they are never buddies (since we freed middle 
>>>>>>>> and right) so
>>>>>>>> @@ -88,13 +88,13 @@ static void 
>>>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>> 0, mm_size,
>>>>>>>>                                   2 * ps, ps, &allocated,
>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>>>>>>>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>>>>>>>         drm_buddy_free_list(&mm, &left);
>>>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>> 0, mm_size,
>>>>>>>>                                   3 * ps, ps, &allocated,
>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>>>>>>>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>>>>>>>         total = 0;
>>>>>>>>       list_for_each_entry(block, &allocated, link)
>>>>>>
>>>>
Matthew Auld Feb. 28, 2024, 9:20 a.m. UTC | #12
On 28/02/2024 07:20, Christian König wrote:
> Am 26.02.24 um 10:58 schrieb Matthew Auld:
>> On 19/02/2024 12:24, Matthew Auld wrote:
>>> On 19/02/2024 10:48, Matthew Auld wrote:
>>>> On 19/02/2024 10:30, Christian König wrote:
>>>>> Am 19.02.24 um 11:28 schrieb Matthew Auld:
>>>>>> On 19/02/2024 09:53, Christian König wrote:
>>>>>>> Am 19.02.24 um 10:42 schrieb Matthew Auld:
>>>>>>>> On 15/02/2024 17:44, Matthew Auld wrote:
>>>>>>>>> Doesn't seem to compile on 32b, presumably due to u64 
>>>>>>>>> mod/division.
>>>>>>>>> Simplest is to just switch over to u32 here. Also make print 
>>>>>>>>> modifiers
>>>>>>>>> consistent with that.
>>>>>>>>>
>>>>>>>>> Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous 
>>>>>>>>> test")
>>>>>>>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>>>>>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>>>>>>>>> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
>>>>>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>>>>>> Cc: Maxime Ripard <mripard@redhat.com>
>>>>>>>>
>>>>>>>> Any chance someone can push just this single patch here, since 
>>>>>>>> it fixes 32b build? It already has an r-b from Arun.
>>>>>>>
>>>>>>> Already working on this. Just give me a few more minutes.
>>>>>>
>>>>>> Thanks.
>>>>>
>>>>> No, problem. I would have pushed this earlier, but my build server 
>>>>> doesn't want to work any more. Looks like the SSD has passed its 
>>>>> warranty :(
>>>>>
>>>>> Should I push the other three patches to drm-misc-fixes as well? I 
>>>>> currently can't even build test them.
>>>>
>>>> Need to send a v2 for that. One minor change in the test just to be 
>>>> consistent with using u32. Thanks.
>>>
>>> Sent v2. If you could push that when you get a chance. Thanks.
>>>
>>> https://patchwork.freedesktop.org/series/130075/
>>
>> Gentle ping on merging v2.
> 
> Pushed all three to drm-misc-fixes.

Thanks.

> 
> Regards,
> Christian.
> 
>>
>>>
>>>>
>>>>>
>>>>> Thanks,
>>>>> Christian.
>>>>>
>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Christian.
>>>>>>>
>>>>>>>>
>>>>>>>>> ---
>>>>>>>>>   drivers/gpu/drm/tests/drm_buddy_test.c | 16 ++++++++--------
>>>>>>>>>   1 file changed, 8 insertions(+), 8 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c 
>>>>>>>>> b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>>>> index fee6bec757d1..edacc1adb28f 100644
>>>>>>>>> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>>>> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
>>>>>>>>> @@ -21,7 +21,7 @@ static inline u64 get_size(int order, u64 
>>>>>>>>> chunk_size)
>>>>>>>>>     static void drm_test_buddy_alloc_contiguous(struct kunit 
>>>>>>>>> *test)
>>>>>>>>>   {
>>>>>>>>> -    u64 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>>>>> +    u32 mm_size, ps = SZ_4K, i, n_pages, total;
>>>>>>>>>       struct drm_buddy_block *block;
>>>>>>>>>       struct drm_buddy mm;
>>>>>>>>>       LIST_HEAD(left);
>>>>>>>>> @@ -56,30 +56,30 @@ static void 
>>>>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>>>>           KUNIT_ASSERT_FALSE_MSG(test,
>>>>>>>>> drm_buddy_alloc_blocks(&mm, 0, mm_size,
>>>>>>>>>                                     ps, ps, list, 0),
>>>>>>>>> -                       "buddy_alloc hit an error size=%d\n",
>>>>>>>>> +                       "buddy_alloc hit an error size=%u\n",
>>>>>>>>>                          ps);
>>>>>>>>>       } while (++i < n_pages);
>>>>>>>>>         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>>> 0, mm_size,
>>>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>>> -                   "buddy_alloc didn't error size=%d\n", 3 * ps);
>>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>>>         drm_buddy_free_list(&mm, &middle);
>>>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>>> 0, mm_size,
>>>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * 
>>>>>>>>> ps);
>>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>>> 0, mm_size,
>>>>>>>>>                                  2 * ps, ps, &allocated,
>>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 2 * 
>>>>>>>>> ps);
>>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 2 * ps);
>>>>>>>>>         drm_buddy_free_list(&mm, &right);
>>>>>>>>>       KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>>> 0, mm_size,
>>>>>>>>>                                  3 * ps, ps, &allocated,
>>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>>> -                   "buddy_alloc didn't error size=%llu\n", 3 * 
>>>>>>>>> ps);
>>>>>>>>> +                   "buddy_alloc didn't error size=%u\n", 3 * ps);
>>>>>>>>>       /*
>>>>>>>>>        * At this point we should have enough contiguous space 
>>>>>>>>> for 2 blocks,
>>>>>>>>>        * however they are never buddies (since we freed middle 
>>>>>>>>> and right) so
>>>>>>>>> @@ -88,13 +88,13 @@ static void 
>>>>>>>>> drm_test_buddy_alloc_contiguous(struct kunit *test)
>>>>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>>> 0, mm_size,
>>>>>>>>>                                   2 * ps, ps, &allocated,
>>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>>> -                   "buddy_alloc hit an error size=%d\n", 2 * ps);
>>>>>>>>> +                   "buddy_alloc hit an error size=%u\n", 2 * ps);
>>>>>>>>>         drm_buddy_free_list(&mm, &left);
>>>>>>>>>       KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 
>>>>>>>>> 0, mm_size,
>>>>>>>>>                                   3 * ps, ps, &allocated,
>>>>>>>>> DRM_BUDDY_CONTIGUOUS_ALLOCATION),
>>>>>>>>> -                   "buddy_alloc hit an error size=%d\n", 3 * ps);
>>>>>>>>> +                   "buddy_alloc hit an error size=%u\n", 3 * ps);
>>>>>>>>>         total = 0;
>>>>>>>>>       list_for_each_entry(block, &allocated, link)
>>>>>>>
>>>>>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
index fee6bec757d1..edacc1adb28f 100644
--- a/drivers/gpu/drm/tests/drm_buddy_test.c
+++ b/drivers/gpu/drm/tests/drm_buddy_test.c
@@ -21,7 +21,7 @@  static inline u64 get_size(int order, u64 chunk_size)
 
 static void drm_test_buddy_alloc_contiguous(struct kunit *test)
 {
-	u64 mm_size, ps = SZ_4K, i, n_pages, total;
+	u32 mm_size, ps = SZ_4K, i, n_pages, total;
 	struct drm_buddy_block *block;
 	struct drm_buddy mm;
 	LIST_HEAD(left);
@@ -56,30 +56,30 @@  static void drm_test_buddy_alloc_contiguous(struct kunit *test)
 		KUNIT_ASSERT_FALSE_MSG(test,
 				       drm_buddy_alloc_blocks(&mm, 0, mm_size,
 							      ps, ps, list, 0),
-				       "buddy_alloc hit an error size=%d\n",
+				       "buddy_alloc hit an error size=%u\n",
 				       ps);
 	} while (++i < n_pages);
 
 	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
 							   3 * ps, ps, &allocated,
 							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
-			       "buddy_alloc didn't error size=%d\n", 3 * ps);
+			       "buddy_alloc didn't error size=%u\n", 3 * ps);
 
 	drm_buddy_free_list(&mm, &middle);
 	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
 							   3 * ps, ps, &allocated,
 							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
-			       "buddy_alloc didn't error size=%llu\n", 3 * ps);
+			       "buddy_alloc didn't error size=%u\n", 3 * ps);
 	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
 							   2 * ps, ps, &allocated,
 							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
-			       "buddy_alloc didn't error size=%llu\n", 2 * ps);
+			       "buddy_alloc didn't error size=%u\n", 2 * ps);
 
 	drm_buddy_free_list(&mm, &right);
 	KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
 							   3 * ps, ps, &allocated,
 							   DRM_BUDDY_CONTIGUOUS_ALLOCATION),
-			       "buddy_alloc didn't error size=%llu\n", 3 * ps);
+			       "buddy_alloc didn't error size=%u\n", 3 * ps);
 	/*
 	 * At this point we should have enough contiguous space for 2 blocks,
 	 * however they are never buddies (since we freed middle and right) so
@@ -88,13 +88,13 @@  static void drm_test_buddy_alloc_contiguous(struct kunit *test)
 	KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
 							    2 * ps, ps, &allocated,
 							    DRM_BUDDY_CONTIGUOUS_ALLOCATION),
-			       "buddy_alloc hit an error size=%d\n", 2 * ps);
+			       "buddy_alloc hit an error size=%u\n", 2 * ps);
 
 	drm_buddy_free_list(&mm, &left);
 	KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
 							    3 * ps, ps, &allocated,
 							    DRM_BUDDY_CONTIGUOUS_ALLOCATION),
-			       "buddy_alloc hit an error size=%d\n", 3 * ps);
+			       "buddy_alloc hit an error size=%u\n", 3 * ps);
 
 	total = 0;
 	list_for_each_entry(block, &allocated, link)