MIPS: BMIPS: Fix missing cbr address
diff mbox

Message ID -
State Accepted
Delegated to: James Hogan
Headers show

Commit Message

Jaedon Shin June 16, 2017, 11:03 a.m. UTC
Fixes NULL pointer access in BMIPS3300 RAC flush.

Fixes: 738a3f79027b ("MIPS: BMIPS: Add early CPU initialization code")
Signed-off-by: Jaedon Shin <>
---
 arch/mips/kernel/smp-bmips.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Florian Fainelli June 16, 2017, 5:40 p.m. UTC | #1
On 06/16/2017 04:03 AM, Jaedon Shin wrote:
> Fixes NULL pointer access in BMIPS3300 RAC flush.
> 
> Fixes: 738a3f79027b ("MIPS: BMIPS: Add early CPU initialization code")
> Signed-off-by: Jaedon Shin <>

Reviewed-by: Florian Fainelli <>

Good catch, sorry about that!
James Hogan Nov. 7, 2017, 9:39 p.m. UTC | #2
On Fri, Jun 16, 2017 at 08:03:01PM +0900, Jaedon Shin wrote:
> Fixes NULL pointer access in BMIPS3300 RAC flush.
> 
> Fixes: 738a3f79027b ("MIPS: BMIPS: Add early CPU initialization code")
> Signed-off-by: Jaedon Shin <>

Thanks. Applied for 4.14.

Cheers
James

> ---
>  arch/mips/kernel/smp-bmips.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
> index 1b070a76fcdd..5e0d87f4958f 100644
> --- a/arch/mips/kernel/smp-bmips.c
> +++ b/arch/mips/kernel/smp-bmips.c
> @@ -589,11 +589,11 @@ void __init bmips_cpu_setup(void)
>  
>  		/* Flush and enable RAC */
>  		cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
> -		__raw_writel(cfg | 0x100, BMIPS_RAC_CONFIG);
> +		__raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
>  		__raw_readl(cbr + BMIPS_RAC_CONFIG);
>  
>  		cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
> -		__raw_writel(cfg | 0xf, BMIPS_RAC_CONFIG);
> +		__raw_writel(cfg | 0xf, cbr + BMIPS_RAC_CONFIG);
>  		__raw_readl(cbr + BMIPS_RAC_CONFIG);
>  
>  		cfg = __raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE);
> -- 
> 2.13.1
> 
>

Patch
diff mbox

diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
index 1b070a76fcdd..5e0d87f4958f 100644
--- a/arch/mips/kernel/smp-bmips.c
+++ b/arch/mips/kernel/smp-bmips.c
@@ -589,11 +589,11 @@  void __init bmips_cpu_setup(void)
 
 		/* Flush and enable RAC */
 		cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
-		__raw_writel(cfg | 0x100, BMIPS_RAC_CONFIG);
+		__raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
 		__raw_readl(cbr + BMIPS_RAC_CONFIG);
 
 		cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
-		__raw_writel(cfg | 0xf, BMIPS_RAC_CONFIG);
+		__raw_writel(cfg | 0xf, cbr + BMIPS_RAC_CONFIG);
 		__raw_readl(cbr + BMIPS_RAC_CONFIG);
 
 		cfg = __raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE);