gpu: pvr: fix locking around HWRecoveryResetSGX
authorImre Deak <imre.deak@nokia.com>
Tue, 3 Aug 2010 10:40:32 +0000 (13:40 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:41 +0000 (21:09 +0300)
On the MISR / HW recovery path the pvr_dev_lock was taken twice
leading to a dead-lock. This regression was introduced by commit
ec53aaa940a4e40786eb7512b6a46ce347c95303.

Spotted-by: Luc Verhaegen <luc.verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/sgxinit.c

index 35f3d5f..10dbc5a 100644 (file)
@@ -678,8 +678,6 @@ void HWRecoveryResetSGX(struct PVRSRV_DEVICE_NODE *psDeviceNode)
 
        BUG_ON(!pvr_is_locked());
 
-       pvr_dev_lock();
-
        l = readl(&psSGXHostCtl->ui32InterruptClearFlags);
        l |= PVRSRV_USSE_EDM_INTERRUPT_HWR;
        writel(l, &psSGXHostCtl->ui32InterruptClearFlags);
@@ -713,8 +711,6 @@ void HWRecoveryResetSGX(struct PVRSRV_DEVICE_NODE *psDeviceNode)
 
        SGXScheduleProcessQueues(psDeviceNode);
 
-       pvr_dev_unlock();
-
        PVRSRVProcessQueues(IMG_TRUE);
 }
 
@@ -789,9 +785,9 @@ static void SGXOSTimer(struct work_struct *work)
                l = readl(&psSGXHostCtl->ui32HostDetectedLockups);
                l++;
                writel(l, &psSGXHostCtl->ui32HostDetectedLockups);
-               pvr_dev_unlock();
 
                HWRecoveryResetSGX(psDeviceNode);
+               pvr_dev_unlock();
        }
 
        queue_delayed_work(data->work_queue, &data->work,