(u32) schedule_timeout((s32) ui32TimeOutJiffies);
pvr_lock();
+
+ if (pvr_is_disabled()) {
+ ui32TimeOutJiffies = 1;
+ break;
+ }
#if defined(CONFIG_PVR_DEBUG_EXTRA)
psLinuxEventObject->ui32Stats++;
#endif
pvr_lock();
+ if (pvr_is_disabled()) {
+ ret = -ENODEV;
+ goto err_unlock;
+ }
+
pid = OSGetCurrentProcessIDKM();
if (PVRSRVProcessConnect(pid) != PVRSRV_OK)
DEFINE_MUTEX(gPVRSRVLock);
int pvr_dvfs_active;
DECLARE_WAIT_QUEUE_HEAD(pvr_dvfs_wq);
+int pvr_disabled;
/*
* The pvr_dvfs_* interface is needed to suppress a lockdep warning in
pvr_lock();
+ if (pvr_is_disabled()) {
+ pvr_unlock();
+ return -ENODEV;
+ }
+
if (!OSAccessOK(PVR_VERIFY_WRITE, psBridgePackageUM,
sizeof(struct PVRSRV_BRIDGE_PACKAGE))) {
PVR_DPF(PVR_DBG_ERROR,
extern int pvr_dvfs_active;
extern struct mutex gPVRSRVLock;
extern wait_queue_head_t pvr_dvfs_wq;
+extern int pvr_disabled;
void pvr_dvfs_wait_active(void);
return mutex_is_locked(&gPVRSRVLock);
}
+static inline void pvr_disable(void)
+{
+ pvr_disabled = 1;
+}
+
+static inline int pvr_is_disabled(void)
+{
+ return unlikely(pvr_disabled);
+}
+
enum PVRSRV_ERROR LinuxBridgeInit(void);
void LinuxBridgeDeInit(void);
pvr_lock();
+ if (pvr_is_disabled()) {
+ r = -ENODEV;
+ goto exit;
+ }
+
node = get_sgx_node();
if (!node) {
r = -ENODEV;
pvr_lock();
+ if (pvr_is_disabled()) {
+ pvr_unlock();
+ return;
+ }
+
psDeviceNode = psSysData->psDeviceNodeList;
while (psDeviceNode != NULL) {
if (psDeviceNode->pfnDeviceMISR != NULL)
struct SGXMKIF_HOST_CTL __iomem *psSGXHostCtl =
psDevInfo->psSGXHostCtl;
u32 l;
+ int max_retries = 10;
BUG_ON(!pvr_is_locked());
l |= PVRSRV_USSE_EDM_INTERRUPT_HWR;
writel(l, &psSGXHostCtl->ui32InterruptClearFlags);
- pr_err("HWRecoveryResetSGX: SGX Hardware Recovery triggered\n");
+ pr_err("%s: SGX Hardware Recovery triggered\n", __func__);
dump_process_info(psDeviceNode);
dump_sgx_registers(psDevInfo);
do {
eError = SGXInitialise(psDevInfo, IMG_TRUE);
- } while (eError == PVRSRV_ERROR_RETRY);
- if (eError != PVRSRV_OK)
- PVR_DPF(PVR_DBG_ERROR,
- "HWRecoveryResetSGX: SGXInitialise failed (%d)",
- eError);
+ if (eError != PVRSRV_ERROR_RETRY)
+ break;
+ } while (max_retries--);
+
+ if (eError != PVRSRV_OK) {
+ pr_err("%s: recovery failed (%d). Disabling the driver",
+ __func__, eError);
+ pvr_disable();
+
+ PDUMPRESUME();
+
+ return;
+ }
PDUMPRESUME();
IMG_BOOL bPoweredDown;
pvr_lock();
- if (!data->armed) {
+
+ if (!data->armed || pvr_is_disabled()) {
pvr_unlock();
return;
}
container_of(d_work, struct ENV_DATA, sPerfWork);
pvr_lock();
+
+ if (pvr_is_disabled()) {
+ pvr_unlock();
+ return;
+ }
+
load = sgx_current_load();
+
pvr_unlock();
+
if (load) {
vdd1 = 500000000;
vdd2 = 400000;