diff options
author | Donghan Ryu <dryu@nvidia.com> | 2011-07-28 07:43:01 +0900 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:57 -0800 |
commit | 6cfeb5888e968d0b8d215946319f8efc6250ea61 (patch) | |
tree | 4fe978699cce712c1865efd5e2d47ec8a906b939 /drivers/video/tegra/dc/nvhdcp.c | |
parent | 4643b4894e3d56c62fc63b118027a35f7a96f598 (diff) |
video: tegra: dc: use a delayed_work on hdcp
hdmi modeset triggers to re-start hdcp and trying to negotiate
too early can cause HDCP failure. using delayed_work can avoid
this situation by starting HDCP a little bit late
Bug 855002
Original-Change-Id: Ic54a6f156845d911e2631b755284362026474012
Reviewed-on: http://git-master/r/43694
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Tested-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>
Rebase-Id: R353eadbf83e4ee9bb6dd280898eccaaccc021d1a
Diffstat (limited to 'drivers/video/tegra/dc/nvhdcp.c')
-rw-r--r-- | drivers/video/tegra/dc/nvhdcp.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/video/tegra/dc/nvhdcp.c b/drivers/video/tegra/dc/nvhdcp.c index acf7694b881e..bac87781bb9d 100644 --- a/drivers/video/tegra/dc/nvhdcp.c +++ b/drivers/video/tegra/dc/nvhdcp.c @@ -75,7 +75,7 @@ enum tegra_nvhdcp_state { }; struct tegra_nvhdcp { - struct work_struct work; + struct delayed_work work; struct tegra_dc_hdmi_data *hdmi; struct workqueue_struct *downstream_wq; struct mutex lock; @@ -828,7 +828,7 @@ static int get_repeater_info(struct tegra_nvhdcp *nvhdcp) static void nvhdcp_downstream_worker(struct work_struct *work) { struct tegra_nvhdcp *nvhdcp = - container_of(work, struct tegra_nvhdcp, work); + container_of(to_delayed_work(work), struct tegra_nvhdcp, work); struct tegra_dc_hdmi_data *hdmi = nvhdcp->hdmi; int e; u8 b_caps; @@ -1010,13 +1010,10 @@ failure: nvhdcp_err("nvhdcp failure - too many failures, giving up!\n"); } else { nvhdcp_err("nvhdcp failure - renegotiating in 1.75 seconds\n"); - mutex_unlock(&nvhdcp->lock); - wait_event_interruptible_timeout(wq_worker, - !nvhdcp_is_plugged(nvhdcp), msecs_to_jiffies(1750)); - mutex_lock(&nvhdcp->lock); if (!nvhdcp_is_plugged(nvhdcp)) goto lost_hdmi; - queue_work(nvhdcp->downstream_wq, &nvhdcp->work); + queue_delayed_work(nvhdcp->downstream_wq, &nvhdcp->work, + msecs_to_jiffies(1750)); } lost_hdmi: @@ -1038,7 +1035,8 @@ static int tegra_nvhdcp_on(struct tegra_nvhdcp *nvhdcp) nvhdcp->state = STATE_UNAUTHENTICATED; if (nvhdcp_is_plugged(nvhdcp)) { nvhdcp->fail_count = 0; - queue_work(nvhdcp->downstream_wq, &nvhdcp->work); + queue_delayed_work(nvhdcp->downstream_wq, &nvhdcp->work, + msecs_to_jiffies(100)); } return 0; } @@ -1231,7 +1229,7 @@ struct tegra_nvhdcp *tegra_nvhdcp_create(struct tegra_dc_hdmi_data *hdmi, nvhdcp->state = STATE_UNAUTHENTICATED; nvhdcp->downstream_wq = create_singlethread_workqueue(nvhdcp->name); - INIT_WORK(&nvhdcp->work, nvhdcp_downstream_worker); + INIT_DELAYED_WORK(&nvhdcp->work, nvhdcp_downstream_worker); nvhdcp->miscdev.minor = MISC_DYNAMIC_MINOR; nvhdcp->miscdev.name = nvhdcp->name; |