From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 75EA2275870 for ; Mon, 12 Jan 2026 16:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768233627; cv=none; b=LSiTStKUK0PqGVtNNg400KG/yEaZivbGvWantwrLMje9cAWbhT4ZFfsBXg4i2+1et+7Hh3jt+APzckykWjY/KI5HOf0qmI5qYRedSdY0fXbIez9SBWFYKs06Iw+VAacSytnfotFHG8Trzqz4k724pdDRXRmnp5zr0qm19t80qPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768233627; c=relaxed/simple; bh=n8113yOzN7lCcBhp2c/oOHNFTBhReGgKAxXLFYobadM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YeAdFkX2UAzOB62w1OgXZXaQyHHoLsh1o4BtEWiemAVuKYfJ0DxqFRM41TTc+Su/dIb0abVJS2V6zstIb6Ez1tIHj2/PbkSI0mzSR6+rkLXPpVnPmdtRK43/aGi1J6UmabLV2UFzLX5mo+Bzo6Olo7jsZ+xgCQgo17pZ/YHn/+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f6Hng7b8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f6Hng7b8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CEBCC16AAE; Mon, 12 Jan 2026 16:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768233627; bh=n8113yOzN7lCcBhp2c/oOHNFTBhReGgKAxXLFYobadM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f6Hng7b8ysqnPik6LRV6KI2gsl/gCP0Ex7xxE0CTTs7XUWw6RpgMk/YE0Yn/Zc4gB OPimihWQRb5oxqtFTCkF6UubzC+yZF4wUwY6uQnp4yRQb4HZvMuoa4dDRGFZKiKcLs sFMzSztvR8yUduEtWPOMR+xAvyPGUgkvkHs2YF+vHMbTApwxwWdfKNMzOEzKnKPPZI 6ksVctSS1mopmOsMbH/5XvTvzvC2Yh7uyKhGnaWtbBYjOYEwtl/yG+R0sJH2nFcGrQ ZJzRpbLhrL+cJXO2f0sqj8Ieosi9oDsn3DcnbM65a3VvBF/sqxO1fWvVkDbN0XeFwg /oMyVKO62Y5LQ== Date: Mon, 12 Jan 2026 18:00:20 +0200 From: Mike Rapoport To: Hou Wenlong Cc: linux-kernel@vger.kernel.org, Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org Subject: Re: [PATCH mm-new] mm/early_ioremap: Clean up the use of WARN() for debugging Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Jan 12, 2026 at 08:24:29PM +0800, Hou Wenlong wrote: > 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); > > +#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; > > pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr, > @@ -139,8 +147,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) > if (WARN_ON(nrpages > NR_FIX_BTMAPS)) > return NULL; > > - WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n", > - __func__, &phys_addr, size, slot, slot_virt[slot], offset); > + early_ioremap_dbg("%s(%pa, %08lx) [%d] => %08lx + %08lx\n", > + __func__, &phys_addr, size, slot, slot_virt[slot], offset); > > /* > * 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; > > - 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); > > virt_addr = (unsigned long)addr; > if (WARN_ON(virt_addr < fix_to_virt(FIX_BTMAP_BEGIN))) > > base-commit: ab3d40bdac831c67e130fda12f3011505556500f > -- > 2.31.1 > -- Sincerely yours, Mike.