]> git.openpandora.org Git - sgx.git/commitdiff
gpu: pvr: bail out from SGXOSTimer if it's been canceled
authorImre Deak <imre.deak@nokia.com>
Wed, 31 Mar 2010 14:53:20 +0000 (17:53 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:40 +0000 (21:09 +0300)
At the moment cancelling the timer is done in a synchronous way, so
we don't need to have the extra check. But a later patch will add
additional locking around the HW interrupt from where the timer can
be cancelled as well. Because of lock dependency issues described
in that patch we have to switch to an asynchronous way of cancelling
this timer and it means we need to have the extra check.

Also reset the flag indicating that the timer is cancelled when
destroying it. Currently we are both cancelling and destroying the
timer, but we really should just require calling the destroy function.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/sgxinit.c

index 3d0925086afa7adc21d33912b10d39d73eb2bdc6..d00cf764e05a6b9953966503c0be2878b0e0e82d 100644 (file)
@@ -704,6 +704,9 @@ static void SGXOSTimer(struct work_struct *work)
        IMG_BOOL bPoweredDown;
        enum PVRSRV_ERROR eError;
 
+       if (!data->armed)
+               return;
+
        psDevInfo->ui32TimeStamp++;
 
        eError = PVRSRVPowerLock(TIMER_ID, IMG_FALSE);
@@ -795,6 +798,7 @@ SGXOSTimerInit(struct PVRSRV_DEVICE_NODE *psDeviceNode)
 
 void SGXOSTimerDeInit(struct timer_work_data *data)
 {
+       data->armed = false;
        destroy_workqueue(data->work_queue);
        kfree(data);
 }
@@ -818,8 +822,8 @@ enum PVRSRV_ERROR SGXOSTimerCancel(struct timer_work_data *data)
        if (!data)
                return PVRSRV_ERROR_GENERIC;
 
-       cancel_delayed_work_sync(&data->work);
        data->armed = false;
+       cancel_delayed_work_sync(&data->work);
 
        return PVRSRV_OK;
 }