Thread (5 messages) 5 messages, 4 authors, 2020-01-22

Re: [PATCH] [Loongson2F] adjust cpufreq uses of LOONGSON_CHIPCFG

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2020-01-21 04:54:00
Also in: linux-pm

On 20-01-20, 10:06, Paul Burton wrote:
Hi Alexandre,

On Sat, Jan 18, 2020 at 02:00:43AM -0300, Alexandre Oliva wrote:
quoted
The post-fork cleanup of loongson2ef from loongson64 changed
LOONGSON_CHIPCFG from a single-argument functional macro to a
non-functional macro with an mmio address in loongson2ef, but
loongson2_cpufreq still uses the notation of a functional macro call
expecting it to be an lvalue.  Fixed based on loongson_suspend_enter.

Signed-off-by: Alexandre Oliva <redacted>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org
Cc: paul.burton@mips.com
This patch looks good to me, but you need to copy the cpufreq
maintainers:

$ ./scripts/get_maintainer.pl -f drivers/cpufreq/loongson2_cpufreq.c
Jiaxun Yang [off-list ref] (maintainer:MIPS/LOONGSON2EF ARCHITECTURE)
"Rafael J. Wysocki" [off-list ref] (maintainer:CPU FREQUENCY SCALING FRAMEWORK)
Viresh Kumar [off-list ref] (maintainer:CPU FREQUENCY SCALING FRAMEWORK)
linux-mips@vger.kernel.org (open list:MIPS/LOONGSON2EF ARCHITECTURE)
linux-pm@vger.kernel.org (open list:CPU FREQUENCY SCALING FRAMEWORK)
linux-kernel@vger.kernel.org (open list)

I've CC'd them now, but they might want the patch resending.

Thanks,
    Paul
quoted
---
 drivers/cpufreq/loongson2_cpufreq.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/loongson2_cpufreq.c b/drivers/cpufreq/loongson2_cpufreq.c
index 84f0eee..ace2d46 100644
--- a/drivers/cpufreq/loongson2_cpufreq.c
+++ b/drivers/cpufreq/loongson2_cpufreq.c
@@ -144,9 +144,11 @@ static void loongson2_cpu_wait(void)
 	u32 cpu_freq;
 
 	spin_lock_irqsave(&loongson2_wait_lock, flags);
-	cpu_freq = LOONGSON_CHIPCFG(0);
-	LOONGSON_CHIPCFG(0) &= ~0x7;	/* Put CPU into wait mode */
-	LOONGSON_CHIPCFG(0) = cpu_freq;	/* Restore CPU state */
+	cpu_freq = readl(LOONGSON_CHIPCFG);
+	/* Put CPU into wait mode */
+	writel(readl(LOONGSON_CHIPCFG) & ~0x7, LOONGSON_CHIPCFG);
+	/* Restore CPU state */
+	writel(cpu_freq, LOONGSON_CHIPCFG);
 	spin_unlock_irqrestore(&loongson2_wait_lock, flags);
 	local_irq_enable();
 }
Please resend it and add my

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help