summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJie Zhou <b30303@freescale.com>2010-07-23 19:53:12 +0800
committerDennis Wenzel <b21659@freescale.com>2010-07-23 11:24:32 -0500
commit41e77b3a969545071232c2aadb696e48ead7bf55 (patch)
tree5809e6c54759da9dd115eede1af384e4d40b32a2 /drivers
parentf9d77737b87700e8b8c428a47658cd931b08ca43 (diff)
ENGR00125434 GPU: Fix kernel oops when run ES2.0 conf. test for second time
memstore should be freed properly. a following change will be prepared to improve the alloc/free logic for device memstore. Signed-off-by: Jie Zhou <b30303@freescale.com> Acked-by: Rob Herring <r.herring@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_device.c8
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_g12.c4
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_sharedmem.c12
3 files changed, 20 insertions, 4 deletions
diff --git a/drivers/mxc/amd-gpu/common/gsl_device.c b/drivers/mxc/amd-gpu/common/gsl_device.c
index 9ebe2abe78b0..bc2a427470ed 100644
--- a/drivers/mxc/amd-gpu/common/gsl_device.c
+++ b/drivers/mxc/amd-gpu/common/gsl_device.c
@@ -18,7 +18,9 @@
#include "gsl.h"
#include "gsl_hal.h"
-
+#ifdef _LINUX
+#include <linux/sched.h>
+#endif
//////////////////////////////////////////////////////////////////////////////
// inline functions
@@ -174,7 +176,7 @@ kgsl_device_close(gsl_device_t *device)
// DumpX allocates memstore from MMU aperture
if (device->memstore.hostptr && !(gsl_driver.flags_debug & GSL_DBGFLAGS_DUMPX))
{
- kgsl_sharedmem_free0(&device->memstore, GSL_CALLER_PROCESSID_GET());
+ //kgsl_sharedmem_free0(&device->memstore, GSL_CALLER_PROCESSID_GET());
}
#ifndef _LINUX
@@ -185,6 +187,8 @@ kgsl_device_close(gsl_device_t *device)
kos_event_destroy( device->timestamp_event );
device->timestamp_event = 0;
}
+#else
+ wake_up_interruptible_all(&(device->timestamp_waitq));
#endif
kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE, "<-- kgsl_device_close. Return value %B\n", status );
diff --git a/drivers/mxc/amd-gpu/common/gsl_g12.c b/drivers/mxc/amd-gpu/common/gsl_g12.c
index 7c85e39941c3..513f6728a842 100644
--- a/drivers/mxc/amd-gpu/common/gsl_g12.c
+++ b/drivers/mxc/amd-gpu/common/gsl_g12.c
@@ -950,7 +950,11 @@ static void irq_thread(void)
#endif
/* Notify timestamp event */
+#ifndef _LINUX
kos_event_signal( device->timestamp_event );
+#else
+ wake_up_interruptible_all(&(device->timestamp_waitq));
+#endif
}
else
{
diff --git a/drivers/mxc/amd-gpu/common/gsl_sharedmem.c b/drivers/mxc/amd-gpu/common/gsl_sharedmem.c
index 2892668d7c45..51e66f97c52e 100644
--- a/drivers/mxc/amd-gpu/common/gsl_sharedmem.c
+++ b/drivers/mxc/amd-gpu/common/gsl_sharedmem.c
@@ -482,8 +482,16 @@ kgsl_sharedmem_read0(const gsl_memdesc_t *memdesc, void *dst, unsigned int offse
KOS_ASSERT(dst);
KOS_ASSERT(sizebytes);
- KOS_ASSERT(memdesc->gpuaddr >= shmem->apertures[aperture_index].memarena->gpubaseaddr);
- KOS_ASSERT((memdesc->gpuaddr + sizebytes) <= (shmem->apertures[aperture_index].memarena->gpubaseaddr + shmem->apertures[aperture_index].memarena->sizebytes));
+
+ if (memdesc->gpuaddr < shmem->apertures[aperture_index].memarena->gpubaseaddr)
+ {
+ return (GSL_FAILURE_BADPARAM);
+ }
+
+ if (memdesc->gpuaddr + sizebytes > shmem->apertures[aperture_index].memarena->gpubaseaddr + shmem->apertures[aperture_index].memarena->sizebytes)
+ {
+ return (GSL_FAILURE_BADPARAM);
+ }
gpuoffsetbytes = (memdesc->gpuaddr - shmem->apertures[aperture_index].memarena->gpubaseaddr) + offsetbytes;