diff mbox series

[v2,5/7] drm/ttm: Don't print error message if eviction was interrupted

Message ID 20230307144621.10748-6-thomas.hellstrom@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/ttm: Small fixes / cleanups in prep for shrinking | expand

Commit Message

Thomas Hellström March 7, 2023, 2:46 p.m. UTC
Avoid printing an error message if eviction was interrupted by,
for example, the user pressing CTRL-C. That may happen if eviction
is waiting for something, like for example a free batch-buffer.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christian König March 8, 2023, 8:50 a.m. UTC | #1
Am 07.03.23 um 15:46 schrieb Thomas Hellström:
> Avoid printing an error message if eviction was interrupted by,
> for example, the user pressing CTRL-C. That may happen if eviction
> is waiting for something, like for example a free batch-buffer.
>
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 882c2fa346f3..459f1b4440da 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -464,7 +464,8 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
>   	if (ret == -EMULTIHOP) {
>   		ret = ttm_bo_bounce_temp_buffer(bo, &evict_mem, ctx, &hop);
>   		if (ret) {
> -			pr_err("Buffer eviction failed\n");
> +			if (ret != -ERESTARTSYS && ret != -EINTR)
> +				pr_err("Buffer eviction failed\n");
>   			ttm_resource_free(bo, &evict_mem);
>   			goto out;
>   		}
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 882c2fa346f3..459f1b4440da 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -464,7 +464,8 @@  static int ttm_bo_evict(struct ttm_buffer_object *bo,
 	if (ret == -EMULTIHOP) {
 		ret = ttm_bo_bounce_temp_buffer(bo, &evict_mem, ctx, &hop);
 		if (ret) {
-			pr_err("Buffer eviction failed\n");
+			if (ret != -ERESTARTSYS && ret != -EINTR)
+				pr_err("Buffer eviction failed\n");
 			ttm_resource_free(bo, &evict_mem);
 			goto out;
 		}