* [PATCH] drm: aux ->transfer() can return 0, deal with it
@ 2016-07-28 14:54 ville.syrjala
2016-07-28 16:37 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: ville.syrjala @ 2016-07-28 14:54 UTC (permalink / raw)
To: dri-devel; +Cc: Lyude, Daniel Vetter, stable
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Restore the correct behaviour (as in check msg.reply) when aux
->transfer() returns 0. It got removed in
commit 82922da39190 ("drm/dp_helper: Retry aux transactions on all errors")
Now I can actually dump the "entire" DPCD on a Dell UP2314Q with
ddrescue. It has some offsets in the DPCD that can't be read
for some resaon, all you get is defers. Previously ddrescue would
just give up at the first unredable offset on account of
read() returning 0 means EOF. Here's the ddrescue log
for the interested:
0x00000000 0x00001400 +
0x00001400 0x00000030 -
0x00001430 0x000001D0 +
0x00001600 0x00000030 -
0x00001630 0x0001F9D0 +
0x00021000 0x00000001 -
0x00021001 0x000DEFFF +
Cc: Lyude <cpaul@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch
Cc: stable@vger.kernel.org
Fixes: 82922da39190 ("drm/dp_helper: Retry aux transactions on all errors")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/drm_dp_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 091053e995e5..8f11b8741e42 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -203,7 +203,7 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
ret = aux->transfer(aux, &msg);
- if (ret > 0) {
+ if (ret >= 0) {
native_reply = msg.reply & DP_AUX_NATIVE_REPLY_MASK;
if (native_reply == DP_AUX_NATIVE_REPLY_ACK) {
if (ret == size)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm: aux ->transfer() can return 0, deal with it
2016-07-28 14:54 [PATCH] drm: aux ->transfer() can return 0, deal with it ville.syrjala
@ 2016-07-28 16:37 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2016-07-28 16:37 UTC (permalink / raw)
To: ville.syrjala, Dave Airlie; +Cc: dri-devel, Lyude, Daniel Vetter, stable
On Thu, Jul 28, 2016 at 05:54:42PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrj�l� <ville.syrjala@linux.intel.com>
>
> Restore the correct behaviour (as in check msg.reply) when aux
> ->transfer() returns 0. It got removed in
> commit 82922da39190 ("drm/dp_helper: Retry aux transactions on all errors")
>
> Now I can actually dump the "entire" DPCD on a Dell UP2314Q with
> ddrescue. It has some offsets in the DPCD that can't be read
> for some resaon, all you get is defers. Previously ddrescue would
> just give up at the first unredable offset on account of
> read() returning 0 means EOF. Here's the ddrescue log
> for the interested:
> 0x00000000 0x00001400 +
> 0x00001400 0x00000030 -
> 0x00001430 0x000001D0 +
> 0x00001600 0x00000030 -
> 0x00001630 0x0001F9D0 +
> 0x00021000 0x00000001 -
> 0x00021001 0x000DEFFF +
>
> Cc: Lyude <cpaul@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch
> Cc: stable@vger.kernel.org
> Fixes: 82922da39190 ("drm/dp_helper: Retry aux transactions on all errors")
> Signed-off-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>
Seems to correctly restore that special case.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Dave, since I just send out a drm-misc pull, can you pls apply this one
directly to drm-next?
-Daniel
> ---
> drivers/gpu/drm/drm_dp_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 091053e995e5..8f11b8741e42 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -203,7 +203,7 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
>
> ret = aux->transfer(aux, &msg);
>
> - if (ret > 0) {
> + if (ret >= 0) {
> native_reply = msg.reply & DP_AUX_NATIVE_REPLY_MASK;
> if (native_reply == DP_AUX_NATIVE_REPLY_ACK) {
> if (ret == size)
> --
> 2.7.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-28 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-28 14:54 [PATCH] drm: aux ->transfer() can return 0, deal with it ville.syrjala
2016-07-28 16:37 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox