Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2674653rdb; Mon, 4 Dec 2023 04:39:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLpApWRHBWKXi3I/ZWxIjCbuFdaCaSRixi2aR5KopV2JYYSykDcvaxJty1QzN9zRFrbw0w X-Received: by 2002:a05:6a20:3d1c:b0:18f:a92:be2c with SMTP id y28-20020a056a203d1c00b0018f0a92be2cmr5711150pzi.5.1701693569963; Mon, 04 Dec 2023 04:39:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701693569; cv=none; d=google.com; s=arc-20160816; b=MUR8a+Rjk72JvrjQ9JDB0QEOijfNFlw9W699OsxEB2j4gW54YPUaEIR6fw4d27pKc2 7eBIuPGUt6LjZovTWTDK1yt+QwILWIvwsk29HMGfKB4fgtaAeCDzWPDPiw6LaES3496b YSSe7UjUFBw40RLAzcFfj3eusUzAyOppyGOj/2IQTXOgl85HWE9nantPt5pmTcL9kSsA 2KovGlanfBw7xcABc65ZV7irGawLIGfHc2s5CeXIqaB0zbkDZhvn8Xd+ZUqGYafDLeay TVx/rDLp12ALvNqMiH313fLHA48YiQjzK9eA8sdKiPvw5GZe1hxv0POF0yM9CQJC9qUp DrwQ== 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=OoJJxtshe3eicbElJTkZJFUUMS0e59nV8kbi1j784oU=; fh=tRoHOfp4L7MBeQ/QWUdWKN37lAyhtfSTgQCcgJsU3o0=; b=fyNxzik+89VgLyfNE9Y2KdwwJVn1YgpblDiL5VIyZQ/4A/CQ8MEFORArhvLk9Da1iG fG+RQcYTEK1Z0i2UNrtOiQbiQ+1NArUCqadFaCDNqyL0TbJXFRTLHhBht3M0DBuNDb9c K9z5qSzZhGy691MCDdVk8DoyHyUVDGqXwrRAFV6n80bSof0EWLve3hE3J+99BlgidrRa 6rs7sZ3G6hNmu0aTcl6WXsW/CpXacrbRrnoRmj2KAPXypzw0680q6a5t448sM2oX+d/t t4i9ZEyWghWRBZJ1UBdmcYHBd+kgmdzFcTgFfuFpkP8a5nUu/EHvLo3OBzhYdBEiOTwk qkBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eEIh5Wuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id mh9-20020a17090b4ac900b00286bb6f1ab9si1221202pjb.116.2023.12.04.04.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:39:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eEIh5Wuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 3602380A22F0; Mon, 4 Dec 2023 04:39:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343925AbjLDMjM (ORCPT + 99 others); Mon, 4 Dec 2023 07:39:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233500AbjLDMjB (ORCPT ); Mon, 4 Dec 2023 07:39:01 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C92819B for ; Mon, 4 Dec 2023 04:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701693546; 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=OoJJxtshe3eicbElJTkZJFUUMS0e59nV8kbi1j784oU=; b=eEIh5WufomzgC9N7+lAGwxPt5RapB23ukpvo/nU/NllnVlAnFanPHM66oXetQjfFcFIPok ES/aQThKXTltUk3wVFvXPsZPbNhwQZsdvTq86XCe/JnZsOyan6a4Z1HNoDlNZf53O4cGQK R5i7cQIhwlIanGdNIbuxd9m5JKm2YwY= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-FSG996TLOIi1B6CUT0_bhw-1; Mon, 04 Dec 2023 07:39:05 -0500 X-MC-Unique: FSG996TLOIi1B6CUT0_bhw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-40b4302eac2so7666265e9.1 for ; Mon, 04 Dec 2023 04:39:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701693544; x=1702298344; 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=OoJJxtshe3eicbElJTkZJFUUMS0e59nV8kbi1j784oU=; b=pYI83IC9hbN2i53c4nbq640YUYSlXX3jRjkU3V1MYE2yk6qhUHPDa80LY8GCSt2Dil nesn75Ny5lmLboXlWz/YhL9AgltGopSFl7lQktpVIl+bapF7RXe3zMkuG8NHkbxP7Pkz 9Giz3Avq2nIVc/wINoWZr/JJyDEpaEH7pnPkYqRarHVmCik1zJculHF6tXumcFzBohEX WBYoAuTnE0tn7t9LWW2xqlDwvE3k5/Bit3LhG8gI50jn0/wiSeTJa7gVgWIF8nyVgTVQ a5PoE0StDUEJHe+b6hLrpS/5VkkfWIwLfDEsB+5qUqIt+YvjIRByY34mhNWa4pM76/H4 2Tjg== X-Gm-Message-State: AOJu0YwwE2iS6lG6Kdj4NFeInmPGoK7E01jQ3AUQbqZxHzkFsphPy/LF /Oekisf/t8Z+0QaUHtqJqQD0hqA0blXSdJzRuETjMVljBoYnRgUEu9Ct9AysrcRNnflMq3sQQLl 1fzPAltGIAzCcHnsqqjSIPbaK X-Received: by 2002:a05:600c:45c6:b0:405:39bb:38a8 with SMTP id s6-20020a05600c45c600b0040539bb38a8mr22514035wmo.2.1701693544264; Mon, 04 Dec 2023 04:39:04 -0800 (PST) X-Received: by 2002:a05:600c:45c6:b0:405:39bb:38a8 with SMTP id s6-20020a05600c45c600b0040539bb38a8mr22514011wmo.2.1701693544004; Mon, 04 Dec 2023 04:39:04 -0800 (PST) Received: from pstanner-thinkpadt14sgen1.remote.csb ([2001:9e8:32c8:b00:227b:d2ff:fe26:2a7a]) by smtp.gmail.com with ESMTPSA id d4-20020a05600c3ac400b0040b538047b4sm18355935wms.3.2023.12.04.04.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:39:03 -0800 (PST) From: Philipp Stanner To: Bjorn Helgaas , Arnd Bergmann , Hanjun Guo , NeilBrown , Kent Overstreet , Jakub Kicinski , Niklas Schnelle , Uladzislau Koshchanka , John Sanpe , Dave Jiang , Philipp Stanner , "Masami Hiramatsu (Google)" , Kees Cook , David Gow , Herbert Xu , Shuah Khan , "wuqiang.matt" , Yury Norov , Jason Baron , Andrew Morton , Ben Dooks , dakr@redhat.com Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v3 2/5] lib: move pci_iomap.c to drivers/pci/ Date: Mon, 4 Dec 2023 13:38:29 +0100 Message-ID: <20231204123834.29247-3-pstanner@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231204123834.29247-1-pstanner@redhat.com> References: <20231204123834.29247-1-pstanner@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 04:39:28 -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 6e144b017c48..91285fcff1ba 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 @@ -178,5 +177,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