summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-04-04 11:34:37 +1000
committerDave Airlie <airlied@redhat.com>2014-04-05 16:06:34 +1000
commitaa17edff0afa893b5ab1dd60d842cc6f42e847b4 (patch)
treeef4b30653b21ee5ff17a5c4ca67b23f3b7fe39b4 /drivers/gpu
parentf4d1b02129d3045c20ebadda8865db2cc7ce2cb5 (diff)
downloadlinux-aa17edff0afa893b5ab1dd60d842cc6f42e847b4.tar.bz2
drm/dp_helper: don't return EPROTO for defers (v2)
If we get a msg.reply of REPLY_DEFER, we also get an err of 0 so we fail reads with 0 < size and return -EPROTO instead of trying again. v2: same fix in i2c code. Found writing MST support. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_dp_helper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index f4babed2f557..27671489477d 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -386,11 +386,11 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
return err;
}
- if (err < size)
- return -EPROTO;
switch (msg.reply & DP_AUX_NATIVE_REPLY_MASK) {
case DP_AUX_NATIVE_REPLY_ACK:
+ if (err < size)
+ return -EPROTO;
return err;
case DP_AUX_NATIVE_REPLY_NACK:
@@ -599,8 +599,6 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
return err;
}
- if (err < msg->size)
- return -EPROTO;
switch (msg->reply & DP_AUX_NATIVE_REPLY_MASK) {
case DP_AUX_NATIVE_REPLY_ACK:
@@ -639,6 +637,8 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
* Both native ACK and I2C ACK replies received. We
* can assume the transfer was successful.
*/
+ if (err < msg->size)
+ return -EPROTO;
return 0;
case DP_AUX_I2C_REPLY_NACK: