summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2024-06-11 14:35:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-05 10:08:22 +0300
commit10afe5f7d30f6fe50c2b1177549d0e04921fc373 (patch)
treeacc811d1d485209379975cf5436ce81c4766b52a /arch/mips
parent31a77b23aeebc80baf4cfcfef869b1058b5fcb10 (diff)
downloadlinux-10afe5f7d30f6fe50c2b1177549d0e04921fc373.tar.xz
mips: bmips: BCM6358: make sure CBR is correctly set
[ Upstream commit ce5cdd3b05216b704a704f466fb4c2dff3778caf ] It was discovered that some device have CBR address set to 0 causing kernel panic when arch_sync_dma_for_cpu_all is called. This was notice in situation where the system is booted from TP1 and BMIPS_GET_CBR() returns 0 instead of a valid address and !!(read_c0_brcm_cmt_local() & (1 << 31)); not failing. The current check whether RAC flush should be disabled or not are not enough hence lets check if CBR is a valid address or not. Fixes: ab327f8acdf8 ("mips: bmips: BCM6358: disable RAC flush for TP1") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/bmips/setup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c
index 36fbedcbd518..4ef8842100b3 100644
--- a/arch/mips/bmips/setup.c
+++ b/arch/mips/bmips/setup.c
@@ -110,7 +110,8 @@ static void bcm6358_quirks(void)
* RAC flush causes kernel panics on BCM6358 when booting from TP1
* because the bootloader is not initializing it properly.
*/
- bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31));
+ bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)) ||
+ !!BMIPS_GET_CBR();
}
static void bcm6368_quirks(void)