video: tegra: dsi: Soft reset if dsi host busy
Animesh Kishore [Wed, 15 Feb 2012 05:35:27 +0000 (10:35 +0530)]
If dsi host is unexpectedly busy, soft resetting
will restore controller state.

Bug 930453

Change-Id: I1bbce55d0b27a2be80a66218978e73c616e9d894
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/83986
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

Rebase-Id: Rc17a824344266d074c40d94484e6e15a3618d0e1

drivers/video/tegra/dc/dsi.c

index 1978a51..927a423 100644 (file)
@@ -1322,7 +1322,7 @@ static bool tegra_dsi_host_busy(struct tegra_dc_dsi_data *dsi)
                goto fail;
        }
 fail:
-       return err;
+       return (err < 0 ? true : false);
 }
 
 static void tegra_dsi_reset_underflow_overflow
@@ -1438,9 +1438,12 @@ static struct dsi_status *tegra_dsi_prepare_host_transmission(
        }
 
        if (tegra_dsi_host_busy(dsi)) {
-               err = -EBUSY;
-               dev_err(&dc->ndev->dev, "DSI host busy\n");
-               goto fail;
+               tegra_dsi_soft_reset(dsi);
+               if (tegra_dsi_host_busy(dsi)) {
+                       err = -EBUSY;
+                       dev_err(&dc->ndev->dev, "DSI host busy\n");
+                       goto fail;
+               }
        }
 
        tegra_dsi_reset_underflow_overflow(dsi);