video: tegra: dc: protect dc extension disabling with a lock
Nitin Kumbhar [Fri, 10 Feb 2012 09:40:45 +0000 (14:40 +0530)]
When dc gets many underflows, instances of reset worker can race
to perform reset. dc ext was getting disabled outside critical region
affecting display path. disable dc ext after getting the lock.

Bug 936545

Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/83108
(cherry picked from commit f9dcf7eee8ca8db28cee6fa9550044d1f746e843)

Change-Id: Ie29dc66eb52c9be472c2d0db8c0014bfe1837ad4
Reviewed-on: http://git-master/r/83406
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

drivers/video/tegra/dc/dc.c

index 7e61458..0756430 100644 (file)
@@ -2630,11 +2630,12 @@ static void tegra_dc_reset_worker(struct work_struct *work)
 
        unsigned long val = 0;
 
+       mutex_lock(&shared_lock);
+
        dev_warn(&dc->ndev->dev, "overlay stuck in underflow state.  resetting.\n");
 
        tegra_dc_ext_disable(dc->ext);
 
-       mutex_lock(&shared_lock);
        mutex_lock(&dc->lock);
 
        if (dc->enabled == false)