From patchwork Sat Dec 2 11:14:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13476886 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 A56ADC10DC3 for ; Sat, 2 Dec 2023 11:14:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 225646B04CB; Sat, 2 Dec 2023 06:14:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AD516B04CC; Sat, 2 Dec 2023 06:14:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09D0B6B04CD; Sat, 2 Dec 2023 06:14:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EFE896B04CB for ; Sat, 2 Dec 2023 06:14:47 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C29B7C015C for ; Sat, 2 Dec 2023 11:14:47 +0000 (UTC) X-FDA: 81521620614.05.11C0CB0 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by imf10.hostedemail.com (Postfix) with ESMTP id EC226C0006 for ; Sat, 2 Dec 2023 11:14:45 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NCfyuwh4; spf=pass (imf10.hostedemail.com: domain of fancer.lancer@gmail.com designates 209.85.167.43 as permitted sender) smtp.mailfrom=fancer.lancer@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701515686; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FkjKzmOgBIAZEWmOEC5zndYMsC69jtjEuyfNzanPv9Q=; b=rp7Wtt1Gx3MnWXKwevo4HxjZCV6SoUhl7SbMzsU4PNZtOgJpOE8JaFC+YBQGNUrBBNddlq 7f3djwS1saAq9ieQBpcgI8pTvjUMvKm2dlaFprSalSPxgbcpE8kDUPSi6JQu6/bHnmLdir WxKPkzLCeyCrwS6vwuf7EGqnC4X7YnY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701515686; a=rsa-sha256; cv=none; b=ioqlzgo+mCppCwrDY3DEsgKpmh9Apk1EMOuEbut4tIcx78uFz5p3/UrXSC9tb62+PDz549 3fN8uHVWvZ/D82kndefD23TlkZQsdNbAYTXA7L5zTAoCOJ8WLWyVSLYbtKhssHtrVDjrRW /w5widEAkm48ErFc33GE8TI5IbB0iy0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NCfyuwh4; spf=pass (imf10.hostedemail.com: domain of fancer.lancer@gmail.com designates 209.85.167.43 as permitted sender) smtp.mailfrom=fancer.lancer@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-50bc21821a1so4255948e87.0 for ; Sat, 02 Dec 2023 03:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701515684; x=1702120484; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FkjKzmOgBIAZEWmOEC5zndYMsC69jtjEuyfNzanPv9Q=; b=NCfyuwh420EsCdD5+HxALSSpSBC+6Xf/IEGh1xwjPIXR7sisy45G4NkX18R5xvWoCx yG/0PJkIISAJnaRXz/KP+L8EbRwU5G8GzkeH60r9c5H9COi1cAkERdRfjIIoLhGm4uwf lE1HOWW43C/1CNc3AIXRzaqrKPes8ot0gtxVxajYJYoYkbk/H7QaEKQxSW5amCU/Ti5L bzDEOLa7yq8c5FVjpPVyOqJ0cB7ybXy8i9HYen7kzCVJock1JSKQhiwapXhdSPWWGwOh gKNIvLi2ThZUTcuCqu/YyLZthX/39yrQkq2VzbtOno0kwtjiQVmEbwq07ptyM+tkAMRl w5gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701515684; x=1702120484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FkjKzmOgBIAZEWmOEC5zndYMsC69jtjEuyfNzanPv9Q=; b=D2jCRM+Htmu57SX7MqnnaJhuZ7wPudqSXynTsbx7lo9bYcGWJEkbjCnzTmzPRAclhF qCjEpUlT5UOr9wo/oxZjUl2AFsMAKVrtvk8ppP2iAE0u7hyhYL276Mh3xnlT5bLruC3S Av2iNLKnt7JYcS8v0gpwZsB4Hjey18BlHvyml9Kb90tBXuMVH9PYVgBryTxyRSZfWBTq WxFIwIv5Hoih4Hm6GPBPDYb4EqKXGap12iEkn/GIu6M51nOxin9bp2IlRd0NED31xTo+ kdiihoNZpLsjgOmtF61HmCciDmaCqWap9vA1et2IBuhk4qnnKe9ezbGT6pL7teOceRUt IbDw== X-Gm-Message-State: AOJu0YwblhzO1EVnknc5jo9zFdmmIrgHE8bTBe9DW4bbETc4PF5mQOjL hxvANd8VTtZ06cWEkbh2czw= X-Google-Smtp-Source: AGHT+IHA6+EuRkpkyQ96D47YDeUbDMbpN9C7dhAq1xKmSnGXQA8pEXs0hCR4j4mKPT0f09fQoTKiOg== X-Received: by 2002:ac2:5a46:0:b0:50b:c4e3:b601 with SMTP id r6-20020ac25a46000000b0050bc4e3b601mr1409652lfn.66.1701515684172; Sat, 02 Dec 2023 03:14:44 -0800 (PST) Received: from localhost ([95.79.203.166]) by smtp.gmail.com with ESMTPSA id o12-20020ac24e8c000000b0050bbf6b1f74sm690720lfr.232.2023.12.02.03.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 03:14:43 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Jiaxun Yang , Andrew Morton , Tiezhu Yang , Huacai Chen , Yinglu Yang Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Christophe Leroy , Baoquan He , Chao-ying Fu , Mike Rapoport , Matthew Wilcox , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] mips: dmi: Fix early remap on MIPS32 Date: Sat, 2 Dec 2023 14:14:18 +0300 Message-ID: <20231202111430.18059-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231202111430.18059-1-fancer.lancer@gmail.com> References: <20231202111430.18059-1-fancer.lancer@gmail.com> MIME-Version: 1.0 X-Stat-Signature: czicdr4is6b35nhpgzdbgxjkpa1hyqe4 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: EC226C0006 X-Rspam-User: X-HE-Tag: 1701515685-540731 X-HE-Meta: U2FsdGVkX19HRXRYCnhxXVDjks8Rm6tPga+YFnBXX0PlHY1dEa9iVbadiPjiKV1KQJjMd3HyLrSEvpQLmUwSE1ilyu5QrZk+g+oyg2dWBTYObCfNkSvCFVtrPGy7pMUMpRU7qQ1X2pcMUqZDCxnjRABFNYefc7NvyE98lyadVqd/N1rldLYhrqXALS1ixvBAZ8qA9WShQYQB3hqCVUzDUU3QCp1D31rdUzj2vK1tLMkrj5YCQiF1BiCDantaIlm5tdJPy0RGeiZy4CKtVMBLdIdx25nEA2q5yVeQbdRw3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8lJo7BMP70TgWn4DwwH8lJxZ5FQc+j1/djodhFI5Nd3e3IQQc8XzFi8HzDkB3kpKml1pnlQA9neB346+h9Reoa0EXiIY54j5A7BEmKPspW3tCr9X0xRf2N2IKCVZcua9DBTXmOplDeuIe6UJUzpyRC5cwYO5bTCQmityJHQwKYRbU5eEI1Q2bWViVnPPO7TCKBN8V4NXMfQlZrNRc1X63edUa1VNqYPM4 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: 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 --- 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 #include -#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)