ARM: tegra: dc: fix deadlock on overlay wq flush
Jon Mayo [Thu, 31 Mar 2011 03:23:39 +0000 (20:23 -0700)]
dc lock is head while flush occurred, but functions called by workers need
take the dc lock to proceed.

Bug 807015

Original-Change-Id: Id30c5c768947f8f9959b01be3983761a18c5a1e5
Reviewed-on: http://git-master/r/24890
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>
Tested-by: Jonathan Mayo <jmayo@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Original-Change-Id: I6537018e03cfc354af9a7187d2fdd019cfe55960

Rebase-Id: Rc1c42255aef998f6741fe1484356a884479b8ec8

drivers/video/tegra/dc/dc.c

index 1099b87..9d65036 100644 (file)
@@ -1452,9 +1452,6 @@ static void _tegra_dc_controller_disable(struct tegra_dc *dc)
 {
        disable_irq(dc->irq);
 
-       if (dc->overlay)
-               tegra_overlay_disable(dc->overlay);
-
        if (dc->out_ops && dc->out_ops->disable)
                dc->out_ops->disable(dc);
 
@@ -1480,6 +1477,9 @@ static void _tegra_dc_disable(struct tegra_dc *dc)
 
 void tegra_dc_disable(struct tegra_dc *dc)
 {
+       if (dc->overlay)
+               tegra_overlay_disable(dc->overlay);
+
        mutex_lock(&dc->lock);
 
        if (dc->enabled) {
@@ -1766,6 +1766,9 @@ static int tegra_dc_suspend(struct nvhost_device *ndev, pm_message_t state)
 
        dev_info(&ndev->dev, "suspend\n");
 
+       if (dc->overlay)
+               tegra_overlay_disable(dc->overlay);
+
        mutex_lock(&dc->lock);
 
        if (dc->out_ops && dc->out_ops->suspend)