[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241016094911.24818-3-pstanner@redhat.com>
Date: Wed, 16 Oct 2024 11:49:04 +0200
From: Philipp Stanner <pstanner@...hat.com>
To: Jens Axboe <axboe@...nel.dk>,
Wu Hao <hao.wu@...el.com>,
Tom Rix <trix@...hat.com>,
Moritz Fischer <mdf@...nel.org>,
Xu Yilun <yilun.xu@...el.com>,
Andy Shevchenko <andy@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Richard Cochran <richardcochran@...il.com>,
Damien Le Moal <dlemoal@...nel.org>,
Hannes Reinecke <hare@...e.de>,
Philipp Stanner <pstanner@...hat.com>,
Chaitanya Kulkarni <kch@...dia.com>,
Al Viro <viro@...iv.linux.org.uk>,
Li Zetao <lizetao1@...wei.com>
Cc: linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-fpga@...r.kernel.org,
linux-gpio@...r.kernel.org,
netdev@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: [PATCH v8 1/6] PCI: Make pcim_iounmap_region() a public function
The function pcim_iounmap_regions() is problematic because it uses a
bitmask mechanism to release / iounmap multiple BARs at once. It, thus,
prevents getting rid of the problematic iomap table mechanism which was
deprecated in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(),
pcim_iomap_regions_request_all()").
pcim_iounmap_region() does not have that problem. Make it public as the
successor of pcim_iounmap_regions().
Signed-off-by: Philipp Stanner <pstanner@...hat.com>
---
drivers/pci/devres.c | 3 ++-
include/linux/pci.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index b133967faef8..7b12e2a3469c 100644
--- a/drivers/pci/devres.c
+++ b/drivers/pci/devres.c
@@ -773,7 +773,7 @@ EXPORT_SYMBOL(pcim_iomap_region);
* Unmap a BAR and release its region manually. Only pass BARs that were
* previously mapped by pcim_iomap_region().
*/
-static void pcim_iounmap_region(struct pci_dev *pdev, int bar)
+void pcim_iounmap_region(struct pci_dev *pdev, int bar)
{
struct pcim_addr_devres res_searched;
@@ -784,6 +784,7 @@ static void pcim_iounmap_region(struct pci_dev *pdev, int bar)
devres_release(&pdev->dev, pcim_addr_resource_release,
pcim_addr_resources_match, &res_searched);
}
+EXPORT_SYMBOL(pcim_iounmap_region);
/**
* pcim_iomap_regions - Request and iomap PCI BARs (DEPRECATED)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 573b4c4c2be6..c4221aca20f9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2296,6 +2296,7 @@ static inline void pci_fixup_device(enum pci_fixup_pass pass,
void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar,
const char *name);
+void pcim_iounmap_region(struct pci_dev *pdev, int bar);
void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
int pcim_request_region(struct pci_dev *pdev, int bar, const char *name);
--
2.47.0
Powered by blists - more mailing lists