From patchwork Wed Jan 31 09:00:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 194618 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1761327dyb; Wed, 31 Jan 2024 01:07:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPOtShAWtIIj37FHM238TjByqrLvF3uKYP8T9xr0thVNGJ2iJVXfTYMEj+KJuzJRaNMs05 X-Received: by 2002:a05:6122:58f:b0:4b7:393e:df31 with SMTP id i15-20020a056122058f00b004b7393edf31mr644999vko.14.1706692055156; Wed, 31 Jan 2024 01:07:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706692055; cv=pass; d=google.com; s=arc-20160816; b=hxASxem8GPhuaHvXJgO0+KhGXNRX0o9HsGhwhPlIInJXIBhOQ1DugTgpe3RLuhIdCR 9AHsFfewH4zkx1seJtBhdMBSbSVs6bSig1PuiW8fkkSa1uxnlVgaP4gsMXJLrJE4WZXP p5a9Jk1D66F4/L7ljtCGaHYc6L2oMfb1sGmt+G1zt3r6AH9kFH1FSxHtHCO+8Kxq7U79 eROZB/0bM2N5ABRUCOnrMrT2IknnPIZ+5Lh0n6z/BF10vlWmqce8zVW6iTnj/gOTWWCN mlIdQe2ccKmy2AKgidfgRD2gnYkrIGdHsZ4uEwPo3LcDkTGfKkTrQaTVon1YXpR8K/Rt FzNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=b5ptHDBDyk/TuifsYW9hzTMONsgcOhj5PH/CL7IQ+VE=; fh=qPgkRPB0mvwHnqeYsgzIWIErDhrj8FIXeAa9TFig/Mc=; b=OziDKroNISq2iOQH3GTB/fg8UYFgBjSHCYsfmwVdyuWxbonioBkRIWzDiiqgJisIky Ie1EWZGL+IM5v1NB+NEOBnZNnWa1qF3vTCc82eTpFkHalfzodSxthh3Zv4F3LCbxlLFh +6mi2T22bEq20OGD94Mbw2Kx4rYNBwOBrtKjhMRJHLM6cGDKaRctFMO8G8VLysDZeZuW 509gxkNJp0CIqCt7rSjIq2NxdqJ6/uBhiSBcJhxLTflssYtp9XCp7kcSSLhNPuuBNPzc 12D7luoaY2rUAR5wq4SMUmM4LFLBZtBAp17VDuC+IlLxX4chrzbBBkI11VCDuW9a6pdb Z1fQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PLvZFaId; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-46093-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46093-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCWqNp6gtjcyPs7S8AHt2cVL7/pdaC5zOZcUdQ46VYj4hKlTfW8gUkr3AdzSf/9RvkmGcKACbs90RvUw4L7HUbyrhjDewQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gs15-20020a056214226f00b0068c461ae06fsi7875238qvb.258.2024.01.31.01.07.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 01:07:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46093-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PLvZFaId; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-46093-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46093-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D26FA1C2612D for ; Wed, 31 Jan 2024 09:07:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8C9278B7F; Wed, 31 Jan 2024 09:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PLvZFaId" 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 182FF74E26 for ; Wed, 31 Jan 2024 09:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706691654; cv=none; b=GGeaXC4IGf/+8cTKWplP7zGFBWvdAVjsVUW8GvRPL81pIaWMKyFYKcTq2aAjAScbddWOI3dlcpUZnUf0ru+Jkv9Gn3yK3oLonLk1Pd4+SYrAtVilB8tVwJd7aP2CxoszOyH2gnsbA0s8oS4qCEpdHHMA9hPUIA29OiJzIeuQ1bY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706691654; c=relaxed/simple; bh=RaHu28swfGeK4PAcsHpJVCWgBI9Fl85IjX62PHnbSPc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Uq7QcWWuNIIABUyHCaHaWaAq0l52ncHjGhFeHtGXTSkcih0VWtCv/WnHpQ8NQGSk7mqPcYMVi1olInLuAB+/7srfGgdFDvPVhpZrPSNESkg04nvKgD6eTtD//vdhLSzeChRm29wA4DFrVJCvex+oGRwhjCCfUxJvLr8++7eudNk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PLvZFaId; arc=none smtp.client-ip=170.10.129.124 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706691651; 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=b5ptHDBDyk/TuifsYW9hzTMONsgcOhj5PH/CL7IQ+VE=; b=PLvZFaIdDdDLL+yVFySPS/LP47jOBXExcbz7Fi+4Pk0hrA2LNEL+Le4khzHygnQlfkw4LI zTCjecIwX11UsXCXBaI74r7iR3Vunvah6M8DCUTC80cBSU2dbdp4z0u/pxt88q5Rz0gBkm 7rtVlQu90LMthTDXAEHVE7eq3KLf4vo= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-4fUHfs7fOqGnQ2MuhfBVow-1; Wed, 31 Jan 2024 04:00:48 -0500 X-MC-Unique: 4fUHfs7fOqGnQ2MuhfBVow-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-33ae2dd7d4aso119457f8f.1 for ; Wed, 31 Jan 2024 01:00:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706691647; x=1707296447; 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=b5ptHDBDyk/TuifsYW9hzTMONsgcOhj5PH/CL7IQ+VE=; b=ecMLK/UHq5lziIAhvbTzFX/wlyOwQ5FsfeJs4vkvEKLo9WBTSSqjUs0vbIdKbVlUfT YcU6/CVCxE60hV6RKMGMf5JTHuHTaKKLaY38ZSkNEwB4YaO6kBRuxT6QWEYlYuGiB5kF OoAQU+npQ1GxT11+yDAxjn8wkHkVZrg9Lk0bJ2wrgMEgpDV4d9FJQHL/6q3bV1YAdnJ2 LG1wrri+zBkTUes6Py6QIf1+Rh/LCbdldr4hIXq8t9PdLznoZeGpqP50ruF+4tjNUwZl G292U6El19onXNASIbYco83zwuIP2t9keeee3V9PBsO0Kvjo0KafEUTjCnlI5Zy63exl xBlA== X-Gm-Message-State: AOJu0YwASYdRB/wUE2O1tv+ub5RoBLbVzBcwjgKVtkiBM/KNie2D9HTg B9bJ6EIUmzOGgd6+8ygmQuRQeDQ7axgS535YPO9UzNk3rVQgh5LJP7rvnhGSTzwDp/IzTqoB8iw jnZkLvq6A004iRssv/GbDgZSj156F4ZAY4zmtVK/ftvNA9vAVOO0jjWekz6M0pQ== X-Received: by 2002:a05:600c:5103:b0:40f:b642:d58f with SMTP id o3-20020a05600c510300b0040fb642d58fmr114057wms.2.1706691647654; Wed, 31 Jan 2024 01:00:47 -0800 (PST) X-Received: by 2002:a05:600c:5103:b0:40f:b642:d58f with SMTP id o3-20020a05600c510300b0040fb642d58fmr114021wms.2.1706691647282; Wed, 31 Jan 2024 01:00:47 -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 t15-20020a05600c198f00b0040ee51f1025sm940261wmq.43.2024.01.31.01.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 01:00:46 -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 v6 2/4] lib: move pci_iomap.c to drivers/pci/ Date: Wed, 31 Jan 2024 10:00:21 +0100 Message-ID: <20240131090023.12331-3-pstanner@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240131090023.12331-1-pstanner@redhat.com> References: <20240131090023.12331-1-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789596328798792457 X-GMAIL-MSGID: 1789596328798792457 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. Update Documentation. Suggested-by: Danilo Krummrich Signed-off-by: Philipp Stanner Reviewed-by: Arnd Bergmann --- Documentation/driver-api/device-io.rst | 2 +- Documentation/driver-api/pci/pci.rst | 3 +++ 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 - 8 files changed, 10 insertions(+), 9 deletions(-) rename lib/pci_iomap.c => drivers/pci/iomap.c (99%) diff --git a/Documentation/driver-api/device-io.rst b/Documentation/driver-api/device-io.rst index d55384b106bd..d9ba2dfd1239 100644 --- a/Documentation/driver-api/device-io.rst +++ b/Documentation/driver-api/device-io.rst @@ -518,5 +518,5 @@ Public Functions Provided .. kernel-doc:: arch/x86/include/asm/io.h :internal: -.. kernel-doc:: lib/pci_iomap.c +.. kernel-doc:: drivers/pci/iomap.c :export: diff --git a/Documentation/driver-api/pci/pci.rst b/Documentation/driver-api/pci/pci.rst index 4843cfad4f60..bacf23bf1343 100644 --- a/Documentation/driver-api/pci/pci.rst +++ b/Documentation/driver-api/pci/pci.rst @@ -4,6 +4,9 @@ PCI Support Library .. kernel-doc:: drivers/pci/pci.c :export: +.. kernel-doc:: drivers/pci/iomap.c + :export: + .. kernel-doc:: drivers/pci/pci-driver.c :export: diff --git a/MAINTAINERS b/MAINTAINERS index 8d1052fa6a69..395fcaad63e7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16954,7 +16954,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 2829ddb0e316..c9725428e387 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 5ddda7c2ed9b..4557bb8a5256 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