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 667C61DED40 for ; Sat, 10 Jan 2026 23:57:22 +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=1768089442; cv=none; b=H4pZnfoK/hZ9IaiACbUyhcJQdtBsqU9JkI891lkwIkA8it8jq72S/CCGygV1KM0RDGRNNAga75a/ig+knsuMcrdFoda3YydIa3wtpIgQVuJtad3sU27mZXQzTP6t+HNkXSeWCVOlK7IqOADXjny23c9uH94ne+9rFphZZPN+qKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768089442; c=relaxed/simple; bh=mHfbHG1wFYh4YWBIT6/g5Nu1yluPi5pyE6+5ZlNa4z0=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=H9qEiXZwcjyyE5T7tS9unDjfVHF6S1y8TN6uAJPuLKMGCHSlgKO2bmDV5axYEuCKK3TZdGqjdNJiUe9dGJyYZD3QyaOS+h7gA7kI7Yw1ITqfgJj/AaRVZ4jczAaL/IwwV1oBWDf48GGKVMTcVyF5gUVfTNKXeaC4Qxnhqx5eyYU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=B/S6dfKK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="B/S6dfKK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E54E7C4CEF1; Sat, 10 Jan 2026 23:57:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1768089442; bh=mHfbHG1wFYh4YWBIT6/g5Nu1yluPi5pyE6+5ZlNa4z0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B/S6dfKKPGCBNqrEpUiQxa9PV/WrRAt8QFAv8ZX9aVy8EfjjOcrphhLtQN7kZdO6x yKH4Ez6dLJga9MhgvtUuW+D7s/Es0SGyH+l0gcwiZhHx8rh7BBJdlp95RS35L3C6Gx iZyrP4OY6ncF0uVnKnNkypQKTgmIMl/hVmIG8hCI= Date: Sat, 10 Jan 2026 15:57:21 -0800 From: Andrew Morton To: Hou Wenlong Cc: linux-kernel@vger.kernel.org, David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org Subject: Re: [PATCH] mm/early_ioremap: Print the starting physical address in __early_ioremap() Message-Id: <20260110155721.84af2e403badeeb29c7734e3@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit 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! Reviewed-by: Andrew Morton