Skip to contentSkip to conversation

drm/dp_helper: don't return EPROTO for defers

PATCH In review Dave Airlie 3 participants 4 messages Apr 4, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm/dp_helper: don't return EPROTO for defers

From: Dave Airlie <[email protected]>

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.

Found writing MST support.

---
 drivers/gpu/drm/drm_dp_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +2 -2
index f4babed..725354f 100644
@@ -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:
Signature · 1 line
1.8.5.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Dave Airlie

From: Dave Airlie <[email protected]>

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.

Found writing MST support.

Quoted 30 lines
---
 drivers/gpu/drm/drm_dp_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +2 -2
index f4babed..725354f 100644
@@ -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:
Signature · 6 lines
1.8.5.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#2 lore raw
Quoted 11 lines · Jani Nikula
Quoted 8 lines · Dave Airlie

From: Dave Airlie <[email protected]>

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.

Found writing MST support.

On second thought, I think you'll need the same for drm_dp_i2c_do_msg() as well.

Cheers,
Jani.

Quoted 39 lines
Quoted 32 lines
---
 drivers/gpu/drm/drm_dp_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +2 -2
index f4babed..725354f 100644
@@ -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:
Signature · 6 lines
1.8.5.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Reviewed-by
#3 lore raw
Quoted 8 lines · Jani Nikula
Quoted 7 lines · Jani Nikula
Quoted 6 lines · Dave Airlie

From: Dave Airlie <[email protected]>

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.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Found writing MST support.

On second thought, I think you'll need the same for drm_dp_i2c_do_msg() as well.

I agree. drm_dp_i2c_do_msg() should have the same change. With that:

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel