Skip to content

Commit

Permalink
OMAP: HDCP: Cancel pending start on disable/hpd drop
Browse files Browse the repository at this point in the history
We observed a race condition where userland invoked
an ioctl do blank/unblank the display while HDCP
was pending to start (but hadn't yet started).

The hdcp_irq_cb() wasn't cancelling that pending start.
This caused the hdcp state machine to start when it
shouldn't have been, interfering with the hpd state
machine's reading of EDID once the unblank happened.

The two state machines should really be unified at
some point.

Change-Id: Ief74d7eaa099f5455f6a42c65e98b965cdc50217
Signed-off-by: Mike J. Chen <[email protected]>
Signed-off-by: Ruslan Bilovol <[email protected]>
  • Loading branch information
mjchen0 authored and rmcc committed Jan 13, 2013
1 parent 5719b77 commit b2f4466
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/video/omap2/hdcp/hdcp_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,7 @@ static void hdcp_wq_authentication_failure(void)
hdcp_lib_set_av_mute(AV_MUTE_SET);
hdcp_lib_set_encryption(HDCP_ENC_OFF);

hdcp_cancel_work(&hdcp.pending_wq_event);

hdcp_lib_disable();
ddc.pending_disable = 0;
hdcp_wq_disable();

if (hdcp.retry_cnt && (hdcp.hdmi_state != HDMI_STOPPED)) {
if (hdcp.retry_cnt < HDCP_INFINITE_REAUTH) {
Expand Down Expand Up @@ -593,8 +590,12 @@ static void hdcp_irq_cb(int status)
ddc.pending_disable = 1; /* Used to exit on-going HDCP
* work */
hdcp.hpd_low = 0; /* Used to cancel HDCP works */
hdcp_lib_disable();
ddc.pending_disable = 0;
if (hdcp.pending_start) {
pr_err("cancelling work for pending start\n");
hdcp_cancel_work(&hdcp.pending_start);
}
hdcp_wq_disable();

/* In case of HDCP_STOP_FRAME_EVENT, HDCP stop
* frame callback is blocked and waiting for
* HDCP driver to finish accessing the HW
Expand Down

0 comments on commit b2f4466

Please sign in to comment.