From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E181E173336; Wed, 3 Jul 2024 10:53:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004033; cv=none; b=LGQsbme2u8h1m7cBh7a3T0TwCZdlZ6TLpSNX0GoXhggxQn4JyRWggjHKIukRZTCTp+9HmDANOf571VkBhRatYtZUUj8JClXIZ7C7DoOz47BUMoRnUjO+OE5lc6fBsCxwTfwDOjLMEzeFsk1NLwqGifigMEcHB716XWkarQ7SNK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004033; c=relaxed/simple; bh=6tnkqEdgD1VAZeSnbQl76kIwoN3MPuT9k2PKyNWUH64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CWwKPflSSfQDX9Jd51msCrZi0HRTuv4t8QT9ueHWenLIYKmzDiTwVjCRzt9NMpLUxb4g0xzb8jFIoPHDgBO3LmnLxL1qeluOyr917huImOfIbZ/AgTi/80+3Py+CeFKTB9sBUw5BG0PgTE6pJXWjhGUmfqAw770PJj5l95TyXvQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SMhEKcMI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SMhEKcMI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FB39C2BD10; Wed, 3 Jul 2024 10:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720004032; bh=6tnkqEdgD1VAZeSnbQl76kIwoN3MPuT9k2PKyNWUH64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SMhEKcMIgMQBvuDI4acIPruEak/B+gj3fgKjowr6KiJHYHO+7DAHFf1toz9ekGCEO wB3VrcRjtnqy+VXgIMFLyjvMs1CEQwSBUVNWN+U1DLcGjr1/mwqaVa3sieqARwwkX/ XSlxtwZlB5/F9ndKRmGWEgE3Xuef94jFUd+mQixM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christian Marangi , Florian Fainelli , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.4 102/189] mips: bmips: BCM6358: make sure CBR is correctly set Date: Wed, 3 Jul 2024 12:39:23 +0200 Message-ID: <20240703102845.352483446@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703102841.492044697@linuxfoundation.org> References: <20240703102841.492044697@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian Marangi [ 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 Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/bmips/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c index 36fbedcbd518d..4ef8842100b30 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) -- 2.43.0