From 6c866b2ffc68512c69ac9e08925f23b1f3fb63af Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Sat, 29 Mar 2025 17:56:35 +0800 Subject: [PATCH] soc: rockchip: debug: disable os lock for edpcsr Change-Id: I59efc4705905880797ab14ce28726fb3542267f8 Signed-off-by: Huibin Hong --- drivers/soc/rockchip/rockchip_debug.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/soc/rockchip/rockchip_debug.c b/drivers/soc/rockchip/rockchip_debug.c index 67d14064d1c5..dbc05b9cad27 100644 --- a/drivers/soc/rockchip/rockchip_debug.c +++ b/drivers/soc/rockchip/rockchip_debug.c @@ -79,6 +79,8 @@ #define PMPCSR_LO 0x200 #define PMPCSR_HI 0x204 +#define EDOSLAR 0x300 + #define NUM_CPU_SAMPLES 100 #define NUM_SAMPLES_TO_PRINT 32 @@ -139,6 +141,9 @@ static int rockchip_debug_dump_edpcsr(struct fiq_debugger_output *output) /* Unlock EDLSR.SLK so that EDPCSRhi gets populated */ writel(EDLAR_UNLOCK, base + EDLAR); + /* Disabled os lock */ + writel(0, base + EDOSLAR); + /* Try to read a bunch of times if CPU is actually running */ for (j = 0; j < NUM_CPU_SAMPLES && printed < NUM_SAMPLES_TO_PRINT; j++) { @@ -299,6 +304,9 @@ static int rockchip_panic_notify_edpcsr(struct notifier_block *nb, /* Unlock EDLSR.SLK so that EDPCSRhi gets populated */ writel(EDLAR_UNLOCK, base + EDLAR); + /* Disabled os lock */ + writel(0, base + EDOSLAR); + pr_err("CPU%d online:%d\n", i, cpu_online(i)); /* Try to read a bunch of times if CPU is actually running */ @@ -533,6 +541,8 @@ static int rockchip_hardlock_notify(struct notifier_block *nb, base = rockchip_cpu_debug[cpu]; /* Unlock EDLSR.SLK so that EDPCSRhi gets populated */ writel(EDLAR_UNLOCK, base + EDLAR); + /* Disabled os lock */ + writel(0, base + EDOSLAR); if (sizeof(edpcsr) == 8) edpcsr = ((u64)readl(base + EDPCSR_LO)) | ((u64)readl(base + EDPCSR_HI) << 32);