From: "Chen, Xiaogang" <xiaogang.chen@amd.com>
To: "Deng, Emily" <Emily.Deng@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2] drm/ttm: Should to return the evict error
Date: Thu, 22 May 2025 17:27:10 -0500 [thread overview]
Message-ID: <93eec18b-b05f-403b-a6ea-c082efba44ec@amd.com> (raw)
In-Reply-To: <PH0PR12MB5417991052F0D5ABED1D99528F99A@PH0PR12MB5417.namprd12.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]
On 5/21/2025 9:42 PM, Deng, Emily wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Ping......
>
> Emily Deng
> Best Wishes
>
>
>
>> -----Original Message-----
>> From: Emily Deng<Emily.Deng@amd.com>
>> Sent: Wednesday, May 21, 2025 11:57 AM
>> To:amd-gfx@lists.freedesktop.org
>> Cc: Deng, Emily<Emily.Deng@amd.com>
>> Subject: [PATCH v2] drm/ttm: Should to return the evict error
>>
>> For the evict fail case, the evict error should be returned.
>>
>> v2: Consider ENOENT case.
>>
>> Signed-off-by: Emily Deng<Emily.Deng@amd.com>
>> ---
>> drivers/gpu/drm/ttm/ttm_resource.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c
>> index 097716bd248a..abf104ae9d35 100644
>> --- a/drivers/gpu/drm/ttm/ttm_resource.c
>> +++ b/drivers/gpu/drm/ttm/ttm_resource.c
>> @@ -511,12 +511,12 @@ int ttm_resource_manager_evict_all(struct ttm_device
>> *bdev,
>> .force_alloc = true
>> };
>> struct dma_fence *fence;
>> - int ret;
>> + int ret, evict_ret = 0;
>>
>> do {
>> - ret = ttm_bo_evict_first(bdev, man, &ctx);
>> + evict_ret = ttm_bo_evict_first(bdev, man, &ctx);
>> cond_resched();
>> - } while (!ret);
>> + } while (!evict_ret);
>>
>> spin_lock(&man->move_lock);
>> fence = dma_fence_get(man->move);
>> @@ -529,7 +529,7 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,
>> return ret;
>> }
>>
>> - return 0;
>> + return (evict_ret == -ENOENT) ? 0 : evict_ret;
>> }
Can you explain why you care ENOENT(No such file or directory) specifically?
Regards
Xiaogang
>> EXPORT_SYMBOL(ttm_resource_manager_evict_all);
>>
>> --
>> 2.34.1
[-- Attachment #2: Type: text/html, Size: 2921 bytes --]
next prev parent reply other threads:[~2025-05-22 22:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-21 3:56 [PATCH v2] drm/ttm: Should to return the evict error Emily Deng
2025-05-22 2:42 ` Deng, Emily
2025-05-22 22:27 ` Chen, Xiaogang [this message]
2025-05-26 1:51 ` Deng, Emily
2025-05-28 6:19 ` Deng, Emily
2025-05-28 21:14 ` Chen, Xiaogang
2025-05-29 3:36 ` Deng, Emily
2025-05-30 1:40 ` Deng, Emily
2025-05-30 9:48 ` Zhang, Owen(SRDC)
2025-06-02 10:05 ` Christian König
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=93eec18b-b05f-403b-a6ea-c082efba44ec@amd.com \
--to=xiaogang.chen@amd.com \
--cc=Emily.Deng@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/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