drm/i915: make sink_crc return -EIO on aux read/write failure
Subsystems (2)
Rodrigo Vivi
maintainerPATCH 1/1 drm/i915: make sink_crc return -EIO on aux read/write failure
Cc Daniel Vetter <[email protected]>
Cc Todd Previte <[email protected]>
Signed-off-by Rodrigo Vivi <[email protected]>
--- drivers/gpu/drm/i915/intel_dp.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +13 -6
@@ -3868,16 +3868,21 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (!(buf &DP_TEST_CRC_SUPPORTED ))return -ENOTTY ; -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); +if (drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf) <0 ) +return -EIO ; +if (drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , buf |DP_TEST_SINK_START ) <0 )return -EIO ; -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf); +if (drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf) <0 ) +return -EIO ; test_crc_count = buf &DP_TEST_COUNT_MASK ;do { -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf); +if (drm_dp_dpcd_readb (&intel_dp->aux, +DP_TEST_SINK_MISC , &buf) <0 ) +return -EIO ;intel_wait_for_vblank (dev, intel_crtc->pipe); }while (--attempts && (buf &DP_TEST_COUNT_MASK ) == test_crc_count);
@@ -3889,9 +3894,11 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (drm_dp_dpcd_read (&intel_dp->aux,DP_TEST_CRC_R_CR , crc,6 ) <0 )return -EIO ; -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); -drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , - buf & ~DP_TEST_SINK_START ); +if (drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf) <0 ) +return -EIO ; +if (drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , + buf & ~DP_TEST_SINK_START ) <0 ) +return -EIO ;return 0 ; }
Signature · 1 line
1.9.3
Daniel Vetter
AppliedOn Wed, Oct 01, 2014 at 07:32:37AM -0700, Rodrigo Vivi wrote:
Nothing is usually to little commit message. I've fixed this while applying.
Quoted 3 lines
Cc Daniel Vetter <[email protected]>Cc Todd Previte <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 51 lines
--- drivers/gpu/drm/i915/intel_dp.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/intel_dp.c +13
-6@@ -3868,16 +3868,21 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (!(buf &DP_TEST_CRC_SUPPORTED ))return -ENOTTY ; -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); +if (drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf) <0 ) +return -EIO ; +if (drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , buf |DP_TEST_SINK_START ) <0 )return -EIO ; -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf); +if (drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf) <0 ) +return -EIO ; test_crc_count = buf &DP_TEST_COUNT_MASK ;do { -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf); +if (drm_dp_dpcd_readb (&intel_dp->aux, +DP_TEST_SINK_MISC , &buf) <0 ) +return -EIO ;intel_wait_for_vblank (dev, intel_crtc->pipe); }while (--attempts && (buf &DP_TEST_COUNT_MASK ) == test_crc_count);@@ -3889,9 +3894,11 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (drm_dp_dpcd_read (&intel_dp->aux,DP_TEST_CRC_R_CR , crc,6 ) <0 )return -EIO ; -drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); -drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , - buf & ~DP_TEST_SINK_START ); +if (drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf) <0 ) +return -EIO ; +if (drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , + buf & ~DP_TEST_SINK_START ) <0 ) +return -EIO ;return 0 ; }Signature · 1 line
1.9.3
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch