Skip to contentSkip to conversation

drm/amd/display: fix return value of dm_dp_aux_transfer()

PATCH New Shirish S 1 participant 1 message Apr 17, 2018

Subsystems (3)
lore
Share & tools
lore

Shirish S

author
#0 lore raw

PATCH 1/1 drm/amd/display: fix return value of dm_dp_aux_transfer()

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 provided appropriately to the callers to it.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +5 -1
index 782491e..7ac124d 100644
@@ -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,
Signature · 6 lines
2.7.4

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