From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out198-24.us.a.mail.aliyun.com (out198-24.us.a.mail.aliyun.com [47.90.198.24]) (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 7B0B826B973 for ; Mon, 12 Jan 2026 03:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.198.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768188567; cv=none; b=CObskCwmEnp1eGcXWS9M8CQARwauXLv49k8KuqZOBsd5psQAiX01BQPWDcblOr4SNTRCgpqUIcdCVkmRc52eZ/ZHv+xp5zecR6We0iUV+19/RH37l931K4CYq9Rf8zfD3uaIzJ9DtPuTSCvBBeYPDZeyiP4QA6DJtIH3DxMqNc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768188567; c=relaxed/simple; bh=MarIdejwAhkLmjUUTfR8c0paNGQapRTKe01fcivPD/A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lif4A5Nf38SXUqBCDmH9ghJXssOl1++wTwdJdmqIOKLzSeYqMlFV0WAzSo7iNXxz4yGghLT0QVnO764sVsTxCFVxvWT9v0aS9m641Ad+uYsHIYg+ySkyVf6PGq4HO2bWAP9N95tAIEY2x9B1vTYN82o1LlTVCMAZHKwhiKVNzQ4= 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=W3joD+P3; arc=none smtp.client-ip=47.90.198.24 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="W3joD+P3" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1768188548; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; bh=qSGPjdxhk3/aWqe+xkuM6uIoGLfzd0PvSndY5oHIw6M=; b=W3joD+P3LSWgKHCMceUrr1BM/qyzQgJuMpRiKWEJckGP4Rq4SkNelMO2E3/ohQYYdFvKqANpqVt7zdsZMcW1hy/LDYy0+kU6cJaYB6zFQnXE4Z/wvBjHslYsris8Bo44g1A9dRUWYsYnsikOAsvAmKBCl/ifjwEB4ybDoEJqGwk= Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.g44jfNX_1768188547 cluster:ay29) by smtp.aliyun-inc.com; Mon, 12 Jan 2026 11:29:07 +0800 Date: Mon, 12 Jan 2026 11:29:07 +0800 From: Hou Wenlong To: Mike Rapoport Cc: Andrew Morton , linux-kernel@vger.kernel.org, David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org Subject: Re: [PATCH] mm/early_ioremap: Print the starting physical address in __early_ioremap() Message-ID: <20260112032907.GA60059@k08j02272.eu95sqa> References: <20260110155721.84af2e403badeeb29c7734e3@linux-foundation.org> 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: User-Agent: Mutt/1.5.21 (2010-09-15) On Sun, Jan 11, 2026 at 11:15:45AM +0200, Mike Rapoport wrote: > On Sat, Jan 10, 2026 at 03:57:21PM -0800, Andrew Morton wrote: > > On Fri, 9 Jan 2026 21:31:51 +0800 Hou Wenlong wrote: > > > > > The debug WARN() printing occurs after the while loop, so the > > > 'phys_addr' reflects the last physical address rather than the actual > > > starting physical address, which is not useful for debugging. To > > > simplify, the WARN() statement could be moved up before the loop instead > > > of introducing a new variable to record the original 'phys_addr' value. > > > Additionally, swap the print order of 'slot_virt[slot]' and 'offset', as > > > this will enhance output readability. > > > > > > > yep, thanks. > > > > > --- a/mm/early_ioremap.c > > > +++ b/mm/early_ioremap.c > > > @@ -139,6 +139,9 @@ __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); > > > + > > > /* > > > * Ok, go for it.. > > > */ > > > @@ -152,8 +155,6 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) > > > --idx; > > > --nrpages; > > > } > > > - WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n", > > > - __func__, &phys_addr, size, slot, offset, slot_virt[slot]); > > > > It's strange that this code uses WARN when nothing is wrong. The rest > > of the function uses WARN appropriately. But that's off-topic! > > It seems an historic thing. A nice cleanup would be to replace > WARN(early_ioremap_debug) with pr_warn() + dump_stack(). > Yes, I see that the initial code uses WARN(), so I didn't change it, as cleanup is a separate concern and may not be well-received. However, I can make the change as you suggested. Thanks! > > Reviewed-by: Andrew Morton > > > > -- > Sincerely yours, > Mike.