* [PATCH] drm/buddy: Modify duplicate list_splice_tail call
@ 2024-02-16 10:00 Arunpravin Paneer Selvam
2024-02-16 11:11 ` Matthew Auld
0 siblings, 1 reply; 5+ messages in thread
From: Arunpravin Paneer Selvam @ 2024-02-16 10:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, intel-gfx
Cc: christian.koenig, alexander.deucher, matthew.auld,
mario.limonciello, spasswolf, Arunpravin Paneer Selvam, stable
Remove the duplicate list_splice_tail call when the
total_allocated < size condition is true.
Cc: <stable@vger.kernel.org> # 6.7+
Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling code")
Reported-by: Bert Karwatzki <spasswolf@web.de>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
---
drivers/gpu/drm/drm_buddy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index c1a99bf4dffd..c4222b886db7 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
list_add(&block->left->tmp_link, dfs);
} while (1);
- list_splice_tail(&allocated, blocks);
-
if (total_allocated < size) {
err = -ENOSPC;
goto err_free;
}
+ list_splice_tail(&allocated, blocks);
+
return 0;
err_undo:
base-commit: a64056bb5a3215bd31c8ce17d609ba0f4d5c55ea
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call
2024-02-16 10:00 [PATCH] drm/buddy: Modify duplicate list_splice_tail call Arunpravin Paneer Selvam
@ 2024-02-16 11:11 ` Matthew Auld
2024-02-16 11:46 ` Arunpravin Paneer Selvam
0 siblings, 1 reply; 5+ messages in thread
From: Matthew Auld @ 2024-02-16 11:11 UTC (permalink / raw)
To: Arunpravin Paneer Selvam, dri-devel, amd-gfx, intel-gfx
Cc: christian.koenig, alexander.deucher, mario.limonciello, spasswolf,
stable
On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote:
> Remove the duplicate list_splice_tail call when the
> total_allocated < size condition is true.
>
> Cc: <stable@vger.kernel.org> # 6.7+
> Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling code")
> Reported-by: Bert Karwatzki <spasswolf@web.de>
> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> ---
> drivers/gpu/drm/drm_buddy.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index c1a99bf4dffd..c4222b886db7 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
> list_add(&block->left->tmp_link, dfs);
> } while (1);
>
> - list_splice_tail(&allocated, blocks);
> -
> if (total_allocated < size) {
> err = -ENOSPC;
> goto err_free;
> }
>
> + list_splice_tail(&allocated, blocks);
Sigh. Can we extend the unit test(s) to catch this?
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> +
> return 0;
>
> err_undo:
>
> base-commit: a64056bb5a3215bd31c8ce17d609ba0f4d5c55ea
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call
2024-02-16 11:11 ` Matthew Auld
@ 2024-02-16 11:46 ` Arunpravin Paneer Selvam
2024-02-16 11:59 ` Christian König
0 siblings, 1 reply; 5+ messages in thread
From: Arunpravin Paneer Selvam @ 2024-02-16 11:46 UTC (permalink / raw)
To: Matthew Auld, dri-devel, amd-gfx, intel-gfx
Cc: christian.koenig, alexander.deucher, mario.limonciello, spasswolf,
stable
On 2/16/2024 4:41 PM, Matthew Auld wrote:
> On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote:
>> Remove the duplicate list_splice_tail call when the
>> total_allocated < size condition is true.
>>
>> Cc: <stable@vger.kernel.org> # 6.7+
>> Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling code")
>> Reported-by: Bert Karwatzki <spasswolf@web.de>
>> Signed-off-by: Arunpravin Paneer Selvam
>> <Arunpravin.PaneerSelvam@amd.com>
>> ---
>> drivers/gpu/drm/drm_buddy.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
>> index c1a99bf4dffd..c4222b886db7 100644
>> --- a/drivers/gpu/drm/drm_buddy.c
>> +++ b/drivers/gpu/drm/drm_buddy.c
>> @@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
>> list_add(&block->left->tmp_link, dfs);
>> } while (1);
>> - list_splice_tail(&allocated, blocks);
>> -
>> if (total_allocated < size) {
>> err = -ENOSPC;
>> goto err_free;
>> }
>> + list_splice_tail(&allocated, blocks);
>
> Sigh. Can we extend the unit test(s) to catch this?
Sure, Let me check.
Regards,
Arun.
>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
>
>> +
>> return 0;
>> err_undo:
>>
>> base-commit: a64056bb5a3215bd31c8ce17d609ba0f4d5c55ea
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call
2024-02-16 11:46 ` Arunpravin Paneer Selvam
@ 2024-02-16 11:59 ` Christian König
2024-02-19 4:55 ` Arunpravin Paneer Selvam
0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2024-02-16 11:59 UTC (permalink / raw)
To: Arunpravin Paneer Selvam, Matthew Auld, dri-devel, amd-gfx,
intel-gfx
Cc: alexander.deucher, mario.limonciello, spasswolf, stable
Am 16.02.24 um 12:46 schrieb Arunpravin Paneer Selvam:
>
>
> On 2/16/2024 4:41 PM, Matthew Auld wrote:
>> On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote:
>>> Remove the duplicate list_splice_tail call when the
>>> total_allocated < size condition is true.
>>>
>>> Cc: <stable@vger.kernel.org> # 6.7+
>>> Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling
>>> code")
>>> Reported-by: Bert Karwatzki <spasswolf@web.de>
>>> Signed-off-by: Arunpravin Paneer Selvam
>>> <Arunpravin.PaneerSelvam@amd.com>
>>> ---
>>> drivers/gpu/drm/drm_buddy.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
>>> index c1a99bf4dffd..c4222b886db7 100644
>>> --- a/drivers/gpu/drm/drm_buddy.c
>>> +++ b/drivers/gpu/drm/drm_buddy.c
>>> @@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
>>> list_add(&block->left->tmp_link, dfs);
>>> } while (1);
>>> - list_splice_tail(&allocated, blocks);
>>> -
>>> if (total_allocated < size) {
>>> err = -ENOSPC;
>>> goto err_free;
>>> }
>>> + list_splice_tail(&allocated, blocks);
>>
>> Sigh. Can we extend the unit test(s) to catch this?
> Sure, Let me check.
In the meantime I'm going to push this one to drm-misc-fixes.
Regards,
Christian.
>
> Regards,
> Arun.
>>
>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
>>
>>> +
>>> return 0;
>>> err_undo:
>>>
>>> base-commit: a64056bb5a3215bd31c8ce17d609ba0f4d5c55ea
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call
2024-02-16 11:59 ` Christian König
@ 2024-02-19 4:55 ` Arunpravin Paneer Selvam
0 siblings, 0 replies; 5+ messages in thread
From: Arunpravin Paneer Selvam @ 2024-02-19 4:55 UTC (permalink / raw)
To: Christian König, Matthew Auld, dri-devel, amd-gfx, intel-gfx
Cc: alexander.deucher, mario.limonciello, spasswolf, stable
Hi Christian,
On 2/16/2024 5:29 PM, Christian König wrote:
>
>
> Am 16.02.24 um 12:46 schrieb Arunpravin Paneer Selvam:
>>
>>
>> On 2/16/2024 4:41 PM, Matthew Auld wrote:
>>> On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote:
>>>> Remove the duplicate list_splice_tail call when the
>>>> total_allocated < size condition is true.
>>>>
>>>> Cc: <stable@vger.kernel.org> # 6.7+
>>>> Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling
>>>> code")
>>>> Reported-by: Bert Karwatzki <spasswolf@web.de>
>>>> Signed-off-by: Arunpravin Paneer Selvam
>>>> <Arunpravin.PaneerSelvam@amd.com>
>>>> ---
>>>> drivers/gpu/drm/drm_buddy.c | 4 ++--
>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
>>>> index c1a99bf4dffd..c4222b886db7 100644
>>>> --- a/drivers/gpu/drm/drm_buddy.c
>>>> +++ b/drivers/gpu/drm/drm_buddy.c
>>>> @@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
>>>> list_add(&block->left->tmp_link, dfs);
>>>> } while (1);
>>>> - list_splice_tail(&allocated, blocks);
>>>> -
>>>> if (total_allocated < size) {
>>>> err = -ENOSPC;
>>>> goto err_free;
>>>> }
>>>> + list_splice_tail(&allocated, blocks);
>>>
>>> Sigh. Can we extend the unit test(s) to catch this?
>> Sure, Let me check.
>
> In the meantime I'm going to push this one to drm-misc-fixes.
Thank you!
>
> Regards,
> Christian.
>
>>
>> Regards,
>> Arun.
>>>
>>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
>>>
>>>> +
>>>> return 0;
>>>> err_undo:
>>>>
>>>> base-commit: a64056bb5a3215bd31c8ce17d609ba0f4d5c55ea
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-19 4:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-16 10:00 [PATCH] drm/buddy: Modify duplicate list_splice_tail call Arunpravin Paneer Selvam
2024-02-16 11:11 ` Matthew Auld
2024-02-16 11:46 ` Arunpravin Paneer Selvam
2024-02-16 11:59 ` Christian König
2024-02-19 4:55 ` Arunpravin Paneer Selvam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox