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>
This commit is contained in:
Jie Zhou
2010-07-23 19:53:12 +08:00
committed by Matt Sealey
parent 3b85c4eade
commit 4bb70f55fc
3 changed files with 20 additions and 4 deletions

View File

@@ -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 );

View File

@@ -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
{

View File

@@ -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;