From 3ce95ac68e741d3656bdd9e4a141a37e988bd981 Mon Sep 17 00:00:00 2001 From: Sankeerth Billakanti Date: Sun, 8 Dec 2019 07:05:36 +0530 Subject: [PATCH] disp: msm: dp: update min_enc_level only if link is authenticated The min_enc_lvl update is asynchronous to the hdcp2x state machine and can come anytime. In an instance where authentication with the sink is continuously failing, the enforce engine blocks the hdcp22 secure content playback and resets the min enc lvl. This is causing the sde_hdcp_2x_main to perform a send message operation out of sync with the current authentication attempt. This is causing the state machine to go into bad state by changing the next message id, sometimes causing a pagefault error in the sde_hdcp_2x_main while cp_irq is in progress. This change will proceed with the min_enc_lvl change only when the mainlink is hdcp2p2 authenticated. Change-Id: I977ac3a083b9593f8f7e760d4e477d4af424d5c9 Signed-off-by: Sankeerth Billakanti Signed-off-by: Tatenda Chipeperekwa --- msm/dp/dp_hdcp2p2.c | 5 ----- msm/sde_hdcp_2x.c | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/msm/dp/dp_hdcp2p2.c b/msm/dp/dp_hdcp2p2.c index bc2a25413965..ad1d0a6003a2 100644 --- a/msm/dp/dp_hdcp2p2.c +++ b/msm/dp/dp_hdcp2p2.c @@ -346,11 +346,6 @@ static void dp_hdcp2p2_min_level_change(void *client_ctx, return; } - if (!dp_hdcp2p2_is_valid_state(ctrl)) { - DP_ERR("invalid state\n"); - return; - } - cdata.context = ctrl->lib_ctx; cdata.min_enc_level = min_enc_level; dp_hdcp2p2_wakeup_lib(ctrl, &cdata); diff --git a/msm/sde_hdcp_2x.c b/msm/sde_hdcp_2x.c index 28cf474b3a79..30db5cb70c36 100644 --- a/msm/sde_hdcp_2x.c +++ b/msm/sde_hdcp_2x.c @@ -904,8 +904,10 @@ static int sde_hdcp_2x_wakeup(struct sde_hdcp_2x_wakeup_data *data) break; case HDCP_2X_CMD_MIN_ENC_LEVEL: hdcp->min_enc_level = data->min_enc_level; - kfifo_put(&hdcp->cmd_q, data->cmd); - wake_up(&hdcp->wait_q); + if (hdcp->authenticated) { + kfifo_put(&hdcp->cmd_q, data->cmd); + wake_up(&hdcp->wait_q); + } break; default: kfifo_put(&hdcp->cmd_q, data->cmd);