<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 5/21/2025 9:42 PM, Deng, Emily
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:PH0PR12MB5417991052F0D5ABED1D99528F99A@PH0PR12MB5417.namprd12.prod.outlook.com">
      <pre wrap="" class="moz-quote-pre">[AMD Official Use Only - AMD Internal Distribution Only]

[AMD Official Use Only - AMD Internal Distribution Only]

Ping......

Emily Deng
Best Wishes



</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">-----Original Message-----
From: Emily Deng <a class="moz-txt-link-rfc2396E" href="mailto:Emily.Deng@amd.com"><Emily.Deng@amd.com></a>
Sent: Wednesday, May 21, 2025 11:57 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>
Cc: Deng, Emily <a class="moz-txt-link-rfc2396E" href="mailto:Emily.Deng@amd.com"><Emily.Deng@amd.com></a>
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 <a class="moz-txt-link-rfc2396E" href="mailto:Emily.Deng@amd.com"><Emily.Deng@amd.com></a>
---
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;
}</pre>
      </blockquote>
    </blockquote>
    <p>Can you explain why you care <span style="white-space: pre-wrap">ENOENT</span>(No
      such file or directory) specifically?</p>
    <p>Regards</p>
    <p>Xiaogang<br>
    </p>
    <blockquote type="cite" cite="mid:PH0PR12MB5417991052F0D5ABED1D99528F99A@PH0PR12MB5417.namprd12.prod.outlook.com">
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">
EXPORT_SYMBOL(ttm_resource_manager_evict_all);

--
2.34.1
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
</pre>
    </blockquote>
  </body>
</html>