From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6687B49550B for ; Wed, 8 Jul 2026 17:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783530429; cv=none; b=kzf+8snvJ6zYypxTexUfgHRZFKG8Hi3QMXgi4rgofEcCPqTEuXEfnDi9jTey5uaDXWLoA0c/gW08k37CCXi1D6iKEpgG5titfKeK8j9KC1TGE8KDxingWR05z7OljjrxPOm7twL2tggk979VAysuBnIEms1G+8AyRaZadk9PoV8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783530429; c=relaxed/simple; bh=XrZvFMPfve20zHrcg7uCvmZSGOXYUvyym0pnK41RyYg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eLtivpAXy574H+YWzHwerbRRU0Mx6Bcea5zQeHcO0uT/Nwq18weeyh46/ym9yzkyFDEAjE1Vd1g46aJXhaHTX3qZV4nqAUhZCJDWCbQU+PacpVqACkLGgWlAH2Fw2kAXk0Af1jT3ZsGQwZWMTUmRQSg/yFieSZtRRr9m5akeufg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PV+52wWS; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PV+52wWS" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-848479c9bd5so682443b3a.3 for ; Wed, 08 Jul 2026 10:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783530428; x=1784135228; darn=vger.kernel.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:content-type; bh=kdJQxJx8F3XrC1s03ROFypct+e/tcjWcDJ9Fqkn2hFc=; b=PV+52wWSIEu2AFOINhtmBu9se2mOtdcUesEFqU9kQoCEkPF4BLFbh9N/fZ25wcbK6/ hrgxnDKRZqERuC1EsLquc452MIJVCZGXMsqx0uveGXajmQu8OORbXSbgZ+l+ah4I6KW1 a6UF2/+AyUQ9HEFgn0W70Sc/2gS1srvwRVOUWyNXl1glRGiBR9zU+qvl5ipc2oy/Pv5Q hKkmCffKInkBIrkKyEZI8v9aToRZBeGyQJcuM12a46L62zU6qt1wxWUYPj+LVAcsyQne AU+2SnqFBFHmDEZOodN4mUJjE01d8mEIyr9cYK6eRVnROM9UAVLoJb3Wj5Md0Bems4GB o5fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783530428; x=1784135228; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=kdJQxJx8F3XrC1s03ROFypct+e/tcjWcDJ9Fqkn2hFc=; b=PKe5suurNrKtOldfDxV0vfBehEyxMWi5IpexSArmwFtJ5f5nb5gwDUrwi4502FvpoO IMgrPkd1fs/n7/FVDNdXtAVwWPYLWZY7GUw7rSOA8FAuBimMHn0qJrJGaZvN5zE6rHoS JFc5qpVijHSrlUT9tfQMi1xHggC0Kxv9gezdXJNC/zbikZTxXlde2avcztGGAaD5ouFK RzN5OjnxSohPH4Y/+XdYfucED8LHUyhGDjFDSwFIIFoV2S4nF/ZaAOEShluvyamP4kJk 7kLkK9lQU4P6FzUFM1fotGCCEZXLRHektO3taep6waCNwxetPnKV4JjPb6VYZOIrPtPu 9xJg== X-Forwarded-Encrypted: i=1; AHgh+RpPQFlj+Cs5xS69dumDxnENxa8w24ePsVaxh4PnSthAXq2ZmyWnlJrHnIz9pgOycTamzrKGm3ozEr6T6NQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1STof8GjWYnEtKUrw5hYxTnx328snq/gQGlTjj3TqY75MW/KN apDFWf/SZxtAT3J1d1xevUjfAXTYI0M+qYr3LAoIa2UV+Irov7bQHaDD X-Gm-Gg: AfdE7cmF8Fl6iwSCA5WBgR3HR7iQR8w+NVOgPuUmd/qc8g6qRPcxcbMfpc3LdwuX/u1 1gQ2cuveq/4lsEXGgiJ6YEpcyfPnKGOKDtft+4slpYPwS2MXBi9iDH3Y7GzD4kJqL6lnXhBgiLB OHyGQDvLsG5rS3l9J6WIPYHeqiK7Xg2zkocDtHEJtCR0lKFTuLeTGSMcEH81FirxpB88UWXWOjM WVfRp3NuNQdXo41vzHT4tnJ80RqpW6+NvnM0az6NlxLFuGBBn7ygpcNBqtjH+di3b6AU5A1lsv8 IIY0W8yv9l0qvcgQ3/NRT+PJnVIHUj7eGDILayYJKhb29ikwH1obYMbbUny57To0hcvDRh6NSnT 9Lm4qI17m2wp3g6bgPchup6PED0tXUuxBaMtpEXSzBfJumEKHfQVHx5DUFlG95GC77Nc59WBnwm yA+lVCYYE= X-Received: by 2002:a05:6a00:6f08:b0:848:2f74:d8d7 with SMTP id d2e1a72fcca58-84843003eafmr2839561b3a.72.1783530427525; Wed, 08 Jul 2026 10:07:07 -0700 (PDT) Received: from ubuntu.. ([110.9.142.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84847275fa0sm1119528b3a.22.2026.07.08.10.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 10:07:07 -0700 (PDT) From: Sang-Heon Jeon To: akpm@linux-foundation.org, David Hildenbrand , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-mm@kvack.org, Sang-Heon Jeon , Alexandre Ghiti , Catalin Marinas , "Liam R. Howlett" , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , Will Deacon Subject: [PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics Date: Thu, 9 Jul 2026 02:06:45 +0900 Message-ID: <20260708170647.362562-2-ekffu200098@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260708170647.362562-1-ekffu200098@gmail.com> References: <20260708170647.362562-1-ekffu200098@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit __late_set_fixmap() and __late_clear_fixmap() are only used after early_ioremap_reset() has been called. arm64, riscv and powerpc all have a __set_fixmap() that works before and after paging_init(), so they do not need to call early_ioremap_reset() or define the macros, but they describe the same situation in three different ways: calls reset defines the macros arm64 yes yes riscv no yes powerpc no no The existing comment is vague and allows all three. Replace it with comments that make it clear when the reset and the macros are needed. No functional change. Signed-off-by: Sang-Heon Jeon --- mm/early_ioremap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c index 96c29b9dc85d..6215b90dfef3 100644 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c @@ -47,15 +47,19 @@ pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr, return prot; } +/* + * Only architectures whose early_ioremap() must stop using __early_set_fixmap() + * after paging_init() need to call this. + */ void __init early_ioremap_reset(void) { after_paging_init = 1; } /* - * Generally, ioremap() is available after paging_init() has been called. - * Architectures wanting to allow early_ioremap after paging_init() can - * define __late_set_fixmap and __late_clear_fixmap to do the right thing. + * Only architectures that call early_ioremap_reset() need to define + * __late_set_fixmap() and __late_clear_fixmap(), which early_ioremap() uses + * instead of __early_set_fixmap() after the reset. */ #ifndef __late_set_fixmap static inline void __init __late_set_fixmap(enum fixed_addresses idx, -- 2.43.0