HACK: gfx: pvr: Don't try to complete SGX commands in atomic context
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 9 Mar 2012 15:26:07 +0000 (17:26 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:30:32 +0000 (12:30 +0300)
SGXCommandComplete() may be called while holding a spinlock. In such
cases we want to defer the command completion to the MISR. As a quick
non-intrusive hack, add a simple in_atomic() check to
SGXCommandComplete() to make that happen. Obviously this only works
with CONFIG_PREEMPT kernels.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c

index f797da5..ee17d04 100644 (file)
@@ -86,7 +86,7 @@ PVRSRV_ERROR SGXResetPDump(PVRSRV_DEVICE_NODE *psDeviceNode);
 static IMG_VOID SGXCommandComplete(PVRSRV_DEVICE_NODE *psDeviceNode)
 {
 #if defined(OS_SUPPORTS_IN_LISR)
-       if (OSInLISR(psDeviceNode->psSysData))
+       if (OSInLISR(psDeviceNode->psSysData) || in_atomic())
        {
                
                psDeviceNode->bReProcessDeviceCommandComplete = IMG_TRUE;