drivers: video: tegra: Fix race condition
Aly Hirani [Thu, 7 Jan 2016 22:18:28 +0000 (14:18 -0800)]
Re-reading tegra_dc_hpd() in the controller_enable() causes a race
condition. By the time controller_enable is called, tegra_dc_hpd() might
be false.

Instead, the correct way is to tie the hdcp state to the
controller_enable and controller_disable and hence, force enable hdcp.

Bug 1717496

Change-Id: Ie05de9c555ef6254f6877aeb35c970997a3d3d16
Signed-off-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-on: http://git-master/r/930172
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

drivers/video/tegra/dc/hdmi2.0.c

index 3421565..ce39b43 100644 (file)
@@ -1792,7 +1792,7 @@ static int tegra_hdmi_controller_enable(struct tegra_hdmi *hdmi)
 
        tegra_hdmi_config_clk(hdmi, TEGRA_HDMI_BRICK_CLK);
        tegra_dc_sor_attach(sor);
-       tegra_nvhdcp_set_plug(hdmi->nvhdcp, tegra_dc_hpd(dc));
+       tegra_nvhdcp_set_plug(hdmi->nvhdcp, true);
 
        tegra_dc_setup_clk(dc, dc->clk);
        tegra_dc_hdmi_setup_clk(dc, hdmi->sor->sor_clk);