err = PVRSRVSetDevicePowerStateKM(dev_node->sDevId.ui32DeviceIndex,
PVRSRV_DEV_POWER_STATE_ON,
- KERNEL_ID, IMG_FALSE);
+ KERNEL_ID, IMG_TRUE);
if (err != PVRSRV_OK)
return -EIO;
- HWRecoveryResetSGX(dev_node, 0, KERNEL_ID);
+ HWRecoveryResetSGXNoLock(dev_node);
+ PVRSRVPowerUnlock(KERNEL_ID);
/* power down if no activity */
SGXTestActivePowerEvent(dev_node, KERNEL_ID);
}
-IMG_VOID HWRecoveryResetSGX (PVRSRV_DEVICE_NODE *psDeviceNode,
- IMG_UINT32 ui32Component,
- IMG_UINT32 ui32CallerID)
+IMG_VOID HWRecoveryResetSGXNoLock(PVRSRV_DEVICE_NODE *psDeviceNode)
{
PVRSRV_ERROR eError;
PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO*)psDeviceNode->pvDevice;
SGXMKIF_HOST_CTL *psSGXHostCtl = (SGXMKIF_HOST_CTL *)psDevInfo->psSGXHostCtl;
- PVR_UNREFERENCED_PARAMETER(ui32Component);
-
-
-
- eError = PVRSRVPowerLock(ui32CallerID, IMG_FALSE);
- if(eError != PVRSRV_OK)
- {
-
-
-
- PVR_DPF((PVR_DBG_WARNING,"HWRecoveryResetSGX: Power transition in progress"));
- return;
- }
-
psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_HWR;
PVR_LOG(("HWRecoveryResetSGX: SGX Hardware Recovery triggered"));
PDUMPRESUME();
+}
+
+IMG_VOID HWRecoveryResetSGX(PVRSRV_DEVICE_NODE *psDeviceNode,
+ IMG_UINT32 ui32Component,
+ IMG_UINT32 ui32CallerID)
+{
+ PVRSRV_ERROR eError;
+ PVRSRV_SGXDEV_INFO *sgx_info;
+
+ PVR_UNREFERENCED_PARAMETER(ui32Component);
+
+ sgx_info = psDeviceNode->pvDevice;
+ eError = PVRSRVPowerLock(ui32CallerID, IMG_FALSE);
+ if (eError != PVRSRV_OK) {
+ pr_warn("pvr: %s: power transition in progress", __func__);
+
+ return;
+ }
+
+ HWRecoveryResetSGXNoLock(psDeviceNode);
+
PVRSRVPowerUnlock(ui32CallerID);
-
SGXScheduleProcessQueuesKM(psDeviceNode);
-
-
-
PVRSRVProcessQueues(ui32CallerID, IMG_TRUE);
}
-
#if defined(SUPPORT_HW_RECOVERY)
IMG_VOID SGXOSTimer(IMG_VOID *pvData)
{