Resolve potential race between resume and reset
Fix wmb after return
Change-Id: I98ad1e713b9781d780bf93561496011bf62b86d1
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
dc->out->enable();
tegra_dc_setup_clk(dc, dc->clk);
-
+ tegra_periph_reset_assert(dc->clk);
clk_enable(dc->clk);
clk_enable(dc->emc_clk);
tegra_periph_reset_deassert(dc->clk);
dev_warn(&dc->ndev->dev, "overlay stuck in underflow state. resetting.\n");
mutex_lock(&dc->lock);
- _tegra_dc_disable(dc);
-
- msleep(100);
- tegra_periph_reset_assert(dc->clk);
-
- /* _tegra_dc_enable deasserts reset */
- _tegra_dc_enable(dc);
+ if (dc->enabled && !dc->suspended) {
+ _tegra_dc_disable(dc);
+ /* _tegra_dc_enable deasserts reset */
+ _tegra_dc_enable(dc);
+ }
mutex_unlock(&dc->lock);
}
static inline bool nvhdcp_set_plugged(struct tegra_nvhdcp *nvhdcp, bool plugged)
{
- return nvhdcp->plugged = plugged;
+ nvhdcp->plugged = plugged;
wmb();
+ return plugged;
}
static int nvhdcp_i2c_read(struct tegra_nvhdcp *nvhdcp, u8 reg,