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 0A33C175549; Wed, 3 Jul 2024 11:24:04 +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=1720005844; cv=none; b=CW8aKFceBslLp/nUPbFZuo10JBNA1zG620fp/c0NS/QWNTnP4gqduowgwGAvreAoJga1eHIwyp6493MdwpOmh5nHp9Y5DMBZCy7DbNM69NLppqPNc57YysX6mSfUuLoBJWGGbroJnjgucbSSfQXWLEleuB3ACK+jWmrmwfPW/3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720005844; c=relaxed/simple; bh=NZY/xF2ggVyR1EnPHSMnZSmUvshpZGB5NPVm7hmKLas=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f8bRFifvUUScZTXtsHkeB3rUMzoYdZ9PRz8hkM5uLsphqQk/xbsKsCeiGmLMSC10p0OCCbX2dKgT0x3fSBUl5RETJ8ZPTNN7HNJOmJk7JxwIEY4UQqb7Ofb785VeyALJiJVttoYcj2GbuIqwEF2mwZbdmCfNqJqfw8OOe/J78Ug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Sj4PkjXr; 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="Sj4PkjXr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 867FDC2BD10; Wed, 3 Jul 2024 11:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720005843; bh=NZY/xF2ggVyR1EnPHSMnZSmUvshpZGB5NPVm7hmKLas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sj4PkjXrcxE28uvs3o8eGYocHnK8CVvbeW0utEij7QIPPTo7AQS+mCc58VBLTvkhy iYExMN/OL7jQxQjRxHza5J8BvW1+jMOyU1K08NcMThIypp7/Vl6z/uTZXHR0RhaFJq Egoz+KwSfjmRdrT+vexu1j1F3mh1rf1lIDz20Bbc= 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.15 184/356] mips: bmips: BCM6358: make sure CBR is correctly set Date: Wed, 3 Jul 2024 12:38:40 +0200 Message-ID: <20240703102920.068125634@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703102913.093882413@linuxfoundation.org> References: <20240703102913.093882413@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-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 45c7cf582348e..6e5c2c5070179 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