Browse Source

disp: msm: dp: modify handling of CP_IRQ to fix HDCP 2.3 CTS test 1B-09

Upon receiving a CP_IRQ, the current implementation waits for up to 200
milliseconds for the link polling to be enabled, before reading the
message from the sink. This wait is currently done in the DP HDCP
module's main event thread. However, polling mode is also enabled in the
same event thread upon a wakeup triggered by the HDCP engine. This can
be problematic if the CP_IRQ comes before link has been transitioned to
the polling mode. Such a sequence of event is easily seen when executing
HDCP 2.3 CTS test 1B-09 using Unigraf UCD-400 test equipment.

To address this, wait for the polling mode to be enabled from the CP_IRQ
handler context directly and invoke the event thread only for reading
the CP_IRQ message after the link has transitioned to polling mode.

In addition to the above change, increase the wait time for link to
transition to polling mode to 300ms. This is needed because, in the
current implementation there is a fixed delay of 200ms as part of the
call to the QSEECOM API to enable encryption after the authentication is
successful.

Change-Id: I0bdd4893bf63e6ae0fcda5dfb61f23e901061207
Signed-off-by: Aravind Venkateswaran <[email protected]>
Aravind Venkateswaran 4 years ago
parent
commit
38407b22c4
1 changed files with 26 additions and 6 deletions
  1. 26 6
      msm/dp/dp_hdcp2p2.c

+ 26 - 6
msm/dp/dp_hdcp2p2.c

@@ -570,7 +570,7 @@ static void dp_hdcp2p2_recv_msg(struct dp_hdcp2p2_ctrl *ctrl)
 
 static void dp_hdcp2p2_link_check(struct dp_hdcp2p2_ctrl *ctrl)
 {
-	int rc = 0, retries = 10;
+	int rc = 0;
 	struct sde_hdcp_2x_wakeup_data cdata = {HDCP_2X_CMD_INVALID};
 
 	if (!ctrl) {
@@ -603,10 +603,6 @@ static void dp_hdcp2p2_link_check(struct dp_hdcp2p2_ctrl *ctrl)
 		goto exit;
 	}
 
-	/* wait for polling to start till spec allowed timeout */
-	while (!ctrl->polling && retries--)
-		msleep(20);
-
 	/* check if sink has made a message available */
 	if (ctrl->polling && (ctrl->sink_rx_status & ctrl->rx_status)) {
 		ctrl->sink_rx_status = 0;
@@ -673,7 +669,7 @@ error:
 
 static int dp_hdcp2p2_cp_irq(void *input)
 {
-	int rc;
+	int rc, retries = 15;
 	struct dp_hdcp2p2_ctrl *ctrl = input;
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY);
 
@@ -701,7 +697,31 @@ static int dp_hdcp2p2_cp_irq(void *input)
 		return -EINVAL;
 	}
 
+	/*
+	 * Wait for link to be transitioned to polling mode. This wait
+	 * should be done in this CP_IRQ handler and NOT in the event thread
+	 * as the transition to link polling happens in the event thread
+	 * as part of the wake up from the HDCP engine.
+	 *
+	 * One specific case where this sequence of event commonly happens
+	 * is when executing HDCP 2.3 CTS test 1B-09 with Unigraf UCD-400
+	 * test equipment (TE). As part of this test, the TE issues a CP-IRQ
+	 * right after the successful completion of the HDCP authentication
+	 * part 2. This CP-IRQ handler gets invoked even before the HDCP
+	 * state engine gets transitioned to the polling mode, which can
+	 * cause the test to fail as we would not read the
+	 * RepeaterAuth_Send_ReceiverID_List from the TE in response to the
+	 * CP_IRQ.
+	 *
+	 * Skip this wait when any of the fields in the abort mask is set.
+	 */
+	if (ctrl->sink_rx_status & ctrl->abort_mask)
+		goto exit;
 
+	while (!ctrl->polling && retries--)
+		msleep(20);
+
+exit:
 	kfifo_put(&ctrl->cmd_q, HDCP_TRANSPORT_CMD_LINK_CHECK);
 	wake_up(&ctrl->wait_q);
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT);