From nobody Sun Feb 8 20:58:18 2026 Received: from out28-98.mail.aliyun.com (out28-98.mail.aliyun.com [115.124.28.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1602D35504F for ; Mon, 12 Jan 2026 12:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.98 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768220706; cv=none; b=Ekrnq5w5D1/Lc8plXv1nizwUvA6lTAx9MwaoddFHDR42ciVWzvveYUO+JHGcKFQBG1zNxN3DFHbsaqzO5+UcR1fcIAPZlHJwrtiu1N8ZPSXVj8KQ+1rms+pObiOy1ZQOvjeWSPWXY/xYVh1JnSpYPi76zzveTWHUw2p5Ubb3r8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768220706; c=relaxed/simple; bh=Mzbbi/1XJypj2yKl3/CAwh/qJhfJ5ndWtE7ggHa8ZDo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=OMLwyqcTjSmANmyv7O0Qwriq0bMDYZFDJOWzDXvwgYRuFPNy9yykallrECtBfJPm7gMgEcn/WSaeXMOdvJLQiCVEcooXJqbL0oCAiAiDIiqMVAy5bYVJsjoOLa19WU+v5thQfWwhR7/+hqs3fhXnMFQbAACk9xKq+ZHu3ZVeJxw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b=fv6tvBjR; arc=none smtp.client-ip=115.124.28.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="fv6tvBjR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1768220694; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=W6q6jrVZBcY3e5Gy+REWr2FSrmxj9FY94K4NJK1jOcE=; b=fv6tvBjRYQRVhdlCs/vazJlpUQWZ4AJLomTKGOYhuUfUuB2Q8nmwRsf+3gXGrheT6iFvwcLjv9+1ewKQkmt3rcy5touVGX7gnkIE+V0XTfa+037ANmVB9XYBWG5x20WQ4pIw+T4JfPgxLFVXBdnwam0J4VSUpBD2u2pAMeZU/jo= Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.g4ekSz3_1768220693 cluster:ay29) by smtp.aliyun-inc.com; Mon, 12 Jan 2026 20:24:54 +0800 From: Hou Wenlong To: linux-kernel@vger.kernel.org Cc: Hou Wenlong , Mike Rapoport , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org Subject: [PATCH mm-new] mm/early_ioremap: Clean up the use of WARN() for debugging Date: Mon, 12 Jan 2026 20:24:29 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Using WARN() for debugging is strange when nothing is wrong, so replace WARN(early_ioremap_debug) with pr_warn() + dump_stack(). Suggested-by: Mike Rapoport Signed-off-by: Hou Wenlong Acked-by: Mike Rapoport (Microsoft) --- mm/early_ioremap.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c index 3fdde074c9da..96c29b9dc85d 100644 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c @@ -30,6 +30,14 @@ static int __init early_ioremap_debug_setup(char *str) } early_param("early_ioremap_debug", early_ioremap_debug_setup); =20 +#define early_ioremap_dbg(fmt, args...) \ + do { \ + if (unlikely(early_ioremap_debug)) { \ + pr_warn(fmt, ##args); \ + dump_stack(); \ + } \ + } while (0) + static int after_paging_init __initdata; =20 pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_a= ddr, @@ -139,8 +147,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned lon= g size, pgprot_t prot) if (WARN_ON(nrpages > NR_FIX_BTMAPS)) return NULL; =20 - WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] =3D> %08lx + %08lx\n", - __func__, &phys_addr, size, slot, slot_virt[slot], offset); + early_ioremap_dbg("%s(%pa, %08lx) [%d] =3D> %08lx + %08lx\n", + __func__, &phys_addr, size, slot, slot_virt[slot], offset); =20 /* * Ok, go for it.. @@ -185,8 +193,7 @@ void __init early_iounmap(void __iomem *addr, unsigned = long size) __func__, addr, size, slot, prev_size[slot])) return; =20 - WARN(early_ioremap_debug, "%s(%p, %08lx) [%d]\n", - __func__, addr, size, slot); + early_ioremap_dbg("%s(%p, %08lx) [%d]\n", __func__, addr, size, slot); =20 virt_addr =3D (unsigned long)addr; if (WARN_ON(virt_addr < fix_to_virt(FIX_BTMAP_BEGIN))) base-commit: ab3d40bdac831c67e130fda12f3011505556500f --=20 2.31.1