From: Philipp Stanner <phasta@kernel.org>
To: schalla@marvell.com, vattunuru@marvell.com,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"Shijith Thotton" <sthotton@marvell.com>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
"Philipp Stanner" <phasta@kernel.org>,
"Satha Rao" <skoteshwar@marvell.com>
Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] vdpa/octeon_ep: Use non-hybrid PCI devres API
Date: Thu, 17 Apr 2025 10:02:12 +0200 [thread overview]
Message-ID: <20250417080211.19970-2-phasta@kernel.org> (raw)
octeon enables its PCI device with pcim_enable_device(). This,
implicitly, switches the function pci_request_region() into managed
mode, where it becomes a devres function.
The PCI subsystem wants to remove this hybrid nature from its
interfaces. To do so, users of the aforementioned combination of
functions must be ported to non-hybrid functions.
Moreover, since both functions are already managed in this driver, the
calls to pci_release_region() are unnecessary.
Remove the calls to pci_release_region().
Replace the call to sometimes-managed pci_request_region() with one to
the always-managed pcim_request_region().
Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
drivers/vdpa/octeon_ep/octep_vdpa_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/vdpa/octeon_ep/octep_vdpa_main.c b/drivers/vdpa/octeon_ep/octep_vdpa_main.c
index f3d4dda4e04c..e0da6367661e 100644
--- a/drivers/vdpa/octeon_ep/octep_vdpa_main.c
+++ b/drivers/vdpa/octeon_ep/octep_vdpa_main.c
@@ -391,7 +391,7 @@ static int octep_iomap_region(struct pci_dev *pdev, u8 __iomem **tbl, u8 bar)
{
int ret;
- ret = pci_request_region(pdev, bar, OCTEP_VDPA_DRIVER_NAME);
+ ret = pcim_request_region(pdev, bar, OCTEP_VDPA_DRIVER_NAME);
if (ret) {
dev_err(&pdev->dev, "Failed to request BAR:%u region\n", bar);
return ret;
@@ -400,7 +400,6 @@ static int octep_iomap_region(struct pci_dev *pdev, u8 __iomem **tbl, u8 bar)
tbl[bar] = pci_iomap(pdev, bar, pci_resource_len(pdev, bar));
if (!tbl[bar]) {
dev_err(&pdev->dev, "Failed to iomap BAR:%u\n", bar);
- pci_release_region(pdev, bar);
ret = -ENOMEM;
}
@@ -410,7 +409,6 @@ static int octep_iomap_region(struct pci_dev *pdev, u8 __iomem **tbl, u8 bar)
static void octep_iounmap_region(struct pci_dev *pdev, u8 __iomem **tbl, u8 bar)
{
pci_iounmap(pdev, tbl[bar]);
- pci_release_region(pdev, bar);
}
static void octep_vdpa_pf_bar_shrink(struct octep_pf *octpf)
--
2.48.1
next reply other threads:[~2025-04-17 8:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 8:02 Philipp Stanner [this message]
2025-04-17 9:02 ` [EXTERNAL] [PATCH] vdpa/octeon_ep: Use non-hybrid PCI devres API Vamsi Krishna Attunuru
2025-04-17 10:39 ` Philipp Stanner
2025-04-17 12:56 ` Vamsi Krishna Attunuru
2025-04-17 12:59 ` Philipp Stanner
2025-04-17 13:11 ` Vamsi Krishna Attunuru
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=20250417080211.19970-2-phasta@kernel.org \
--to=phasta@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=schalla@marvell.com \
--cc=skoteshwar@marvell.com \
--cc=sthotton@marvell.com \
--cc=vattunuru@marvell.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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