On Mon, Feb 26, 2018 at 10:42:36PM +0530, Ramalingam C wrote: > In case of V prime mismatch, DP HDCP spec mandates the re-read of > Vprime atleast twice. > > DP HDCP CTS Test: 1B-05 > > Signed-off-by: Ramalingam C <ramalingam.c@xxxxxxxxx> > --- > drivers/gpu/drm/i915/intel_hdcp.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c > index 730681d2dbfb..7ea55fa46f41 100644 > --- a/drivers/gpu/drm/i915/intel_hdcp.c > +++ b/drivers/gpu/drm/i915/intel_hdcp.c > @@ -150,7 +150,7 @@ int intel_hdcp_auth_downstream(struct intel_digital_port *intel_dig_port, > struct drm_i915_private *dev_priv; > u32 vprime, sha_text, sha_leftovers, rep_ctl; > u8 bstatus[2], num_downstream, *ksv_fifo; > - int ret, i, j, sha_idx; > + int ret, i, j, sha_idx, tries = 3; > > dev_priv = intel_dig_port->base.base.dev->dev_private; > > @@ -189,6 +189,7 @@ int intel_hdcp_auth_downstream(struct intel_digital_port *intel_dig_port, > if (ret) > return ret; > > +read_v_prime: Instead of using the label for retry, please break it out into a function that's enclosed in a retry loop. Sean > /* Process V' values from the receiver */ > for (i = 0; i < DRM_HDCP_V_PRIME_NUM_PARTS; i++) { > ret = shim->read_v_prime_part(intel_dig_port, i, &vprime); > @@ -385,6 +386,13 @@ int intel_hdcp_auth_downstream(struct intel_digital_port *intel_dig_port, > return -ETIMEDOUT; > } > if (!(I915_READ(HDCP_REP_CTL) & HDCP_SHA1_V_MATCH)) { > + > + /* > + * When V prime mismatches, DP Spec mandates re-read of > + * V prime atleast twice. > + */ > + if (--tries) > + goto read_v_prime; > DRM_ERROR("SHA-1 mismatch, HDCP failed\n"); > return -ENXIO; > } > -- > 2.7.4 > -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx