linux-mips
[Top] [All Lists]

[PATCH AUTOSEL 4.19 225/258] MIPS: ralink: Select CONFIG_CPU_MIPSR2_IRQ_

To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 225/258] MIPS: ralink: Select CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8
From: Sasha Levin <sashal@kernel.org>
Date: Mon, 28 Jan 2019 10:58:51 -0500
Cc: Stefan Roese <sr@denx.de>, Paul Burton <paul.burton@mips.com>, John Crispin <blogic@openwrt.org>, Daniel Schwierzeck <daniel.schwierzeck@gmail.com>, Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Sasha Levin <sashal@kernel.org>, linux-mips@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691812; bh=eDYTTJ6p7zS48/XjJJfxWeet2C2n7NaYhdS2NEI87t0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qlLUh3svPIOIeYb1hEzhW/CXwSRkZeSdFIyj1qpZ/V4fE5WZlWOfg8F8bscg32Bqt 9wAEcEG9bdiT84y15IEGjvnT4oZleCOeNeznrdcJDxg89Mz5Qr6FSqLcLNKHliWed/ 9iOBiKYRNyU5guQGPcdONHjn57wA+LO49kLQgriA=
In-reply-to: <20190128155924.51521-1-sashal@kernel.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20190128155924.51521-1-sashal@kernel.org>
Sender: linux-mips-bounce@linux-mips.org
From: Stefan Roese <sr@denx.de>

[ Upstream commit 0b15394475e3bcaf35ca4bf22fc55d56df67224e ]

Testing has shown, that when using mainline U-Boot on MT7688 based
boards, the system may hang or crash while mounting the root-fs. The
main issue here is that mainline U-Boot configures EBase to a value
near the end of system memory. And with CONFIG_CPU_MIPSR2_IRQ_VI
disabled, trap_init() will not allocate a new area to place the
exception handler. The original value will be used and the handler
will be copied to this location, which might already be used by some
userspace application.

The MT7688 supports VI - its config3 register is 0x00002420, so VInt
(Bit 5) is set. But without setting CONFIG_CPU_MIPSR2_IRQ_VI this
bit will not be evaluated to result in "cpu_has_vi" being set. This
patch now selects CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 which results
trap_init() to allocate some memory for the exception handler.

Please note that this issue was not seen with the Mediatek U-Boot
version, as it does not touch EBase (stays at default of 0x8000.0000).
This is strictly also not correct as the kernel (_text) resides
here.

Signed-off-by: Stefan Roese <sr@denx.de>
[paul.burton@mips.com: s/beeing/being/]
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/ralink/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/ralink/Kconfig b/arch/mips/ralink/Kconfig
index 1f9cb0e3c79a..613d61763433 100644
--- a/arch/mips/ralink/Kconfig
+++ b/arch/mips/ralink/Kconfig
@@ -38,6 +38,7 @@ choice
 
        config SOC_MT7620
                bool "MT7620/8"
+               select CPU_MIPSR2_IRQ_VI
                select HW_HAS_PCI
 
        config SOC_MT7621
-- 
2.19.1


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH AUTOSEL 4.19 225/258] MIPS: ralink: Select CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8, Sasha Levin <=