From a4d97ee181b3f5acedf9b43f6d5a7e796d4713f3 Mon Sep 17 00:00:00 2001 From: Jeremy Gebben Date: Tue, 13 Dec 2011 16:14:17 -0700 Subject: [PATCH] msm: kgsl: in postmortem, log powerstate before changing it Change-Id: I9b6533acbe99c5094d51ac4fb12a23a280cc07c7 Signed-off-by: Jeremy Gebben --- drivers/gpu/msm/adreno_postmortem.c | 40 +++++++++++++---------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/msm/adreno_postmortem.c b/drivers/gpu/msm/adreno_postmortem.c index c6b850e7986..9e49e6ac188 100644 --- a/drivers/gpu/msm/adreno_postmortem.c +++ b/drivers/gpu/msm/adreno_postmortem.c @@ -470,23 +470,8 @@ static int adreno_dump(struct kgsl_device *device) struct adreno_device *adreno_dev = ADRENO_DEVICE(device); - struct kgsl_pwrctrl *pwr = &device->pwrctrl; - mb(); - KGSL_LOG_DUMP(device, "POWER: FLAGS = %08lX | ACTIVE POWERLEVEL = %08X", - pwr->power_flags, pwr->active_pwrlevel); - - KGSL_LOG_DUMP(device, "POWER: INTERVAL TIMEOUT = %08X ", - pwr->interval_timeout); - - KGSL_LOG_DUMP(device, "GRP_CLK = %lu ", - kgsl_get_clkrate(pwr->grp_clks[0])); - - KGSL_LOG_DUMP(device, "BUS CLK = %lu ", - kgsl_get_clkrate(pwr->ebi1_clk)); - - kgsl_regread(device, REG_RBBM_STATUS, &rbbm_status); kgsl_regread(device, REG_RBBM_PM_OVERRIDE1, &r2); kgsl_regread(device, REG_RBBM_PM_OVERRIDE2, &r3); @@ -810,6 +795,7 @@ end: int adreno_postmortem_dump(struct kgsl_device *device, int manual) { bool saved_nap; + struct kgsl_pwrctrl *pwr = &device->pwrctrl; BUG_ON(device == NULL); @@ -828,9 +814,26 @@ int adreno_postmortem_dump(struct kgsl_device *device, int manual) kgsl_idle(device, KGSL_TIMEOUT_DEFAULT); } + KGSL_LOG_DUMP(device, "POWER: FLAGS = %08lX | ACTIVE POWERLEVEL = %08X", + pwr->power_flags, pwr->active_pwrlevel); + + KGSL_LOG_DUMP(device, "POWER: INTERVAL TIMEOUT = %08X ", + pwr->interval_timeout); + + KGSL_LOG_DUMP(device, "GRP_CLK = %lu ", + kgsl_get_clkrate(pwr->grp_clks[0])); + + KGSL_LOG_DUMP(device, "BUS CLK = %lu ", + kgsl_get_clkrate(pwr->ebi1_clk)); + /* Disable the idle timer so we don't get interrupted */ del_timer_sync(&device->idle_timer); + mutex_unlock(&device->mutex); + flush_workqueue(device->work_queue); + mutex_lock(&device->mutex); + adreno_dump(device); + /* Turn off napping to make sure we have the clocks full attention through the following process */ saved_nap = device->pwrctrl.nap_allowed; @@ -852,13 +855,6 @@ int adreno_postmortem_dump(struct kgsl_device *device, int manual) device->id); } - KGSL_DRV_ERR(device, - "wait for work in workqueue to complete\n"); - mutex_unlock(&device->mutex); - flush_workqueue(device->work_queue); - mutex_lock(&device->mutex); - adreno_dump(device); - /* Restore nap mode */ device->pwrctrl.nap_allowed = saved_nap;