disp: msm: Ensure clean slate when starting and stopping HDCP

The DP HDCP layer fails to wait on and clear its internal thread
upon an HDCP stop or failure. This can result in use after free
failures if a read or write over aux channel operation is already
queued.

Update the DP HDCP layer to stop and wait on kthread completion
upon HDCP failures, and clear the kthread command queue before
resuming kthread execution. Additionally, ensure the SDE HDCP
worker thread correctly starts and stops execution upon HDCP
enablement and disablement respectively.

Change-Id: I4218d7935f89416b5e5d74afd8f5d22e031b9a38
Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
This commit is contained in:
Christopher Braga
2019-05-02 18:04:44 -04:00
والد c24090b2c5
کامیت 7e9b80092b
3فایلهای تغییر یافته به همراه16 افزوده شده و 5 حذف شده

مشاهده پرونده

@@ -196,16 +196,20 @@ static int dp_hdcp2p2_wakeup(struct hdcp_transport_wakeup_data *data)
switch (data->cmd) {
case HDCP_TRANSPORT_CMD_STATUS_SUCCESS:
atomic_set(&ctrl->auth_state, HDCP_STATE_AUTHENTICATED);
kfifo_put(&ctrl->cmd_q, data->cmd);
wake_up(&ctrl->wait_q);
break;
case HDCP_TRANSPORT_CMD_STATUS_FAILED:
atomic_set(&ctrl->auth_state, HDCP_STATE_AUTH_FAIL);
kfifo_put(&ctrl->cmd_q, data->cmd);
kthread_park(ctrl->thread);
break;
default:
kfifo_put(&ctrl->cmd_q, data->cmd);
wake_up(&ctrl->wait_q);
break;
}
kfifo_put(&ctrl->cmd_q, data->cmd);
wake_up(&ctrl->wait_q);
exit:
return 0;
}
@@ -310,6 +314,8 @@ static int dp_hdcp2p2_authenticate(void *input)
ctrl->sink_status = SINK_CONNECTED;
atomic_set(&ctrl->auth_state, HDCP_STATE_AUTHENTICATING);
kthread_park(ctrl->thread);
kfifo_reset(&ctrl->cmd_q);
kthread_unpark(ctrl->thread);
cdata.context = input;