From patchwork Thu Jan 4 09:07:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13510915 X-Patchwork-Delegate: bhelgaas@google.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 A2D2520307 for ; Thu, 4 Jan 2024 09:07:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TqBCh0vI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704359246; 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=Dyerj4wk/ZFwQTySswA1kbRd7v7F1+vxDBdnemG6spU=; b=TqBCh0vIW37ieVV9bfde8VaHnc8Vl+Kjr+F0Ls/V5ii3LaoE7nR6MwW2vyYCJ2JQ+4sezz EO+tT9cb66JvqpWL6h7qnIK/D1AYyBkPWTMeNDeEsKbMNSREgcZCbw48XJW7acT0Tz+eLi CE3qoEhFAnE9YcQdrgYvV8zcHtLgopQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-157-M3NrSdPTN3CA2W2_txCg_Q-1; Thu, 04 Jan 2024 04:07:25 -0500 X-MC-Unique: M3NrSdPTN3CA2W2_txCg_Q-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40d5b7b1946so619595e9.1 for ; Thu, 04 Jan 2024 01:07:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704359244; x=1704964044; 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=Dyerj4wk/ZFwQTySswA1kbRd7v7F1+vxDBdnemG6spU=; b=SJMvEdNLvpwd2ywEeP7drBTdO1/STQqDJvm6SA1iJqaETilHdTEzaNc9aJIawch5vE itIn3P0cJ65D+pexyMoOuEU87fF6ca43FfhD2KOOv28LDwVIzQJ8GxyACdvHeCgEY3C7 w00TuBIVqSOf+Ho1lbHMlVj7hKJi+sU4jcdv+gaTRKlIwEqlrjLtuCxF1ELMvamhAXL9 co08CxFvTbqqttM/e2r0lDfRxEu2jcBpsfPn3peZppb6+nuYGO+xc/ce1rBGcg87FM2l Ib82TzbMTeoa1E8ivkTpGs/rEb6qxCQGAZCYSxQkNdcTb0anbwQ9tyVj6jBbOAVlhpKR fSJQ== X-Gm-Message-State: AOJu0YwAVoWSxnCHRd2cearK9rm0pyynup6+B1Mghj4x9a4ih2GQFyba p/7E8jjE3rw6oGgj0vgev3Z4LhVtqGptxhzqtBhbmCmjHj+q+nhUqRC8reIIBqkvBHfZT5XkGSe ZhrxxmjRAvWXQIAbL6qcDQ733hPyj X-Received: by 2002:a5d:530b:0:b0:336:7110:38e2 with SMTP id e11-20020a5d530b000000b00336711038e2mr442465wrv.3.1704359244282; Thu, 04 Jan 2024 01:07:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnOXrQk2cIihpHok1C7CyYlsuReEbnUhcMXsqJWkEpa+4RuJPHmSYUUJZSaW06PyuJTJ2d1A== X-Received: by 2002:a5d:530b:0:b0:336:7110:38e2 with SMTP id e11-20020a5d530b000000b00336711038e2mr442456wrv.3.1704359243976; Thu, 04 Jan 2024 01:07:23 -0800 (PST) Received: from pstanner-thinkpadt14sgen1.muc.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id h15-20020a5d430f000000b0033740e109adsm8720864wrq.75.2024.01.04.01.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 01:07:23 -0800 (PST) From: Philipp Stanner To: Bjorn Helgaas , Arnd Bergmann , Johannes Berg , Randy Dunlap , NeilBrown , John Sanpe , Kent Overstreet , Niklas Schnelle , Philipp Stanner , 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 Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v5 2/5] lib: move pci_iomap.c to drivers/pci/ Date: Thu, 4 Jan 2024 10:07:06 +0100 Message-ID: <20240104090708.10571-4-pstanner@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240104090708.10571-2-pstanner@redhat.com> References: <20240104090708.10571-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Update MAINTAINERS file. Suggested-by: Danilo Krummrich Signed-off-by: Philipp Stanner Reviewed-by: Arnd Bergmann --- MAINTAINERS | 1 - drivers/pci/Kconfig | 5 +++++ drivers/pci/Makefile | 1 + lib/pci_iomap.c => drivers/pci/iomap.c | 3 --- lib/Kconfig | 3 --- lib/Makefile | 1 - 6 files changed, 6 insertions(+), 8 deletions(-) rename lib/pci_iomap.c => drivers/pci/iomap.c (99%) diff --git a/MAINTAINERS b/MAINTAINERS index edae86acdfdc..efa37ee81d30 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16762,7 +16762,6 @@ F: include/asm-generic/pci* F: include/linux/of_pci.h F: include/linux/pci* F: include/uapi/linux/pci* -F: lib/pci* PCIE DRIVER FOR AMAZON ANNAPURNA LABS M: Jonathan Chocron 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