Skip to contentSkip to conversation

drm/amd/display: Don't print error when bo_pin is interrupted

PATCH Superseded Harry Wentland 3 participants 4 messages Oct 26, 2017 – Oct 27, 2017 3 messages not in the archive

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/amd/display: Don't print error when bo_pin is interrupted

v2: Also don't print for ERESTARTSYS or EAGAIN

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index cf15701f208d..4401f0fb3f02 100644
@@ -2944,7 +2944,8 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
 	amdgpu_bo_unreserve(rbo);
 
 	if (unlikely(r != 0)) {
-		DRM_ERROR("Failed to pin framebuffer\n");
+		if (!(r == -EINTR || r == -ERESTARTSYS || r == EAGAIN))
+			DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
 		return r;
 	}
 
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171026200801.14662-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 3 lines · Harry Wentland

v2: Also don't print for ERESTARTSYS or EAGAIN

Thanks,
Andrey

Quoted 9 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index cf15701f208d..4401f0fb3f02 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · line 2951

Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -2944,7 +2944,8 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
  	amdgpu_bo_unreserve(rbo);
 
  	if (unlikely(r != 0)) {
-		DRM_ERROR("Failed to pin framebuffer\n");
+		if (!(r == -EINTR || r == -ERESTARTSYS || r == EAGAIN))
+			DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
  		return r;
  	}
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): ff616ee9-0e16-5278-1169-b75b61db6141-5C7GfCeVMHo@public.gmane.org

#4 lore raw

Hi Harry,

actually it's best practice that you only ignore ERESTARTSYS here, see other code in the driver as well.

EINTR means that the IOCTL was interrupted and can't be restarted because of some problem.

EAGAIN mean the we can't do this operation right now, but might be able to do it at some point in the future.

Both sound like a good idea to note to the user.

Regards,
Christian.

Am 26.10.2017 um 22:16 schrieb Andrey Grodzovsky:

Quoted 24 lines · Harry Wentland
Quoted 3 lines

v2: Also don't print for ERESTARTSYS or EAGAIN

Thanks,
Andrey

Quoted 11 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index cf15701f208d..4401f0fb3f02 100644
@@ -2944,7 +2944,8 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
  	amdgpu_bo_unreserve(rbo);
 
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · line 2951

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
  	if (unlikely(r != 0)) {
-		DRM_ERROR("Failed to pin framebuffer\n");
+		if (!(r == -EINTR || r == -ERESTARTSYS || r == EAGAIN))
+			DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
  		return r;
  	}
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 28547400-b0f2-d3b0-2f9d-14749a479257-5C7GfCeVMHo@public.gmane.org

#6 lore raw

Hi Christian,

thanks for clarifying the semantics. I wasn't fully clear on that. What you say makes sense. I'll respin the patch.

Harry

Quoted 6 lines · Christian König

Hi Harry,

actually it's best practice that you only ignore ERESTARTSYS here, see other code in the driver as well.

EINTR means that the IOCTL was interrupted and can't be restarted because of some problem.

Quoted 41 lines

EAGAIN mean the we can't do this operation right now, but might be able to do it at some point in the future.

Both sound like a good idea to note to the user.

Regards,
Christian.

Am 26.10.2017 um 22:16 schrieb Andrey Grodzovsky:

Quoted 32 lines · Harry Wentland
Quoted 3 lines

v2: Also don't print for ERESTARTSYS or EAGAIN

Thanks,
Andrey

Quoted 18 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index cf15701f208d..4401f0fb3f02 100644
@@ -2944,7 +2944,8 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
 	amdgpu_bo_unreserve(rbo);
 
 	if (unlikely(r != 0)) {
-		DRM_ERROR("Failed to pin framebuffer\n");
+		if (!(r == -EINTR || r == -ERESTARTSYS || r == EAGAIN))
+			DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
 		return r;
 	}
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx