Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29dff02f authored by Aravind Venkateswaran's avatar Aravind Venkateswaran
Browse files

msm: mdss: hdmi: Clear and disable interrupts when HDCP is inactive



When an HDCP interrupt is received while the HDCP session is
inactive, ensure that the interrupt it acknowledged and cleared
to avoid any potential interrupt storms.

Change-Id: Id297cb9a7d08a094727c966cf48966a6a37bb1f0
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
parent 745417f2
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@
#define HDCP_KEYS_STATE_PROD_AKSV	6
#define HDCP_KEYS_STATE_RESERVED	7

#define HDCP_INT_CLR (BIT(1) | BIT(5) | BIT(7) | BIT(9) | BIT(13))

struct hdmi_hdcp_ctrl {
	u32 auth_retries;
	u32 tp_msgid;
@@ -1139,16 +1141,15 @@ void hdmi_hdcp_off(void *input)
	}

	/*
	 * Need to set the state to inactive here so that any ongoing
	 * reauth works will know that the HDCP session has been turned off
	 * Disable HDCP interrupts.
	 * Also, need to set the state to inactive here so that any ongoing
	 * reauth works will know that the HDCP session has been turned off.
	 */
	mutex_lock(hdcp_ctrl->init_data.mutex);
	DSS_REG_W(io, HDMI_HDCP_INT_CTRL, 0);
	hdcp_ctrl->hdcp_state = HDCP_STATE_INACTIVE;
	mutex_unlock(hdcp_ctrl->init_data.mutex);

	/* Disable HDCP interrupts */
	DSS_REG_W(io, HDMI_HDCP_INT_CTRL, 0);

	/*
	 * Cancel any pending auth/reauth attempts.
	 * If one is ongoing, this will wait for it to finish.
@@ -1193,7 +1194,7 @@ int hdmi_hdcp_isr(void *input)
	if (HDCP_STATE_INACTIVE == hdcp_ctrl->hdcp_state) {
		DEV_ERR("%s: HDCP inactive. Just clear int and return.\n",
			__func__);
		DSS_REG_W(io, HDMI_HDCP_INT_CTRL, hdcp_int_val);
		DSS_REG_W(io, HDMI_HDCP_INT_CTRL, HDCP_INT_CLR);
		return 0;
	}