From: Philipp Stanner <pstanner@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, Wu Hao <hao.wu@intel.com>,
Tom Rix <trix@redhat.com>, Moritz Fischer <mdf@kernel.org>,
Xu Yilun <yilun.xu@intel.com>, Andy Shevchenko <andy@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Richard Cochran <richardcochran@gmail.com>,
Damien Le Moal <dlemoal@kernel.org>,
Hannes Reinecke <hare@suse.de>,
Philipp Stanner <pstanner@redhat.com>,
Chaitanya Kulkarni <kch@nvidia.com>,
Al Viro <viro@zeniv.linux.org.uk>, Li Zetao <lizetao1@huawei.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org,
netdev@vger.kernel.org, linux-pci@vger.kernel.org
Subject: [PATCH v8 1/6] PCI: Make pcim_iounmap_region() a public function
Date: Wed, 16 Oct 2024 11:49:04 +0200 [thread overview]
Message-ID: <20241016094911.24818-3-pstanner@redhat.com> (raw)
In-Reply-To: <20241016094911.24818-2-pstanner@redhat.com>
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@redhat.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
next prev parent reply other threads:[~2024-10-16 9:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 9:49 [PATCH v8 0/6] PCI: Remove most pcim_iounmap_regions() users Philipp Stanner
2024-10-16 9:49 ` Philipp Stanner [this message]
2024-10-16 9:49 ` [PATCH v8 2/6] PCI: Deprecate pcim_iounmap_regions() Philipp Stanner
2024-10-16 10:38 ` Andy Shevchenko
2024-10-18 10:52 ` Philipp Stanner
2024-10-18 12:36 ` Andy Shevchenko
2024-10-16 9:49 ` [PATCH v8 3/6] fpga/dfl-pci.c: Replace deprecated PCI functions Philipp Stanner
2024-10-16 9:49 ` [PATCH v8 4/6] block: mtip32xx: " Philipp Stanner
2024-10-16 9:49 ` [PATCH v8 5/6] gpio: " Philipp Stanner
2024-10-16 9:49 ` [PATCH v8 6/6] ethernet: cavium: " Philipp Stanner
2024-10-28 15:05 ` [PATCH v8 0/6] PCI: Remove most pcim_iounmap_regions() users Philipp Stanner
2024-10-30 21:15 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241016094911.24818-3-pstanner@redhat.com \
--to=pstanner@redhat.com \
--cc=andy@kernel.org \
--cc=axboe@kernel.dk \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=davem@davemloft.net \
--cc=dlemoal@kernel.org \
--cc=edumazet@google.com \
--cc=hao.wu@intel.com \
--cc=hare@suse.de \
--cc=kch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lizetao1@huawei.com \
--cc=mdf@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=trix@redhat.com \
--cc=viro@zeniv.linux.org.uk \
--cc=yilun.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).