Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp986047rdb; Fri, 1 Dec 2023 04:17:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuUNAMydZxVfJ4UDpOiClaJhkMAbcC+bbiGw/fkfwV5tFsmJb79Cxf+bWlWtAM90aLadNP X-Received: by 2002:a17:90b:350d:b0:285:b6b1:a55d with SMTP id ls13-20020a17090b350d00b00285b6b1a55dmr19899867pjb.12.1701433048204; Fri, 01 Dec 2023 04:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701433048; cv=none; d=google.com; s=arc-20160816; b=S0hZYoQCsOd8uNLe2JTQxWcgO9anunJY3Jx1HgbAgdxgDIigRPldQn7ZC6eE4GHPst HHfOU/Pp/LSo9rsH7tAb4ct8z9KfFtmfsz/hWzlRaXBm7EL8KEnzEtKyR5BrSK2/troO L0SWlkawnXDAgDPjcKyuDD10V6/ZRur+EwNKSfGu9Wu4KUgQjd1bLo5U7EOxjd+DzhME Q3/hejvGvBuV+4nxIuKIgdGWW/BDhkyEFmLy5GiyKfPHs0J8MeWaZr9vc2qGGfFzOxXz u5ZfJekHJr0jCAd0lVaTqsMY3yNg5mPbJAvRW34oT+6hXGF3K4sWlwt2Q6K63AhVHWff 7xTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b29/c8il4IwH3mmZXi9Lko6mOop1IfhpXMh6iHVA43k=; fh=3sddyTxxGmqpyR25yCtNS4zZL3DZaA4vT53asSK8SCA=; b=PACyI077trkpZueB+fLX0xnM8lsIVMTvCEohMSdFkQasIUhqEJ8tHdTriMmPnpvLgB qn0et5vhV46w3HsaZV+CXozW9mrf0xL2UWoTIE9+jc+cFRQuox3s14lCiwPEzqEG2ac/ O30LKIFjbhzCSJECj79GKgK03i4xl7NFRszxwQnxa52maS7ArVJ0ZCfeaeOCHRPIxUpO VqBhIULwHl5vn88zsBUmM9bVhj7Qlv2t/3qki0l/4rM7J/OLJ6Ygf7/vKU7UBPLnKnWc V1oPh+gndUeP3e9e05RBNNAXqFw+hpbC86tRPP2SPkU8GNfjwTSjl6z6yIs2XLy1Aji9 y9lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gCRHXEQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y12-20020a17090a86cc00b00283a54ed475si5548264pjv.110.2023.12.01.04.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 04:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gCRHXEQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A1D0280FE504; Fri, 1 Dec 2023 04:17:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378777AbjLAMQv (ORCPT + 99 others); Fri, 1 Dec 2023 07:16:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378763AbjLAMQt (ORCPT ); Fri, 1 Dec 2023 07:16:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C873D48 for ; Fri, 1 Dec 2023 04:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701433014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b29/c8il4IwH3mmZXi9Lko6mOop1IfhpXMh6iHVA43k=; b=gCRHXEQJ3tqRsmOP+jz+hkkiDndDKWvlot1LubcaRBbt8LG9PaDL1avu6dA6eZpvRk+1y8 UFooqaKCAcmJt7K9+oK7QH8MgM6f4F1MV6ji8hXH5WxCKAJ97zfrY8TAEXkX35MF326Iw5 q3klQmLbXslAHZ57cn9WxzjEgDhqOPo= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-KJzKkNISPyaGyBCq8hzGzg-1; Fri, 01 Dec 2023 07:16:53 -0500 X-MC-Unique: KJzKkNISPyaGyBCq8hzGzg-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-67a1f38b735so4549146d6.0 for ; Fri, 01 Dec 2023 04:16:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701433013; x=1702037813; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b29/c8il4IwH3mmZXi9Lko6mOop1IfhpXMh6iHVA43k=; b=WWV+Pw7nuqbq8QDrraZJush92tRQ4bH9smIEu9sf7GSNr7fqxY3BMuI6DgkdrrNFnH g2enT5NwBYYZ1PI24t5WBa1wa3aL6eJXTM70GbnvcuBiBUWtzn59lef1G90BRjtjPSxI K8D2uFheZfIwcCcZZnmdDn6owJ6jFaFpAHqTvno0IYT39mtCfd64I0hXOMxi6kMcIx00 +QUvl+jTOrkQtpIjBeMSrx13nuwGCYwEpx4cJAvGBVwraNa2av6vkb8AyZE5bJVHj867 fYZcHbZCO4CXI6b3hFTVtglxxwEiqigsRt3HbYDM6iuxjvbzDGp+qqiEcG0G7cen1GE1 Phqw== X-Gm-Message-State: AOJu0Ywiuary+on1M2jglaEmUUKZeVVPrhPsKJ7G5hPL9VEVcGLzHVEF 0xtGpXVAz4Ke1tYIx352t8bk5GJKLoz62FYS80nS0Odngll6HKEcL4EofvAenZDrIhD2aK4yQ1m JrGBfFwakmHOmZ5ZIOxn1Y8G3 X-Received: by 2002:a05:6214:94b:b0:67a:94bd:f7ee with SMTP id dn11-20020a056214094b00b0067a94bdf7eemr1924507qvb.2.1701433012797; Fri, 01 Dec 2023 04:16:52 -0800 (PST) X-Received: by 2002:a05:6214:94b:b0:67a:94bd:f7ee with SMTP id dn11-20020a056214094b00b0067a94bdf7eemr1924479qvb.2.1701433012534; Fri, 01 Dec 2023 04:16:52 -0800 (PST) Received: from pstanner-thinkpadt14sgen1.remote.csb ([2001:9e8:32e2:4e00:227b:d2ff:fe26:2a7a]) by smtp.gmail.com with ESMTPSA id b19-20020ac87553000000b00423b8a53641sm1426528qtr.29.2023.12.01.04.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 04:16:52 -0800 (PST) From: Philipp Stanner To: Bjorn Helgaas , Arnd Bergmann , Andrew Morton , Dan Williams , Jonathan Cameron , Jakub Kicinski , Dave Jiang , Uladzislau Koshchanka , NeilBrown , Niklas Schnelle , John Sanpe , Kent Overstreet , Philipp Stanner , "Masami Hiramatsu (Google)" , Kees Cook , David Gow , Yury Norov , "wuqiang.matt" , Jason Baron , Kefeng Wang , Ben Dooks , dakr@redhat.com Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH v2 1/4] lib: move pci_iomap.c to drivers/pci/ Date: Fri, 1 Dec 2023 13:16:19 +0100 Message-ID: <20231201121622.16343-2-pstanner@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231201121622.16343-1-pstanner@redhat.com> References: <20231201121622.16343-1-pstanner@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 01 Dec 2023 04:17:15 -0800 (PST) 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. Suggested-by: Danilo Krummrich Signed-off-by: Philipp Stanner --- drivers/pci/Kconfig | 5 +++++ drivers/pci/Makefile | 1 + lib/pci_iomap.c => drivers/pci/iomap.c | 3 --- lib/Kconfig | 3 --- lib/Makefile | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) rename lib/pci_iomap.c => drivers/pci/iomap.c (99%) diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 74147262625b..d35001589d88 100644 --- 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 + menuconfig PCI bool "PCI support" depends on HAVE_PCI diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index cc8b4e01e29d..64dcedccfc87 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -14,6 +14,7 @@ ifdef CONFIG_PCI obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_SYSFS) += slot.o obj-$(CONFIG_ACPI) += pci-acpi.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += iomap.o endif obj-$(CONFIG_OF) += of.o diff --git a/lib/pci_iomap.c b/drivers/pci/iomap.c similarity index 99% rename from lib/pci_iomap.c rename to drivers/pci/iomap.c index ce39ce9f3526..0a9d503ba533 100644 --- a/lib/pci_iomap.c +++ b/drivers/pci/iomap.c @@ -9,7 +9,6 @@ #include -#ifdef CONFIG_PCI /** * pci_iomap_range - create a virtual mapping cookie for a PCI BAR * @dev: PCI device that owns the BAR @@ -176,5 +175,3 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *p) EXPORT_SYMBOL(pci_iounmap); #endif /* ARCH_WANTS_GENERIC_PCI_IOUNMAP */ - -#endif /* CONFIG_PCI */ diff --git a/lib/Kconfig b/lib/Kconfig index 3ea1c830efab..1bf859166ac7 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -70,9 +70,6 @@ source "lib/math/Kconfig" config NO_GENERIC_PCI_IOPORT_MAP bool -config GENERIC_PCI_IOMAP - bool - config GENERIC_IOMAP bool select GENERIC_PCI_IOMAP diff --git a/lib/Makefile b/lib/Makefile index 6b09731d8e61..0800289ec6c5 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -153,7 +153,6 @@ CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any) obj-y += math/ crypto/ obj-$(CONFIG_GENERIC_IOMAP) += iomap.o -obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o -- 2.43.0