summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2014-12-17 17:55:18 +0800
committerXianzhong <b07117@freescale.com>2014-12-18 16:19:22 +0800
commitef2d77d12455d2d0c544a10df3f8fd16e7accfeb (patch)
treeda118c3e9b6c3535b77fb32a111b6af6c294fad7 /drivers
parent5a7ab47e67d1045cb2f5d408c112617dff48dee2 (diff)
MGS-374 [#1500] fix GPU kernel debugfs crash issue
this crash issue is caused by kernel NULL pointer when access GPU database, GPU database is shared by all kernels, it can be queried with any valid kernel. this patch will find the valid kernel pointer to avoid GPU kernel crash. the crash backtrace with 'cat /sys/kernel/debug/gc/vidmem' on i.mx6sl: [<80480600>] (gckKERNEL_FindDatabase+0x8/0xec) from [<80478db0>] (vidmem_show+0x2c/0x60) [<80478db0>] (vidmem_show+0x2c/0x60) from [<800e4d5c>] (seq_read+0x1dc/0x47c) [<800e4d5c>] (seq_read+0x1dc/0x47c) from [<800c7164>] (vfs_read+0x98/0x144) [<800c7164>] (vfs_read+0x98/0x144) from [<800c77c4>] (SyS_read+0x3c/0x78) [<800c77c4>] (SyS_read+0x3c/0x78) from [<8000e080>] (ret_fast_syscall+0x0/0x30) Date: Dec 18, 2014 Signed-off-by: Xianzhong <b07117@freescale.com> Acked-by: Jason Liu (cherry picked from commit 5b59e9d67ee1ce25e43fcb8934fcf0c75abfd0e3)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c
index 9a6bc97e4fad..35b125f28e92 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c
@@ -826,13 +826,21 @@ _ShowCounters(
_PrintCounter(file, &database->mapMemory, "mapMemory");
}
+gckKERNEL
+_GetValidKernel(
+ gckGALDEVICE Device
+);
static int vidmem_show(struct seq_file *file, void *unused)
{
gceSTATUS status;
gcsDATABASE_PTR database;
gckGALDEVICE device = file->private;
- gckKERNEL kernel = device->kernels[gcvCORE_MAJOR];
+ gckKERNEL kernel = _GetValidKernel(device);
+ if(kernel == gcvNULL)
+ {
+ return 0;
+ }
/* Find the database. */
gcmkONERROR(