adjust cpufreq uses of LOONGSON_CHIPCFG
Subsystems (3)
PATCH 1/1 adjust cpufreq uses of LOONGSON_CHIPCFG
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.
--- drivers/cpufreq/loongson2_cpufreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/cpufreq/loongson2_cpufreq.c +5 -3
@@ -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 (); }
Signature · 8 lines
2.7.4 -- Alexandre Oliva, freedom fighter he/him https://FSFLA.org/blogs/lxo Free Software Evangelist Stallman was right, but he's left :( GNU Toolchain Engineer FSMatrix: It was he who freed the first of us FSF & FSFLA board member The Savior shall return (true);
Hi Alexandre,
Quoted 11 lines · Alexandre Oliva
The post-fork cleanup of loongson2ef from loongson64 changed
LOONGSON_CHIPCFGfrom a single-argument functional macro to a non-functional macro with an mmio address in loongson2ef, butloongson2_cpufreqstill uses the notation of a functional macro call expecting it to be an lvalue. Fixed based onloongson_suspend_enter.Signed-off-by Alexandre Oliva <[email protected]>Cc Jiaxun Yang <[email protected]>
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 <[email protected]> (maintainer:MIPS/LOONGSON2EF ARCHITECTURE) "Rafael J. Wysocki" <[email protected]> (maintainer:CPU FREQUENCY SCALING FRAMEWORK) Viresh Kumar <[email protected]> (maintainer:CPU FREQUENCY SCALING FRAMEWORK) [email protected] (open list:MIPS/LOONGSON2EF ARCHITECTURE) [email protected] (open list:CPU FREQUENCY SCALING FRAMEWORK) [email protected] (open list)
I've CC'd them now, but they might want the patch resending.
Thanks,
Paul
Quoted 32 lines
--- drivers/cpufreq/loongson2_cpufreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/cpufreq/loongson2_cpufreq.c +5
-3@@ -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 (); }Signature · 8 lines
2.7.4 -- Alexandre Oliva, freedom fighter he/him https://FSFLA.org/blogs/lxo Free Software Evangelist Stallman was right, but he's left :( GNU Toolchain Engineer FSMatrix: It was he who freed the first of us FSF & FSFLA board member The Savior shall return (true);
Quoted 42 lines · Paul Burton
Hi Alexandre,
Quoted 11 lines · Alexandre Oliva
The post-fork cleanup of loongson2ef from loongson64 changed
LOONGSON_CHIPCFGfrom a single-argument functional macro to a non-functional macro with an mmio address in loongson2ef, butloongson2_cpufreqstill uses the notation of a functional macro call expecting it to be an lvalue. Fixed based onloongson_suspend_enter.Signed-off-by Alexandre Oliva <[email protected]>Cc Jiaxun Yang <[email protected]>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 <[email protected]> (maintainer:MIPS/LOONGSON2EF ARCHITECTURE) "Rafael J. Wysocki" <[email protected]> (maintainer:CPU FREQUENCY SCALING FRAMEWORK) Viresh Kumar <[email protected]> (maintainer:CPU FREQUENCY SCALING FRAMEWORK) [email protected] (open list:MIPS/LOONGSON2EF ARCHITECTURE) [email protected] (open list:CPU FREQUENCY SCALING FRAMEWORK) [email protected] (open list)I've CC'd them now, but they might want the patch resending.
Thanks,
PaulQuoted 11 lines
--- drivers/cpufreq/loongson2_cpufreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/cpufreq/loongson2_cpufreq.c +0
-0@@ -144,9 +144,11 @@ static void loongson2_cpu_wait(void)u32 cpu_freq;
Quoted 12 lines
drivers/cpufreq/loongson2_cpufreq.c static void loongson2_cpu_wait(void) · line 154
Quoted 12 lines
drivers/cpufreq/loongson2_cpufreq.c +5
-3spin_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
Signature · 1 line
viresh
PATCH 1/1 adjust cpufreq uses of LOONGSON_CHIPCFG
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.
--- drivers/cpufreq/loongson2_cpufreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/cpufreq/loongson2_cpufreq.c +5 -3
@@ -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 (); }
Signature · 7 lines
2.7.4 -- Alexandre Oliva, freedom fighter he/him https://FSFLA.org/blogs/lxo Free Software Evangelist Stallman was right, but he's left :( GNU Toolchain Engineer FSMatrix: It was he who freed the first of us FSF & FSFLA board member The Savior shall return (true);
Rafael J. Wysocki
maintainerQuoted 7 lines · Alexandre Oliva
The post-fork cleanup of loongson2ef from loongson64 changed
LOONGSON_CHIPCFGfrom a single-argument functional macro to a non-functional macro with an mmio address in loongson2ef, butloongson2_cpufreqstill uses the notation of a functional macro call expecting it to be an lvalue. Fixed based onloongson_suspend_enter.
Quoted 5 lines
Signed-off-by Alexandre Oliva <[email protected]>Cc Jiaxun Yang <[email protected]>Acked-by Viresh Kumar <[email protected]>
Queued up as 5.6 material under modified subject ("cpufreq:loongson2_cpufreq: adjust cpufreq uses of LOONGSON_CHIPCFG"), thanks!
Quoted 31 lines
--- drivers/cpufreq/loongson2_cpufreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/cpufreq/loongson2_cpufreq.c +5
-4@@ -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 (); } --2.7.4
--
Alexandre Oliva, freedom fighter he/him https://FSFLA.org/blogs/lxo
Free Software Evangelist Stallman was right, but he's left :(
GNU Toolchain Engineer FSMatrix: It was he who freed the first of us
FSF & FSFLA board member The Savior shall return (true);