From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD64EC5AD4C for ; Thu, 23 Nov 2023 12:13:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F7A36B063A; Thu, 23 Nov 2023 07:13:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A7ED6B0641; Thu, 23 Nov 2023 07:13:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16FC06B064B; Thu, 23 Nov 2023 07:13:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 079986B063A for ; Thu, 23 Nov 2023 07:13:40 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D5EF8140FCD for ; Thu, 23 Nov 2023 12:13:39 +0000 (UTC) X-FDA: 81489109758.20.9BE1E0E Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by imf22.hostedemail.com (Postfix) with ESMTP id 8BE92C0023 for ; Thu, 23 Nov 2023 12:13:37 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=flygoat.com header.s=fm2 header.b=Mn6gZel2; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=CWiHG2HC; spf=pass (imf22.hostedemail.com: domain of jiaxun.yang@flygoat.com designates 64.147.123.24 as permitted sender) smtp.mailfrom=jiaxun.yang@flygoat.com; dmarc=pass (policy=none) header.from=flygoat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700741617; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bqTTK97AMSpZYhD615Hms/vz78ad6/G8f6hLgVljG2E=; b=sKgknU0widpUuP6rKEalkeFztOmxyh84HhUAF3LUMRh/hJ1SNa5BzQQE3NR3ScfEyRNL+t RR42gN4dgSjjIuzpgt+XDRrzX7fcN78/YSxRz0BXy7nEO4mdPaZm61KZ1qKi7IHAy2CTtB cX8F7o6jMW5I+DgLG3pyq3jDpAlPrHU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=flygoat.com header.s=fm2 header.b=Mn6gZel2; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=CWiHG2HC; spf=pass (imf22.hostedemail.com: domain of jiaxun.yang@flygoat.com designates 64.147.123.24 as permitted sender) smtp.mailfrom=jiaxun.yang@flygoat.com; dmarc=pass (policy=none) header.from=flygoat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700741617; a=rsa-sha256; cv=none; b=LAfpaT4878LX/a7CmoVzKniKzbQe8sLSWYcbr6cUNOrUQFm14tsl+U2119y3OoW0FAWDqb EJNQCyx+HwFcZMt9M7gf3QV3pDiEkU1NhCsfk9M9nfW/vrpT6Z4Rgd8Xog/qceAJjfaAAd 3l3DMOrRLuFvHVRFg3WXFQab8FB6Cbk= Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E9B033200AD3; Thu, 23 Nov 2023 07:13:32 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute3.internal (MEProxy); Thu, 23 Nov 2023 07:13:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1700741612; x=1700828012; bh=bqTTK97AMSpZYhD615Hms/vz78ad6/G8f6h LgVljG2E=; b=Mn6gZel2hDy2U4uSAOinnxIYhsA32Dx/zcfQZ4OrQb3O8oSTi1+ RUthCgCiYT7gNz5tzurx9Z87nMFqnK7kjKPd/O7A5VUOH7O92vmI1ln5y+yL6CIB cn4iAH4KievCDLgXVP8VJO0Sp1lPkiv2DQ9RPkiIGR2xMVPbD18FIF8QF/eVBYEZ E508qNeUGUzFJlMVl8VMZ5y82gOT+pSUBF+b+wOShNWv26Po99N/3NjEaT/VI6eo neB+0Pe9fmBD9t0w/U5rGKrgTLYPloArKChr+A5oIpgky3v8KtIMQHT809fHTBdI aJMQSzFYBRMf/uFzt5lkbePGW0D3GOnkrqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1700741612; x=1700828012; bh=bqTTK97AMSpZYhD615Hms/vz78ad6/G8f6h LgVljG2E=; b=CWiHG2HCNR3PUb8Zber+487Gm0pSObixAc5WZjphYBU74QjOaX6 qpMCQUi//ILgW0v/HBj7dEJVID3N67HAEZ8tA9qUcTOcFIn13mWjYYpsxY07/6Wt WHT03CR9vosF04wKel8cNgdALy1dXE7iavfb3IIRANiosvwvsndx93E3RfkoYy1C EWbFh3xVD7smkjkYxNuI7vDw/4GfNI7okhTTwIUGYTR2E+bGKRslVeOOLBoYhQKb y6x0ym88zjmHXSBT9vKXaC4B2wgUpxS2XcXr55TmWuP9EC1UMtG5YLLM0iIEyowW 9lLW6y2Yj8heNz/f4LyyIog6j8Sy6roYQTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehfedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdfl ihgrgihunhcujggrnhhgfdcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtoh hmqeenucggtffrrghtthgvrhhnpedufeegfeetudeghefftdehfefgveffleefgfehhfej ueegveethfduuddvieehgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9E2B336A0075; Thu, 23 Nov 2023 07:13:31 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1234-gac66594aae-fm-20231122.001-gac66594a MIME-Version: 1.0 Message-Id: <8ca730b9-fa8c-46ea-bdc5-158da0f29c3a@app.fastmail.com> In-Reply-To: References: <20231122182419.30633-1-fancer.lancer@gmail.com> <20231122182419.30633-2-fancer.lancer@gmail.com> Date: Thu, 23 Nov 2023 12:13:11 +0000 From: "Jiaxun Yang" To: "Serge Semin" , "Arnd Bergmann" Cc: "Thomas Bogendoerfer" , "Andrew Morton" , "Mike Rapoport" , "Matthew Wilcox" , "Tiezhu Yang" , "Huacai Chen" , "Yinglu Yang" , "Alexey Malahov" , "Aleksandar Rikalo" , "Aleksandar Rikalo" , "Dragan Mladjenovic" , "Chao-ying Fu" , "Marc Zyngier" , "linux-mips@vger.kernel.org" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] mips: dmi: Fix early remap on MIPS32 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 8BE92C0023 X-Rspam-User: X-Stat-Signature: qtucrbmp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1MP/auKEmGgNswCL7dKLGXRnQBShD49qyOb3TLrAEk2xwH5TNz+mW8y82wjNVVzHP1mzYwm9iveX/O7wM6XssaiYuicLKG2ieE2xRbVGh7ifV5nGN3wkjemp6jUQZO+Uaa/qDPsRXp9GGPAANUntHc8Mvu1Wl1g9VOxjHzFcpK1bG4oVbw3n4xCZhdEA2avv4tEF8HdTfXHCJHtKesjCaWiuYMj1uXnopfX3cqin7XJWQw4s4KMFgQ/0U45k+DxQfirTNZI6mzXvv52fRUtTnGUIqPsyFnYv5WTitlliO5c++s9OmEIfj3Kqmtzh6OvoHwZePstPfXszPqLWwDUKQE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: =E5=9C=A82023=E5=B9=B411=E6=9C=8823=E6=97=A5=E5=8D=81=E4=B8=80=E6=9C=88 = =E4=B8=8A=E5=8D=889:32=EF=BC=8CSerge Semin=E5=86=99=E9=81=93=EF=BC=9A > Hi Arnd > > On Wed, Nov 22, 2023 at 08:35:01PM +0100, Arnd Bergmann wrote: >> On Wed, Nov 22, 2023, at 19:23, Serge Semin wrote: >> > dmi_early_remap() has been defined as ioremap_cache() which on MIPS= 32 gets >> > to be converted to the VM-based mapping. DMI early remapping is per= formed >> > at the setup_arch() stage with no VM available. So calling the >> > dmi_early_remap() for MIPS32 causes the system to crash at the earl= y boot >> > time. Fix that by converting dmi_early_remap() to the uncached rema= pping >> > which is always available on both 32 and 64-bits MIPS systems. >> > >> > Fixes: be8fa1cb444c ("MIPS: Add support for Desktop Management Inte= rface (DMI)") >> > Signed-off-by: Serge Semin >> > --- >> > 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/dm= i.h >> > index 27415a288adf..525aad1572d1 100644 >> > --- a/arch/mips/include/asm/dmi.h >> > +++ b/arch/mips/include/asm/dmi.h >> > @@ -5,7 +5,7 @@ >> > #include >> > #include >> >=20 >> > -#define dmi_early_remap(x, l) ioremap_cache(x, l) >> > +#define dmi_early_remap(x, l) ioremap_uc(x, l) >>=20 > >> Please don't use ioremap_uc() in new code, we are in the (long) >> process of removing it from the kernel for everything except >> x86-32, and it already returns NULL on most of them. >>=20 >> Would the normal ioremap() work for you here? It seems to >> do the same thing as ioremap_uc() on mips and a couple of=20 >> other architectures that have not yet killed it off. > > Ok. Thanks for the heads up. I'll fix the patch to be using ioremap() > in v2. ioremap_uc() is just an macro-alias of ioremap() on MIPS. Perhaps we need to fix ioremap_cache so it can give a KSEG1 address? AFAIK for Loongson DMI is located at cached memory so using ioremap_uc blindly will cause inconsistency. Thanks - Jiaxun > > -Serge(y) > >>=20 >> Arnd --=20 - Jiaxun