[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231202111430.18059-2-fancer.lancer@gmail.com>
Date: Sat, 2 Dec 2023 14:14:18 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Tiezhu Yang <yangtiezhu@...ngson.cn>,
Huacai Chen <chenhuacai@...nel.org>,
Yinglu Yang <yangyinglu@...ngson.cn>
Cc: Serge Semin <fancer.lancer@...il.com>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Arnd Bergmann <arnd@...db.de>,
Aleksandar Rikalo <aleksandar.rikalo@...mia.com>,
Aleksandar Rikalo <arikalo@...il.com>,
Dragan Mladjenovic <dragan.mladjenovic@...mia.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Baoquan He <bhe@...hat.com>, Chao-ying Fu <cfu@...ecomp.com>,
Mike Rapoport <rppt@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Marc Zyngier <maz@...nel.org>, linux-mips@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/6] mips: dmi: Fix early remap on MIPS32
dmi_early_remap() has been defined as ioremap_cache() which on MIPS32 gets
to be converted to the VM-based mapping. DMI early remapping is performed
at the setup_arch() stage with no VM available. So calling the
dmi_early_remap() for MIPS32 causes the system to crash at the early boot
time. Fix that by converting dmi_early_remap() to the uncached remapping
which is always available on both 32 and 64-bits MIPS systems.
Note this change shall not cause any regressions on the current DMI
support implementation because on the early boot-up stage neither MIPS32
nor MIPS64 has the cacheable ioremapping support anyway.
Fixes: be8fa1cb444c ("MIPS: Add support for Desktop Management Interface (DMI)")
Signed-off-by: Serge Semin <fancer.lancer@...il.com>
---
Note even though this patch is fully correct from the current
ioremap()-based semantics point of view and shall fix the denoted problem,
Jiaxun thinks that it's better to provide a different fix since
dmi_early_remap() doesn't work correctly on even Loongson64 - the only
currently DMI-equipped platform. In v1 discussion he promised to provide a
better fix for the problem. Until then let's consider this patch as the
only currently available solution.
Changelog v2:
- Replace ioremap_uc() with using ioremap() due to having the former one
deprecated. (@Arnd)
- Extend patch log with a note regarding the unsynched caches concern.
(@Jiaxun)
---
arch/mips/include/asm/dmi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/dmi.h b/arch/mips/include/asm/dmi.h
index 27415a288adf..dc397f630c66 100644
--- a/arch/mips/include/asm/dmi.h
+++ b/arch/mips/include/asm/dmi.h
@@ -5,7 +5,7 @@
#include <linux/io.h>
#include <linux/memblock.h>
-#define dmi_early_remap(x, l) ioremap_cache(x, l)
+#define dmi_early_remap(x, l) ioremap(x, l)
#define dmi_early_unmap(x, l) iounmap(x)
#define dmi_remap(x, l) ioremap_cache(x, l)
#define dmi_unmap(x) iounmap(x)
--
2.42.1
Powered by blists - more mailing lists