From nobody Sat Feb 7 23:43:18 2026 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 0CEB529A31D; Thu, 15 May 2025 12:46:20 +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=1747313181; cv=none; b=rxptRuRxfJZpNn+H53AKV8fKsZIRzhRKOpnpY0d1JZCXaiTgVqJSJpoG7SOiM58DkZ0oKuRAqautUEJFP70CqdsarmvN++njkaSL1mfVADuSy8prJ8CKOwF8YeYNON1qjEjgcJCqQV1riB2FCI/jxlQ1JroccOUbsOVFMAaYMVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747313181; c=relaxed/simple; bh=OIj+PWlwAqawizPqQ/lX/FY4UjwOhKLrL4BOVLrF9ls=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FDKRQ72+9MwoSO5opdjXbH4FqZswbwe3IxQcAoeP2TCtnx+LriKwDKwcNrBravi6zndUx240UuGCLM29CpFCaA8Bdq4UtChQggPiixMZxFwYCuuoM29GoSZCXtisxGb/k2JRy/UtD8YQajqzIP+tdBKgOE3cpalu7wjIX7yl4ew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=R7ZEUV4S; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="R7ZEUV4S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C755EC4CEEB; Thu, 15 May 2025 12:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747313180; bh=OIj+PWlwAqawizPqQ/lX/FY4UjwOhKLrL4BOVLrF9ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R7ZEUV4Sb+nmr9V/jQMpt2+w/fKyprPN375uq4ZEjn/eIEaFNC9z/+OYaFmm4/5RH g6U9btkrbWQUcbIi3M3gis4/HpJYwMtFJcjJpgVM8uhtnp7Q5z3oIlV2B8kpTJ1z/x 88uv6q0NCq5t2XxnRAU0wD9NcYDt1A4aUfSpUIaehUULteUeEPRwSSTe7VeAfSByxX LZuQ0BpUkNctrtTSh7+yec5oZYJ/xN2tXXwkfoObZDMeRtw/J7iOdInSiMLlIcyJlp fRjSNojPYjWZgQG2VuCS6HW8SkGz2TF/ha6XgH8A17Mw/9dgdpzBBUw3VP71dYZ6y7 Lu0I47kke6gYw== From: Philipp Stanner To: Jonathan Corbet , Bjorn Helgaas , Philipp Stanner , Mark Brown , David Lechner , Andy Shevchenko , Zijun Hu , Yang Yingliang , Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 1/7] PCI: Remove hybrid devres nature from request functions Date: Thu, 15 May 2025 14:45:59 +0200 Message-ID: <20250515124604.184313-3-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515124604.184313-2-phasta@kernel.org> References: <20250515124604.184313-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" All functions based on __pci_request_region() and its release counter part support "hybrid mode", where the functions become managed if the PCI device was enabled with pcim_enable_device(). Removing this undesirable feature requires to remove all users who activated their device with that function and use one of the affected request functions. These users were: ASoC alsa cardreader cirrus i2c mmc mtd mtd mxser net spi vdpa vmwgfx all of which have been ported to always-managed pcim_ functions by now. The hybrid nature can, thus, be removed from the aforementioned PCI functions. Remove all function guards and documentation in pci.c related to the hybrid redirection. Adjust the visibility of pcim_release_region(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko --- drivers/pci/devres.c | 39 ++++++++++++--------------------------- drivers/pci/pci.c | 42 ------------------------------------------ drivers/pci/pci.h | 1 - 3 files changed, 12 insertions(+), 70 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index 73047316889e..5480d537f400 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -6,30 +6,13 @@ /* * On the state of PCI's devres implementation: * - * The older devres API for PCI has two significant problems: + * The older PCI devres API has one significant problem: * - * 1. It is very strongly tied to the statically allocated mapping table in - * struct pcim_iomap_devres below. This is mostly solved in the sense o= f the - * pcim_ functions in this file providing things like ranged mapping by - * bypassing this table, whereas the functions that were present in the= old - * API still enter the mapping addresses into the table for users of th= e old - * API. - * - * 2. The region-request-functions in pci.c do become managed IF the devic= e has - * been enabled with pcim_enable_device() instead of pci_enable_device(= ). - * This resulted in the API becoming inconsistent: Some functions have = an - * obviously managed counter-part (e.g., pci_iomap() <-> pcim_iomap()), - * whereas some don't and are never managed, while others don't and are - * _sometimes_ managed (e.g. pci_request_region()). - * - * Consequently, in the new API, region requests performed by the pcim_ - * functions are automatically cleaned up through the devres callback - * pcim_addr_resource_release(). - * - * Users of pcim_enable_device() + pci_*region*() are redirected in - * pci.c to the managed functions here in this file. This isn't exactly - * perfect, but the only alternative way would be to port ALL drivers - * using said combination to pcim_ functions. + * It is very strongly tied to the statically allocated mapping table in s= truct + * pcim_iomap_devres below. This is mostly solved in the sense of the pcim_ + * functions in this file providing things like ranged mapping by bypassing + * this table, whereas the functions that were present in the old API still + * enter the mapping addresses into the table for users of the old API. * * TODO: * Remove the legacy table entirely once all calls to pcim_iomap_table() in @@ -89,10 +72,12 @@ static inline void pcim_addr_devres_clear(struct pcim_a= ddr_devres *res) =20 /* * The following functions, __pcim_*_region*, exist as counterparts to the - * versions from pci.c - which, unfortunately, can be in "hybrid mode", i.= e., - * sometimes managed, sometimes not. + * versions from pci.c - which, unfortunately, were in the past in "hybrid + * mode", i.e., sometimes managed, sometimes not. * - * To separate the APIs cleanly, we define our own, simplified versions he= re. + * To separate the APIs cleanly, we defined our own, simplified versions h= ere. + * + * TODO: unify those functions with the counterparts in pci.c */ =20 /** @@ -893,7 +878,7 @@ int pcim_request_region_exclusive(struct pci_dev *pdev,= int bar, const char *nam * Release a region manually that was previously requested by * pcim_request_region(). */ -void pcim_release_region(struct pci_dev *pdev, int bar) +static void pcim_release_region(struct pci_dev *pdev, int bar) { struct pcim_addr_devres res_searched; =20 diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e77d5b53c0ce..4acc23823637 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3937,16 +3937,6 @@ void pci_release_region(struct pci_dev *pdev, int ba= r) if (!pci_bar_index_is_valid(bar)) return; =20 - /* - * This is done for backwards compatibility, because the old PCI devres - * API had a mode in which the function became managed if it had been - * enabled with pcim_enable_device() instead of pci_enable_device(). - */ - if (pci_is_managed(pdev)) { - pcim_release_region(pdev, bar); - return; - } - if (pci_resource_len(pdev, bar) =3D=3D 0) return; if (pci_resource_flags(pdev, bar) & IORESOURCE_IO) @@ -3984,13 +3974,6 @@ static int __pci_request_region(struct pci_dev *pdev= , int bar, if (!pci_bar_index_is_valid(bar)) return -EINVAL; =20 - if (pci_is_managed(pdev)) { - if (exclusive =3D=3D IORESOURCE_EXCLUSIVE) - return pcim_request_region_exclusive(pdev, bar, name); - - return pcim_request_region(pdev, bar, name); - } - if (pci_resource_len(pdev, bar) =3D=3D 0) return 0; =20 @@ -4027,11 +4010,6 @@ static int __pci_request_region(struct pci_dev *pdev= , int bar, * * Returns 0 on success, or %EBUSY on error. A warning * message is also printed on failure. - * - * NOTE: - * This is a "hybrid" function: It's normally unmanaged, but becomes manag= ed - * when pcim_enable_device() has been called in advance. This hybrid featu= re is - * DEPRECATED! If you want managed cleanup, use the pcim_* functions inste= ad. */ int pci_request_region(struct pci_dev *pdev, int bar, const char *name) { @@ -4084,11 +4062,6 @@ static int __pci_request_selected_regions(struct pci= _dev *pdev, int bars, * @name: Name of the driver requesting the resources * * Returns: 0 on success, negative error code on failure. - * - * NOTE: - * This is a "hybrid" function: It's normally unmanaged, but becomes manag= ed - * when pcim_enable_device() has been called in advance. This hybrid featu= re is - * DEPRECATED! If you want managed cleanup, use the pcim_* functions inste= ad. */ int pci_request_selected_regions(struct pci_dev *pdev, int bars, const char *name) @@ -4104,11 +4077,6 @@ EXPORT_SYMBOL(pci_request_selected_regions); * @name: name of the driver requesting the resources * * Returns: 0 on success, negative error code on failure. - * - * NOTE: - * This is a "hybrid" function: It's normally unmanaged, but becomes manag= ed - * when pcim_enable_device() has been called in advance. This hybrid featu= re is - * DEPRECATED! If you want managed cleanup, use the pcim_* functions inste= ad. */ int pci_request_selected_regions_exclusive(struct pci_dev *pdev, int bars, const char *name) @@ -4144,11 +4112,6 @@ EXPORT_SYMBOL(pci_release_regions); * * Returns 0 on success, or %EBUSY on error. A warning * message is also printed on failure. - * - * NOTE: - * This is a "hybrid" function: It's normally unmanaged, but becomes manag= ed - * when pcim_enable_device() has been called in advance. This hybrid featu= re is - * DEPRECATED! If you want managed cleanup, use the pcim_* functions inste= ad. */ int pci_request_regions(struct pci_dev *pdev, const char *name) { @@ -4173,11 +4136,6 @@ EXPORT_SYMBOL(pci_request_regions); * * Returns 0 on success, or %EBUSY on error. A warning message is also * printed on failure. - * - * NOTE: - * This is a "hybrid" function: It's normally unmanaged, but becomes manag= ed - * when pcim_enable_device() has been called in advance. This hybrid featu= re is - * DEPRECATED! If you want managed cleanup, use the pcim_* functions inste= ad. */ int pci_request_regions_exclusive(struct pci_dev *pdev, const char *name) { diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index b81e99cd4b62..8c3e5fb2443a 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -1062,7 +1062,6 @@ static inline pci_power_t mid_pci_get_power_state(str= uct pci_dev *pdev) int pcim_intx(struct pci_dev *dev, int enable); int pcim_request_region_exclusive(struct pci_dev *pdev, int bar, const char *name); -void pcim_release_region(struct pci_dev *pdev, int bar); =20 /* * Config Address for PCI Configuration Mechanism #1 --=20 2.49.0 From nobody Sat Feb 7 23:43:18 2026 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 3262929B209; Thu, 15 May 2025 12:46:23 +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=1747313184; cv=none; b=XdyFXpSRZumyhri+D7tEAIn5s5NqUQ6Yzid94evVQb9RgsJSY4mNpUfeAcpZWyTgYjbxqTBT89T5AsZUh5Wo0MNrm4Z2rt1boi3/6ASZAX4xxRriJOVVnGLal/L+JV38lk/IiIuAIM3/EdIgVIF48T2lc1tvW0OSfm63L+G4E84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747313184; c=relaxed/simple; bh=/SrqagrckwF6dgNkAoSXSSD6RhUeKwgwHwvPTIQ04bY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SF0qcLCxtwcaRtOVsclbnr1oClex5nthT6YdzLVjZDAlv8+BsjmZ3MdHHbLPFNS65eegpfy439u8rmGMUMXtvIEwlgWmYvBRx40J6tRW65BOGdOdCTRDstlZoS7VOTXg+gduc0OxRei60ceOpaC5KoP8HYC04UzAiC25oldqojo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D0MiLkKr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D0MiLkKr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9BD7C4CEF1; Thu, 15 May 2025 12:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747313183; bh=/SrqagrckwF6dgNkAoSXSSD6RhUeKwgwHwvPTIQ04bY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D0MiLkKrQ0MoMun9OU8NJfFYgPyEd4w8monEHSuh9udnUPXC8txU0pcKl6twIcTs4 r0CoBn+RslTYElcxHXBK/VgXmces5xzGVTePXZLXHBrF+9y99nW/q/O6OfRMZ6DqsW hoTtv1j8dXR1YN9EdmVNH8/V6tFnHL1W1I5fwk64dixlaSN+7LkqgmcE3U7M8thyfZ g7UaU9ebXFMxNRrNG4CvLQErFY8eLsJEv04CwLk59E23N7NYl883AkJgEFssyVD82d Yc4kFoimE5zQzliqu80chJ+yVM5AC/UARcZfxibwVws/hgPuCcnZfQTEQ9vg81FO0n EIALOShswR1YQ== From: Philipp Stanner To: Jonathan Corbet , Bjorn Helgaas , Philipp Stanner , Mark Brown , David Lechner , Andy Shevchenko , Zijun Hu , Yang Yingliang , Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 2/7] Docu: PCI: Update pcim_enable_device() Date: Thu, 15 May 2025 14:46:00 +0200 Message-ID: <20250515124604.184313-4-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515124604.184313-2-phasta@kernel.org> References: <20250515124604.184313-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pcim_enable_device() is not related anymore to switching the mode of operation of any functions. It merely sets up a devres callback for automatically disabling the PCI device on driver detach. Adjust the function's documentation. Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko --- Documentation/driver-api/driver-model/devres.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentati= on/driver-api/driver-model/devres.rst index d75728eb05f8..9443911c4742 100644 --- a/Documentation/driver-api/driver-model/devres.rst +++ b/Documentation/driver-api/driver-model/devres.rst @@ -391,7 +391,7 @@ PCI devm_pci_remap_cfgspace() : ioremap PCI configuration space devm_pci_remap_cfg_resource() : ioremap PCI configuration space resource =20 - pcim_enable_device() : after success, some PCI ops become managed + pcim_enable_device() : after success, PCI dev gets deactivated automati= cally pcim_iomap() : do iomap() on a single BAR pcim_iomap_regions() : do request_region() and iomap() on multiple BARs pcim_iomap_table() : array of mapped addresses indexed by BAR --=20 2.49.0 From nobody Sat Feb 7 23:43:18 2026 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 9069829A9F5; Thu, 15 May 2025 12:46:27 +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=1747313187; cv=none; b=V7+AGVyDzUCNjA6bE9fObb8tSBitGo7ezXs3BaCMgnMK6n0Iy8vvvnRD72qYX6IKqqRTRqND1vlzgMUe+hm9Sjbb/3XFSusNGE8oCk/AJ2aMwGRvZXDj+xVbynpbGGYmuJud2OFiZzuZHlK3dU+wSB5ah1irnV7SnB0FyzPm6KE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747313187; c=relaxed/simple; bh=anJhc65G7bGsG8RZ5DM3uxXKassmvqJOGcJ5+fNqfr8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K2CRMAmdlmaz4HDKLX4lnv59bO3tbEYABV13KDoVURmYucdGr879Qm+J2oKSN0GCP/gRtHogp0usRt/yJWvBxickk0pmUk49B34tnTmD7lkQOjENPl9MIDv6y2t20aGD4FkmTaF81ahij0/AjcDh5OZMZxwCI0gsjg0Ix1Rv424= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oWIFx1dO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oWIFx1dO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25895C4CEE7; Thu, 15 May 2025 12:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747313187; bh=anJhc65G7bGsG8RZ5DM3uxXKassmvqJOGcJ5+fNqfr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oWIFx1dOLtGGOIdemKnG8RCiH6wALzTPSUfdksV9HMAlmfew2pfNn255FykCJkYYg K6Mtl/anRp6eI/8h9IlqoYehebJGMF6PjL0MHQmadRyq8mkeiG/e2SwRGlcbLpEViC rd5CeeVKMgyDAtjQac+SUZUb4WrHtyEqrMufWNgjsfYc/GQQcKwasedBj1yPC9DnzJ K8K0hJX94XOpZDn5PxvoIZWcaFqOpoKjC60mhnH5nAyqrInbqA5wzoBoEElmoTVkw9 Elgt6zdwGGPbdBi1PUPP+3keEDrnfZShvq33GL49LqFL9mzW8uehavU6ghm/uiAsrl WDw4PZaJsbVEQ== From: Philipp Stanner To: Jonathan Corbet , Bjorn Helgaas , Philipp Stanner , Mark Brown , David Lechner , Andy Shevchenko , Zijun Hu , Yang Yingliang , Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 3/7] PCI: Remove pcim_request_region_exclusive() Date: Thu, 15 May 2025 14:46:01 +0200 Message-ID: <20250515124604.184313-5-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515124604.184313-2-phasta@kernel.org> References: <20250515124604.184313-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pcim_request_region_exclusive() was only needed for redirecting the relatively exotic exclusive request functions in pci.c in case of them operating in managed mode. The managed nature has been removed from those functions and no one else uses pcim_request_region_exclusive(). Remove pcim_request_region_exclusive(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko --- drivers/pci/devres.c | 18 ------------------ drivers/pci/pci.h | 2 -- 2 files changed, 20 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index 5480d537f400..769b92f4f66a 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -852,24 +852,6 @@ int pcim_request_region(struct pci_dev *pdev, int bar,= const char *name) } EXPORT_SYMBOL(pcim_request_region); =20 -/** - * pcim_request_region_exclusive - Request a PCI BAR exclusively - * @pdev: PCI device to request region for - * @bar: Index of BAR to request - * @name: Name of the driver requesting the resource - * - * Returns: 0 on success, a negative error code on failure. - * - * Request region specified by @bar exclusively. - * - * The region will automatically be released on driver detach. If desired, - * release manually only with pcim_release_region(). - */ -int pcim_request_region_exclusive(struct pci_dev *pdev, int bar, const cha= r *name) -{ - return _pcim_request_region(pdev, bar, name, IORESOURCE_EXCLUSIVE); -} - /** * pcim_release_region - Release a PCI BAR * @pdev: PCI device to operate on diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 8c3e5fb2443a..cfc9e71a4d84 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -1060,8 +1060,6 @@ static inline pci_power_t mid_pci_get_power_state(str= uct pci_dev *pdev) #endif =20 int pcim_intx(struct pci_dev *dev, int enable); -int pcim_request_region_exclusive(struct pci_dev *pdev, int bar, - const char *name); =20 /* * Config Address for PCI Configuration Mechanism #1 --=20 2.49.0 From nobody Sat Feb 7 23:43:18 2026 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 7A42629B76A; Thu, 15 May 2025 12:46:30 +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=1747313190; cv=none; b=pcnYtTY5HwxZVv7rJfG1jxEXyAYvFe6YzyOYm3Acy+AXYqvp8g7K+E+vp1wEFCtBKkmBbfnnCgUZFZ8HPhKfWiJIYDUW5/VIWONWYf405qtcz5aPayRepk7bWef2LzK67aH94n41sc23aiNczMctPNSmiIFZaGMpQBgjxZWdIE0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747313190; c=relaxed/simple; bh=GU4MOVdN8oQjUQHsT+2DBnOtiOsxgXpBZ4DC2Y4gtzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o2PNZh3o0N8elw+49MfsMXLe39Yot6qzjs7aGfrkWgWmUQCLtcfVVj+gw/q6+SimxvduHQchWpxGMGTjlW4JrCOpz2DhB5yUwbctVQh5R+0yXD/eGkWFc/O+DTCV2v4VAAxO+RBfeR89GS6LI4lo0CkcYlEvsQBryLCVE3k9UJA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SNzhjmZs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SNzhjmZs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83B23C4CEEB; Thu, 15 May 2025 12:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747313190; bh=GU4MOVdN8oQjUQHsT+2DBnOtiOsxgXpBZ4DC2Y4gtzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SNzhjmZshn9faqlOO/UXUdkROEcpyoGl06usHmEI6Rs6DEakxPDxYM3LHRADfhA9Q fxtvD7kqCW1Tt8TLxF6SpktCP3T2jbVB21qz9dz3E+3DOlYukoFr88hYYaDLuGaRIJ ArXxFcsc357ppXX3UOj1czz28s7VYrTxCN7ZKmpjop+ART4i6koNW/nqn+gjGWYc4B 3+GBrzu8HL0LKnbdHkwenW5MNaiuTaUyOJAXc6O68sqCARwudX/4vIKo+RHlqW7WPk SwBZzRPO3KkKxMdMY0jaP71jbrxlgQG1KRIauBCZ4DYfkK+7pQKLM9Sn06Al7AQLZf vSPoEMaSJg50w== From: Philipp Stanner To: Jonathan Corbet , Bjorn Helgaas , Philipp Stanner , Mark Brown , David Lechner , Andy Shevchenko , Zijun Hu , Yang Yingliang , Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 4/7] PCI: Remove request_flags relict from devres Date: Thu, 15 May 2025 14:46:02 +0200 Message-ID: <20250515124604.184313-6-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515124604.184313-2-phasta@kernel.org> References: <20250515124604.184313-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pcim_request_region_exclusive(), the only user in PCI devres that needed exclusive region requests, has been removed. All features related to exclusive requests can, therefore, be removed, too. Remove them. Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko --- drivers/pci/devres.c | 46 +++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index 769b92f4f66a..ae79e5f95c8a 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -808,31 +808,6 @@ int pcim_iomap_regions(struct pci_dev *pdev, int mask,= const char *name) } EXPORT_SYMBOL(pcim_iomap_regions); =20 -static int _pcim_request_region(struct pci_dev *pdev, int bar, const char = *name, - int request_flags) -{ - int ret; - struct pcim_addr_devres *res; - - if (!pci_bar_index_is_valid(bar)) - return -EINVAL; - - res =3D pcim_addr_devres_alloc(pdev); - if (!res) - return -ENOMEM; - res->type =3D PCIM_ADDR_DEVRES_TYPE_REGION; - res->bar =3D bar; - - ret =3D __pcim_request_region(pdev, bar, name, request_flags); - if (ret !=3D 0) { - pcim_addr_devres_free(res); - return ret; - } - - devres_add(&pdev->dev, res); - return 0; -} - /** * pcim_request_region - Request a PCI BAR * @pdev: PCI device to request region for @@ -848,7 +823,26 @@ static int _pcim_request_region(struct pci_dev *pdev, = int bar, const char *name, */ int pcim_request_region(struct pci_dev *pdev, int bar, const char *name) { - return _pcim_request_region(pdev, bar, name, 0); + int ret; + struct pcim_addr_devres *res; + + if (!pci_bar_index_is_valid(bar)) + return -EINVAL; + + res =3D pcim_addr_devres_alloc(pdev); + if (!res) + return -ENOMEM; + res->type =3D PCIM_ADDR_DEVRES_TYPE_REGION; + res->bar =3D bar; + + ret =3D __pcim_request_region(pdev, bar, name, 0); + if (ret !=3D 0) { + pcim_addr_devres_free(res); + return ret; + } + + devres_add(&pdev->dev, res); + return 0; } EXPORT_SYMBOL(pcim_request_region); =20 --=20 2.49.0 From nobody Sat Feb 7 23:43:18 2026 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 4728029AAE6; Thu, 15 May 2025 12:46:33 +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=1747313194; cv=none; b=bdNJ0Z2JjAEmfDVgE/6LCD+mYFbvwhpWdCmezxaQUrzZRiQ847jNC9JfyMWtzE2Ibq4a+Z6sCfLz515A06jpu3gA44fMdaHSbGA/tJZYjiBno16apHfOqARYWpesLb+Pw5t3VZfufOPcYu80jRSWst4pDCjRdxg6pQuFaxk01io= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747313194; c=relaxed/simple; bh=UQAWPez3Fzrr6zEIxOxuQHIJ3TdMQpWgR9D4TZwbenI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qph4nkhgY8a3jVM3ZEYdoEx9YsyXq8xRMBZwksdXShipSXYDXW29wgF51yEfU4hHQ0F8Usg33E81ujR2lCPfzlIQdQwwcRlKJJ/CafKywGP81M15UaRRLD27iLHqJQ6L6mzx541fYEQWmI9fNCpGbZy69la1UNrt4x+uwsnpIdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XzMB+LVY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XzMB+LVY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E18B0C4CEE7; Thu, 15 May 2025 12:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747313193; bh=UQAWPez3Fzrr6zEIxOxuQHIJ3TdMQpWgR9D4TZwbenI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XzMB+LVYPCvBIOcEfPTtWqvd3enfhhbA1wpn9w1eORevyG/tYha17ot9FwxOUUlM8 j/yrpCB/QWAhIOXJbRP6MImzMs1+H2wug9oEtj9wYVVqUUeeGWNeqpwJhGkNm+nVYV Nj70sS3fWm6i69MeoR7VFzmcHqGK3svAy9t+iCl8tjFrXvVupxgN4k5ZFkUKAa7PKJ Q8/NLHTzQZd7BgRCHyXz49rtn4aSSaR3Yh7V6O6bZ2pmJMHZOK6bgVjS+g7QKojOm+ cPKJpRlaLZvWSCPoA7xTWzjoUGw89CxET4QtANJZLYR2Wu3yaUYGBYjKdQXhgpsxA6 2Ivx/qH6sAs+g== From: Philipp Stanner To: Jonathan Corbet , Bjorn Helgaas , Philipp Stanner , Mark Brown , David Lechner , Andy Shevchenko , Zijun Hu , Yang Yingliang , Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 5/7] PCI: Remove redundant set of request funcs Date: Thu, 15 May 2025 14:46:03 +0200 Message-ID: <20250515124604.184313-7-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515124604.184313-2-phasta@kernel.org> References: <20250515124604.184313-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the demangling of the hybrid devres functions within PCI was implemented, it was necessary to implement several PCI functions a second time to avoid cyclic calls, since the hybrid functions in pci.c call the managed functions in devres.c, which in turn can be directly used outside of PCI and needed request infrastructure, too. Therefore, __pcim_request_region_range(), __pci_release_region_range() and wrappers around them were implemented. The hybrid nature has recently been removed from all functions in pci.c. Therefore, the functions in devres.c can now directly use their counterparts in pci.c without causing a call-cycle. Remove __pcim_request_region_range(), __pcim_request_region_range() and the wrappers. Use the corresponding request functions from pci.c in devres.c Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko --- drivers/pci/devres.c | 110 ++----------------------------------------- 1 file changed, 5 insertions(+), 105 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index ae79e5f95c8a..4a4604b78b90 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -70,106 +70,6 @@ static inline void pcim_addr_devres_clear(struct pcim_a= ddr_devres *res) res->bar =3D -1; } =20 -/* - * The following functions, __pcim_*_region*, exist as counterparts to the - * versions from pci.c - which, unfortunately, were in the past in "hybrid - * mode", i.e., sometimes managed, sometimes not. - * - * To separate the APIs cleanly, we defined our own, simplified versions h= ere. - * - * TODO: unify those functions with the counterparts in pci.c - */ - -/** - * __pcim_request_region_range - Request a ranged region - * @pdev: PCI device the region belongs to - * @bar: BAR the range is within - * @offset: offset from the BAR's start address - * @maxlen: length in bytes, beginning at @offset - * @name: name of the driver requesting the resource - * @req_flags: flags for the request, e.g., for kernel-exclusive requests - * - * Returns: 0 on success, a negative error code on failure. - * - * Request a range within a device's PCI BAR. Sanity check the input. - */ -static int __pcim_request_region_range(struct pci_dev *pdev, int bar, - unsigned long offset, - unsigned long maxlen, - const char *name, int req_flags) -{ - resource_size_t start =3D pci_resource_start(pdev, bar); - resource_size_t len =3D pci_resource_len(pdev, bar); - unsigned long dev_flags =3D pci_resource_flags(pdev, bar); - - if (start =3D=3D 0 || len =3D=3D 0) /* Unused BAR. */ - return 0; - if (len <=3D offset) - return -EINVAL; - - start +=3D offset; - len -=3D offset; - - if (len > maxlen && maxlen !=3D 0) - len =3D maxlen; - - if (dev_flags & IORESOURCE_IO) { - if (!request_region(start, len, name)) - return -EBUSY; - } else if (dev_flags & IORESOURCE_MEM) { - if (!__request_mem_region(start, len, name, req_flags)) - return -EBUSY; - } else { - /* That's not a device we can request anything on. */ - return -ENODEV; - } - - return 0; -} - -static void __pcim_release_region_range(struct pci_dev *pdev, int bar, - unsigned long offset, - unsigned long maxlen) -{ - resource_size_t start =3D pci_resource_start(pdev, bar); - resource_size_t len =3D pci_resource_len(pdev, bar); - unsigned long flags =3D pci_resource_flags(pdev, bar); - - if (len <=3D offset || start =3D=3D 0) - return; - - if (len =3D=3D 0 || maxlen =3D=3D 0) /* This an unused BAR. Do nothing. */ - return; - - start +=3D offset; - len -=3D offset; - - if (len > maxlen) - len =3D maxlen; - - if (flags & IORESOURCE_IO) - release_region(start, len); - else if (flags & IORESOURCE_MEM) - release_mem_region(start, len); -} - -static int __pcim_request_region(struct pci_dev *pdev, int bar, - const char *name, int flags) -{ - unsigned long offset =3D 0; - unsigned long len =3D pci_resource_len(pdev, bar); - - return __pcim_request_region_range(pdev, bar, offset, len, name, flags); -} - -static void __pcim_release_region(struct pci_dev *pdev, int bar) -{ - unsigned long offset =3D 0; - unsigned long len =3D pci_resource_len(pdev, bar); - - __pcim_release_region_range(pdev, bar, offset, len); -} - static void pcim_addr_resource_release(struct device *dev, void *resource_= raw) { struct pci_dev *pdev =3D to_pci_dev(dev); @@ -177,11 +77,11 @@ static void pcim_addr_resource_release(struct device *= dev, void *resource_raw) =20 switch (res->type) { case PCIM_ADDR_DEVRES_TYPE_REGION: - __pcim_release_region(pdev, res->bar); + pci_release_region(pdev, res->bar); break; case PCIM_ADDR_DEVRES_TYPE_REGION_MAPPING: pci_iounmap(pdev, res->baseaddr); - __pcim_release_region(pdev, res->bar); + pci_release_region(pdev, res->bar); break; case PCIM_ADDR_DEVRES_TYPE_MAPPING: pci_iounmap(pdev, res->baseaddr); @@ -720,7 +620,7 @@ void __iomem *pcim_iomap_region(struct pci_dev *pdev, i= nt bar, res->type =3D PCIM_ADDR_DEVRES_TYPE_REGION_MAPPING; res->bar =3D bar; =20 - ret =3D __pcim_request_region(pdev, bar, name, 0); + ret =3D pci_request_region(pdev, bar, name); if (ret !=3D 0) goto err_region; =20 @@ -734,7 +634,7 @@ void __iomem *pcim_iomap_region(struct pci_dev *pdev, i= nt bar, return res->baseaddr; =20 err_iomap: - __pcim_release_region(pdev, bar); + pci_release_region(pdev, bar); err_region: pcim_addr_devres_free(res); =20 @@ -835,7 +735,7 @@ int pcim_request_region(struct pci_dev *pdev, int bar, = const char *name) res->type =3D PCIM_ADDR_DEVRES_TYPE_REGION; res->bar =3D bar; =20 - ret =3D __pcim_request_region(pdev, bar, name, 0); + ret =3D pci_request_region(pdev, bar, name); if (ret !=3D 0) { pcim_addr_devres_free(res); return ret; --=20 2.49.0 From nobody Sat Feb 7 23:43:18 2026 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 787AF29B795; Thu, 15 May 2025 12:46:37 +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=1747313197; cv=none; b=nuOw1a4WmVudqi4x491NU8ggn9d00lbbfThkChsDN33Tmu5D4kNcpJ7dKAFYkxTGZfAmwkpI/rxqrAy5NTfA/U7Bz+8DZefb7e1/a3Ji3t32ftTp/SZURuSPimO539xW8bSWl6oMN98LF0Hqnb06vq/HsI1pnr58xQenfyWtvDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747313197; c=relaxed/simple; bh=++n7ZlSGf2Ln4jHZubVYkAdCztDuA+SrzPB+ibCF00Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ra9B0Ud0w4OFYfzEKsexO+aFNmtDCgKV0E/47Nl/mOAWvqpjK0ZXzcyG1cKTFURSjRrDrWbxqCSa0Dd5guUdpJStBd4p+rMMt5BedW0wbR8f9/EMEOXMMpCpN2PZUO4Jd65CSmlvMKtWDNUA7u/Gi4ITW9XMWOHtaRV7bjGpXnY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H1huVWN4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H1huVWN4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E43CC4CEF1; Thu, 15 May 2025 12:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747313197; bh=++n7ZlSGf2Ln4jHZubVYkAdCztDuA+SrzPB+ibCF00Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H1huVWN4L/rX+E9YZFljZQMVup6V7nV7jUO+pErfAgSvUONAT09V23Pp2MfAwG9Qi rZnhw/f9H8X0EA4uO8PevVxLbVQCH9ZVqj4exItAKSBquQjTfhDXaawLahNyo9BuOu GYfs3jjSM9IKtDsg+dkl/FlShdjoQrZ468N6k5TdQuLZ6haNV08A/X364jbouLl13c O8IfGygEaEzqoBzfL1T+owlDIMV2auBuQGXEgRI/+MQ6CcFzOjl57mDVQxn3t7M0tK mfIOxLemKmJ3MwDWCnTBrCrahJkV1KED5+kr+xN46sWU2TEbuiU/C9DzLNVidC3mYL o7GzcomyWYYYA== From: Philipp Stanner To: Jonathan Corbet , Bjorn Helgaas , Philipp Stanner , Mark Brown , David Lechner , Andy Shevchenko , Zijun Hu , Yang Yingliang , Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 6/7] PCI: Remove unnecessary prototype from pci.h Date: Thu, 15 May 2025 14:46:04 +0200 Message-ID: <20250515124604.184313-8-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515124604.184313-2-phasta@kernel.org> References: <20250515124604.184313-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pcim_intx() once was an internal PCI function, but since then has been published and is used by drivers, and, therefore, available in include/linux/pci.h. The function is not used within PCI anymore. Remove pcim_intx()'s prototype from drivers/pci/pci.h Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko --- drivers/pci/pci.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index cfc9e71a4d84..2dd7fa93d95b 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -1059,8 +1059,6 @@ static inline pci_power_t mid_pci_get_power_state(str= uct pci_dev *pdev) } #endif =20 -int pcim_intx(struct pci_dev *dev, int enable); - /* * Config Address for PCI Configuration Mechanism #1 * --=20 2.49.0 From nobody Sat Feb 7 23:43:18 2026 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 DECB4297B93; Thu, 15 May 2025 12:46:40 +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=1747313201; cv=none; b=Q//oYycUYo3rZr4J1sY0oojbzEOghYXKb43VVsk/tuvsR8eGPJhxD2Ct5473CkFyrChe1LPnF40PJgsYMxgMk6Mye9QTuQ34WfHxKkRmnf84/04F7MmmUpMmloCn/IbAgbEDszwF0SLFh5drCnf1Vo6qP3nr5CAAYaEJksChfQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747313201; c=relaxed/simple; bh=3A8EuqIeubhMNr0yMrCc9pby4qqj5GfRmkTNS440bZU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EUp8Vs7RDm95KIItaYaOHkDvsMtWvDJukeTNq1XTJh9Dhnnt+urNO4SYZlvefQ3wjjcEfnp9Bs3TkKckdQrOYN3ocpA2UTxfgsWGYE/0MhfPdi1xpglVn0uil7ayzJ7sedG6IOEnEdOrlEncWWJQcLfpnFCY2//BwtwHewtkI6s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o3h6LnSu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="o3h6LnSu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D89DBC4CEF2; Thu, 15 May 2025 12:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747313200; bh=3A8EuqIeubhMNr0yMrCc9pby4qqj5GfRmkTNS440bZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o3h6LnSub8Npdypg0UH49iz7E2CHzvr522D3g6w5Bswc3BlqQOneZbo93lZu30200 FGCSED0gXyZ/ypj2T4zCcaQ1+Uaag8ypJ577VMyhfQCjyWQLIXdYHGdpHMLgtaq5gL zBjGAFw7qcDr66/IKDFmg1+0WlngTN+auIJI9bsvJag5/f2+DKqsmfzs+6IQBu5DCX dyLLLX1tZlUiXc1xnOglKGLnXzj0VaH55vUtXCTQHmBgM4WSEe0yTtxU6e/UNwdacP NlKn8TvIhFzjy3hAYR5C4v+A5VAWDdqnqyVKJF2WnrKhnt2DWqd88ZMSL/m/x3ch75 FMGo5Yd45lGWg== From: Philipp Stanner To: Jonathan Corbet , Bjorn Helgaas , Philipp Stanner , Mark Brown , David Lechner , Andy Shevchenko , Zijun Hu , Yang Yingliang , Greg Kroah-Hartman Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 7/7] PCI: Remove hybrid-devres hazzard warnings from doc Date: Thu, 15 May 2025 14:46:05 +0200 Message-ID: <20250515124604.184313-9-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515124604.184313-2-phasta@kernel.org> References: <20250515124604.184313-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pci/iomap.c still contains warnings about those functions not behaving in a managed manner if pcim_enable_device() was called. Since all hybrid behavior that users could know about has been removed by now, those explicit warnings are no longer necessary. Remove the hybrid-devres warnings from the docstrings. Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko --- drivers/pci/iomap.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/pci/iomap.c b/drivers/pci/iomap.c index fe706ed946df..ea86c282a386 100644 --- a/drivers/pci/iomap.c +++ b/drivers/pci/iomap.c @@ -25,10 +25,6 @@ * * @maxlen specifies the maximum length to map. If you want to get access = to * the complete BAR from offset to the end, pass %0 here. - * - * NOTE: - * This function is never managed, even if you initialized with - * pcim_enable_device(). * */ void __iomem *pci_iomap_range(struct pci_dev *dev, int bar, @@ -76,10 +72,6 @@ EXPORT_SYMBOL(pci_iomap_range); * * @maxlen specifies the maximum length to map. If you want to get access = to * the complete BAR from offset to the end, pass %0 here. - * - * NOTE: - * This function is never managed, even if you initialized with - * pcim_enable_device(). * */ void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar, @@ -127,10 +119,6 @@ EXPORT_SYMBOL_GPL(pci_iomap_wc_range); * * @maxlen specifies the maximum length to map. If you want to get access = to * the complete BAR without checking for its length first, pass %0 here. - * - * NOTE: - * This function is never managed, even if you initialized with - * pcim_enable_device(). If you need automatic cleanup, use pcim_iomap(). * */ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) { @@ -152,10 +140,6 @@ EXPORT_SYMBOL(pci_iomap); * * @maxlen specifies the maximum length to map. If you want to get access = to * the complete BAR without checking for its length first, pass %0 here. - * - * NOTE: - * This function is never managed, even if you initialized with - * pcim_enable_device(). * */ void __iomem *pci_iomap_wc(struct pci_dev *dev, int bar, unsigned long max= len) { --=20 2.49.0