From dd8b7deaf7441c8b828a01b7567d9d5fa3757385 Mon Sep 17 00:00:00 2001 From: Carsten Valdemar Munk Date: Wed, 15 Dec 2010 09:33:26 -0500 Subject: [PATCH] gpu: pvr: dump process info at HW recovery reset Print process ID and command name during HW recovery reset. Based on a patch from Mark Underwood . Forward port to 2.6.35 Signed-off-by: Imre Deak Signed-off-by: Carsten Munk --- pvr/sgxinit.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pvr/sgxinit.c b/pvr/sgxinit.c index 26eb61e..439e8c0 100644 --- a/pvr/sgxinit.c +++ b/pvr/sgxinit.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "sgxdefs.h" #include "sgxmmu.h" @@ -41,6 +42,7 @@ #include "sysconfig.h" #include "pvr_bridge_km.h" #include "sgx_bridge_km.h" +#include "resman.h" #include "pdump_km.h" #include "ra.h" @@ -618,6 +620,32 @@ static void dump_edm(struct PVRSRV_SGXDEV_INFO *psDevInfo) static void dump_edm(struct PVRSRV_SGXDEV_INFO *psDevInfo) {} #endif +static void dump_process_info(struct PVRSRV_DEVICE_NODE *dev) +{ + struct PVRSRV_SGXDEV_INFO *dev_info = dev->pvDevice; + u32 page_dir = readl(dev_info->pvRegsBaseKM + + EUR_CR_BIF_DIR_LIST_BASE0); + struct BM_CONTEXT *bm_ctx; + struct RESMAN_CONTEXT *res_ctx = NULL; + + bm_ctx = bm_find_context(dev->sDevMemoryInfo.pBMContext, page_dir); + if (bm_ctx) + res_ctx = pvr_get_resman_ctx(bm_ctx); + + if (res_ctx) { + struct task_struct *tsk; + struct PVRSRV_PER_PROCESS_DATA *proc; + int pid; + + proc = pvr_get_proc_by_ctx(res_ctx); + pid = proc->ui32PID; + rcu_read_lock(); + tsk = pid_task(find_vpid(pid), PIDTYPE_PID); + pr_err("PID = %d, process name = %s\n", pid, tsk->comm); + rcu_read_unlock(); + } +} + static void dump_sgx_registers(struct PVRSRV_SGXDEV_INFO *psDevInfo) { pr_err("EVENT_STATUS = 0x%08X\n" @@ -667,6 +695,7 @@ void HWRecoveryResetSGX(struct PVRSRV_DEVICE_NODE *psDeviceNode, pr_err("HWRecoveryResetSGX: SGX Hardware Recovery triggered\n"); + dump_process_info(psDeviceNode); dump_sgx_registers(psDevInfo); dump_edm(psDevInfo); -- 2.39.5