Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp143460rdb; Thu, 25 Jan 2024 10:34:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpgn0vDPRHYEGftvxtkTLa8oA/qGkUYxvPcR9UZkCyfM3zvRvJHTkOlmiEevyC2LmS5QLy X-Received: by 2002:a05:6358:5d82:b0:175:750:a0a4 with SMTP id s2-20020a0563585d8200b001750750a0a4mr1666886rwm.56.1706207650011; Thu, 25 Jan 2024 10:34:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706207649; cv=pass; d=google.com; s=arc-20160816; b=i8OFfUajyz3vsJBTAJn7g5Qn/nUWZp2VUjUhnGmmKvugjb7bxgnHogNf18TLLRtOF/ qte81b/4j57/rosW+0SONrczPAkZ083dc16sH27ZdMYsqbOsMbNrzlMdjuiF7Cy3ZKDj xvzcY2LK19T3Xd3ySAJzPmE6/K54qH+c3DAdIJQLnpE928KWNrX4nRK+fjZbq37xY9h1 +K3p0g1Urj2J6g17Y8eTzn0UaaZeX++ENiLDQxFNkHx/tiJemTOfFVrZAUGb+BqCSXbO 1JGxnAfAn4yRZ1mPySoHD/8EnLQnAj9cMNsRoARuvBdz2RoStzvqbQqNTZnDhI39Bwog C4IQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:subject:cc:to:from:date:dkim-signature; bh=GCtM5l6llfCuYk7tkcu9M23M8zWiK3ePdOYUk9ge0Hw=; fh=m8R4SSV/Aw5HKZXjECk+KGBHrmCVOssBh25AuzeLPWE=; b=YVOpQ8AtgFm438PndMNplqWRL6M/E8LktB/8Dcsl8cmWgoJedKWaNWxP0rYXelN89v SOsgdGyU32zZ6dQAQxKx/ioFJDxcspfrmieFuTwV9dEosuLRxYkbVaJFXTF826Xmrll2 p5qCtr9axz3zqc1KXrAki4uh6RD68955vvQy14Og3oCAzjKDkkOKb7yxtEuCIoQYXGWP ph4ygG7sSnbXOLUGE8Q3tDvDZuHEQ2hlQY2xzU/3K/8V53VY0+fTRw6ECQLz8/VX4nlJ a0PSYXIPU1Fe9j+MANnDR6uI48RiEni8OZGbbQwVymVJ/GomdDS46b2frhHUW/F5ZpOV W6gg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S4wtXRhi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w37-20020a631625000000b005cd811e2ffesi13977065pgl.18.2024.01.25.10.34.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 10:34:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S4wtXRhi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9249E28B39C for ; Thu, 25 Jan 2024 18:34:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3C3713AA51; Thu, 25 Jan 2024 18:31:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S4wtXRhi" 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 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-kernel@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