mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
msm: kgsl: Use readl_poll_timeout() for crashdumper status
Crashdumper required sometime to finish all register dumps. Hence add minimum 100msec sleep time before we start polling on crashdumper completion. Use readl_poll_timeout() for crashdumper completion check to reduce AHB traffic. Change-Id: I112466e67760f26e73e7c8a69bf466ce8b8ef09b Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
This commit is contained in:
parent
5168327a4f
commit
9dc72d9f38
1 changed files with 15 additions and 11 deletions
|
|
@ -3,6 +3,8 @@
|
|||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/iopoll.h>
|
||||
|
||||
#include "adreno.h"
|
||||
#include "adreno_a6xx.h"
|
||||
#include "adreno_snapshot.h"
|
||||
|
|
@ -1564,8 +1566,8 @@ static size_t a6xx_snapshot_sqe(struct kgsl_device *device, u8 *buf,
|
|||
|
||||
static void _a6xx_do_crashdump(struct kgsl_device *device)
|
||||
{
|
||||
unsigned long wait_time;
|
||||
unsigned int reg = 0;
|
||||
u32 val = 0;
|
||||
int ret;
|
||||
|
||||
crash_dump_valid = false;
|
||||
|
||||
|
|
@ -1590,19 +1592,21 @@ static void _a6xx_do_crashdump(struct kgsl_device *device)
|
|||
upper_32_bits(a6xx_capturescript->gpuaddr));
|
||||
kgsl_regwrite(device, A6XX_CP_CRASH_DUMP_CNTL, 1);
|
||||
|
||||
wait_time = jiffies + msecs_to_jiffies(CP_CRASH_DUMPER_TIMEOUT);
|
||||
while (!time_after(jiffies, wait_time)) {
|
||||
kgsl_regread(device, A6XX_CP_CRASH_DUMP_STATUS, ®);
|
||||
if (reg & 0x2)
|
||||
break;
|
||||
cpu_relax();
|
||||
}
|
||||
/* wait 100 ms before starting the loop */
|
||||
schedule_timeout_interruptible(HZ/10);
|
||||
|
||||
/* Read every 10ms for 900ms */
|
||||
ret = readl_poll_timeout(device->reg_virt +
|
||||
(A6XX_CP_CRASH_DUMP_STATUS << 2),
|
||||
val, val & 0x02, 10000, 900 * 1000);
|
||||
if (ret)
|
||||
kgsl_regread(device, A6XX_CP_CRASH_DUMP_STATUS, &val);
|
||||
|
||||
if (!ADRENO_FEATURE(ADRENO_DEVICE(device), ADRENO_APRIV))
|
||||
kgsl_regwrite(device, A6XX_CP_MISC_CNTL, 0);
|
||||
|
||||
if (!(reg & 0x2)) {
|
||||
dev_err(device->dev, "Crash dump timed out: 0x%X\n", reg);
|
||||
if (ret) {
|
||||
dev_err(device->dev, "Crash dump timed out: 0x%X\n", val);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue