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 1E34413399E; Thu, 25 Jan 2024 18:31:09 +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=1706207470; cv=none; b=c6rcsRGiysT06u3B5vfAPAB0vetgxUznZ0YdgRa8m+qHFR3pBgOTKGRqdwoOroTAd9nQHzOGYnLVSI/TNOvOGRmenBkRZs9gXELYD4xyNVL6UlqqQWT9qFCVnD59gj8ZRq9MpJhC9B01ARFKtzEE/t26RiOtAUwk0mxxiDhAhf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706207470; c=relaxed/simple; bh=LTM9Rq0ah24lwvVn1y8YRCHc6j5ROIsgGb706zCSPEw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=QK91g528v5d+AXFY78YA3hDlkK0LNcTjXrSxCoH2thZf/M86CwAzMsdd1F6896a2xY+YCkvjD3I5APkkkkeMFvOd27VQK4gSkBrzbryZkUf5seE7PTLJ4pDzOzFeSZcOLECPd0lVgNJjzyatQvm/QHfZxxnmCZvK9aqfHnNOjFc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S4wtXRhi; 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="S4wtXRhi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AC4DC433F1; Thu, 25 Jan 2024 18:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706207469; bh=LTM9Rq0ah24lwvVn1y8YRCHc6j5ROIsgGb706zCSPEw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=S4wtXRhiDkmqHfxDMkUhXRmGNOlc2t6Dxgow2TFcrq/mWLHuIVpkF9dTF3+NdSXEw jZmifn0eFFKIR8Hf3ZuJ1j0R6xhj4QvHqIz9eeW9NbXopCjBKQQJ0CZF2PDzpL1Jjl zHbWVTgyhu11TS7DO4fXyVOMnXjWjP7l3x6q0o5Xqug0ySRSOwCA95u2546yaYGRFw 8c0o6Y8RJu0qV+KNPupq3A4FZK8BPZy50azhxOYhmYcBFK/zC7qj6gfujx6g4V140i n6tmfWv63Jx/zDFXdWVrAHs8lCM8GhxbySSBkxwbNzQ0FbR7fC3hxlKeYpfyZjTjGm LMjxQ2FYEQPAg== Date: Thu, 25 Jan 2024 12:31:07 -0600 From: Bjorn Helgaas To: Philipp Stanner Cc: Bjorn Helgaas , Arnd Bergmann , Johannes Berg , Randy Dunlap , NeilBrown , John Sanpe , Kent Overstreet , Niklas Schnelle , Dave Jiang , Uladzislau Koshchanka , "Masami Hiramatsu (Google)" , David Gow , Kees Cook , Rae Moar , Geert Uytterhoeven , "wuqiang.matt" , Yury Norov , Jason Baron , Thomas Gleixner , Marco Elver , Andrew Morton , Ben Dooks , dakr@redhat.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v5 RESEND 2/5] lib: move pci_iomap.c to drivers/pci/ Message-ID: <20240125183107.GA393314@bhelgaas> Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3abf071d12de5b69e146665dfb57386e3b0ddfe0.camel@redhat.com> On Thu, Jan 25, 2024 at 03:54:51PM +0100, Philipp Stanner wrote: > On Tue, 2024-01-23 at 14:20 -0600, Bjorn Helgaas wrote: > > On Thu, Jan 11, 2024 at 09:55:37AM +0100, Philipp Stanner wrote: > > > This file is guarded by an #ifdef CONFIG_PCI. It, consequently, > > > does not > > > belong to lib/ because it is not generic infrastructure. > > > > > > Move the file to drivers/pci/ and implement the necessary changes > > > to > > > Makefiles and Kconfigs. > > > ... > > > > > --- a/drivers/pci/Kconfig > > > +++ b/drivers/pci/Kconfig > > > @@ -13,6 +13,11 @@ config FORCE_PCI > > >         select HAVE_PCI > > >         select PCI > > >   > > > +# select this to provide a generic PCI iomap, > > > +# without PCI itself having to be defined > > > +config GENERIC_PCI_IOMAP > > > +       bool > > > > > --- a/lib/pci_iomap.c > > > +++ b/drivers/pci/iomap.c > > > @@ -9,7 +9,6 @@ > > >   > > >  #include > > >   > > > -#ifdef CONFIG_PCI > > > > IIUC, in the case where CONFIG_GENERIC_PCI_IOMAP=y but CONFIG_PCI was > > not set, pci_iomap.c was compiled but produced no code because the > > entire file was wrapped with this #ifdef. > > > > But after this patch, it looks like pci_iomap_range(), > > pci_iomap_wc_range(), etc., *will* be compiled? > > > > Is that what you intend, or did I miss something? > > They *will* be compiled when BOTH, CONFIG_PCI and > CONFIG_GENERIC_PCI_IOMAP have been set. I was asking about CONFIG_GENERIC_PCI_IOMAP=y but CONFIG_PCI unset. But the Makefile contains this: ifdef CONFIG_PCI obj-$(CONFIG_GENERIC_PCI_IOMAP) += iomap.o endif So iomap.c will not be compiled when CONFIG_PCI is unset, which is what I missed. Bjorn