@@ -1399,6 +1399,9 @@ int _hdcp2_propagate_stream_management_info(struct intel_connector *connector)
const struct intel_hdcp_shim *shim = hdcp->shim;
int ret;
+ if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX)
+ return -ERANGE;
+
/* Prepare RepeaterAuth_Stream_Manage msg */
msgs.stream_manage.msg_id = HDCP_2_2_REP_STREAM_MANAGE;
drm_hdcp_cpu_to_be24(msgs.stream_manage.seq_num_m, hdcp->seq_num_m);
@@ -1427,11 +1430,6 @@ int _hdcp2_propagate_stream_management_info(struct intel_connector *connector)
out:
hdcp->seq_num_m++;
- if (hdcp->seq_num_m > HDCP_2_2_SEQ_NUM_MAX) {
- DRM_DEBUG_KMS("seq_num_m roll over.\n");
- ret = -ERANGE;
- }
-
return ret;
}
@@ -1639,6 +1637,13 @@ hdcp2_propagate_stream_management_info(struct intel_connector *connector)
if (!ret)
break;
+ /* Lets restart the auth incase of seq_num_m roll over */
+ if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX) {
+ drm_dbg_kms(&i915->drm,
+ "seq_num_m roll over.(%d)\n", ret);
+ break;
+ }
+
drm_dbg_kms(&i915->drm,
"HDCP2 stream management %d of %d Failed.(%d)\n",
i + 1, tries, ret);