MIPS: BMIPS: Fix missing cbr address
authorJaedon Shin <jaedon.shin@gmail.com>
Fri, 16 Jun 2017 11:03:01 +0000 (20:03 +0900)
committerJames Hogan <jhogan@kernel.org>
Tue, 7 Nov 2017 21:28:19 +0000 (21:28 +0000)
Fix NULL pointer access in BMIPS3300 RAC flush.

Fixes: 738a3f79027b ("MIPS: BMIPS: Add early CPU initialization code")
Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 4.7+
Patchwork: https://patchwork.linux-mips.org/patch/16423/
Signed-off-by: James Hogan <jhogan@kernel.org>
arch/mips/kernel/smp-bmips.c

index 406072e26752052c83b04ffacc254d901a668509..87dcac2447c8df20a572139d5053624e91acf2ca 100644 (file)
@@ -591,11 +591,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);