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 A3517220F47 for ; Sun, 11 Jan 2026 09:15:52 +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=1768122952; cv=none; b=td3qCrEpOXrbzQB8RbaoPStnjkOqx+9akbqQS5w2Ujz4LZQkPFrvkzxMsNriWVkjvTrMBuDxws+EN/EjKRtUz4zO6Nr8+O1KbtylpKYMqdpUUNkOFALBlMImhBks5rPAPtehCaqclAYW2LjRhzhY8wpMX5kahKfUsRboZCQcNLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768122952; c=relaxed/simple; bh=vbjMLCeL3E+BHAcw3z0Wl59L/POsMXdRm2kpQ2ZLdPE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l7XJr1v691najVS9JscTWv9ZQOOKAYKtDDcNg1KsXj/AhfRDvSoTPs57y9UI3caO8Nwqp8NS3zOG7nLN05E9RtU9FY/44Ruj8VpxlhrxAII7w3wP8KkrPCBKcYFGUI2VD68Cu+UWzNoQsvrPwulzyc1kzF085sZepG0jHosMQvQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Lsr9LR2N; 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="Lsr9LR2N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9F55C4CEF7; Sun, 11 Jan 2026 09:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768122952; bh=vbjMLCeL3E+BHAcw3z0Wl59L/POsMXdRm2kpQ2ZLdPE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lsr9LR2N2FZerJj9NxhVyb8CKoocbQ4PsJb8ZyWN2YPB3kWpaXMb86ocEufEXhGEK k9//Ye9LO4LjLBOjH7/5/K4fk9yeBBbYftmk8GBWNtORRRgYhGw7yxjroz08xlEOuo JsBdU60gmxDi1es+TjOmlV05LpdBMb3NL5eSExPdsbZqC18lq28V838E3S8Eh2mNTB KYC8pWwXuO5CNhdg/svh/fGQJwqDN+OiOpQnx+N8OS4fkHXbQ2wZAMJgthss4NLD9I UFYrnfmWqPcMuljZgF/kCUPaA/YZ6U5vLiKlYv0ux+dsduTDztQ+f5KoMKyF6uSGH3 ueDPvvST0BGtA== Date: Sun, 11 Jan 2026 11:15:45 +0200 From: Mike Rapoport To: Andrew Morton Cc: Hou Wenlong , 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: 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: <20260110155721.84af2e403badeeb29c7734e3@linux-foundation.org> 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(). > Reviewed-by: Andrew Morton > -- Sincerely yours, Mike.