All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: fix return value of dm_dp_aux_transfer() (V2)
@ 2018-04-18  2:56 Shirish S
       [not found] ` <1524020209-8481-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Shirish S @ 2018-04-18  2:56 UTC (permalink / raw)
  To: Alexander.Deucher-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	harry.wentland-5C7GfCeVMHo
  Cc: Shirish S

Currently the dm_dp_aux_transfer() does not parse
the return value of dal_ddc_service_read_dpcd_data(), which also
has a failure case.
This patch captures the same and ensures the i2c operation status is
sent appropriately to the drm framework.

V2: Updated commit message.

Signed-off-by: Shirish S <shirish.s@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 782491e..7ac124d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -115,7 +115,11 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 				msg->address,
 				msg->buffer,
 				msg->size);
-		return read_bytes;
+		if (read_bytes != msg->size &&
+		    read_bytes >= DDC_RESULT_FAILED_OPERATION)
+			return -EIO;
+		else
+			return read_bytes;
 	case DP_AUX_I2C_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-27  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18  2:56 [PATCH] drm/amd/display: fix return value of dm_dp_aux_transfer() (V2) Shirish S
     [not found] ` <1524020209-8481-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2018-04-20 18:22   ` Harry Wentland
     [not found]     ` <3fa10009-7ef6-666f-a9ba-9888200be8ff-5C7GfCeVMHo@public.gmane.org>
2018-04-23  4:23       ` S, Shirish
     [not found]         ` <f1a2e63b-db81-d24e-9535-1d22af84efb1-5C7GfCeVMHo@public.gmane.org>
2018-04-24 12:59           ` S, Shirish
     [not found]             ` <f4520258-7efc-d19e-49b1-81ff6becc269-5C7GfCeVMHo@public.gmane.org>
2018-04-24 15:27               ` [PATCH] drm/amd/display: Don't return ddc result and read_bytes in same return value Harry Wentland
     [not found]                 ` <20180424152710.7810-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-04-27  9:33                   ` S, Shirish

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.