From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 6.18.y 6/8] PCI: Add kerneldoc for pci_resize_resource()
Date: Tue, 14 Jul 2026 16:02:34 -0400 [thread overview]
Message-ID: <20260714200236.3153778-6-sashal@kernel.org> (raw)
In-Reply-To: <20260714200236.3153778-1-sashal@kernel.org>
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Upstream commit d787018e2dfdc4c1331538e7a8717690d1b7c9b3 ]
As pci_resize_resource() is meant to be used also outside of PCI core,
document the interface with kerneldoc.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Alex Bennée <alex.bennee@linaro.org> # AVA, AMD GPU
Link: https://patch.msgid.link/20251113162628.5946-8-ilpo.jarvinen@linux.intel.com
Stable-dep-of: ee7471fe968d ("PCI: Skip Resizable BAR restore on read error")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/setup-res.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 25a64358feea96..92a5af115cd63f 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -457,6 +457,26 @@ void pci_resize_resource_set_size(struct pci_dev *dev, int resno, int size)
resource_set_size(res, res_size);
}
+/**
+ * pci_resize_resource - reconfigure a Resizable BAR and resources
+ * @dev: the PCI device
+ * @resno: index of the BAR to be resized
+ * @size: new size as defined in the spec (0=1MB, 31=128TB)
+ * @exclude_bars: a mask of BARs that should not be released
+ *
+ * Reconfigure @resno to @size and re-run resource assignment algorithm
+ * with the new size.
+ *
+ * Prior to resize, release @dev resources that share a bridge window with
+ * @resno. This unpins the bridge window resource to allow changing it.
+ *
+ * The caller may prevent releasing a particular BAR by providing
+ * @exclude_bars mask, but this may result in the resize operation failing
+ * due to insufficient space.
+ *
+ * Return: 0 on success, or negative on error. In case of an error, the
+ * resources are restored to their original places.
+ */
int pci_resize_resource(struct pci_dev *dev, int resno, int size,
int exclude_bars)
{
--
2.53.0
next prev parent reply other threads:[~2026-07-14 20:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 13:23 FAILED: patch "[PATCH] PCI: Skip Resizable BAR restore on read error" failed to apply to 6.18-stable tree gregkh
2026-07-14 20:02 ` [PATCH 6.18.y 1/8] PCI/IOV: Adjust ->barsz[] when changing BAR size Sasha Levin
2026-07-14 20:02 ` [PATCH 6.18.y 2/8] PCI: Change pci_dev variable from 'bridge' to 'dev' Sasha Levin
2026-07-14 20:02 ` [PATCH 6.18.y 3/8] PCI: Try BAR resize even when no window was released Sasha Levin
2026-07-14 20:02 ` [PATCH 6.18.y 4/8] PCI: Free saved list without holding pci_bus_sem Sasha Levin
2026-07-14 20:02 ` [PATCH 6.18.y 5/8] PCI: Fix restoring BARs on BAR resize rollback path Sasha Levin
2026-07-14 20:02 ` Sasha Levin [this message]
2026-07-14 20:02 ` [PATCH 6.18.y 7/8] PCI: Move Resizable BAR code to rebar.c Sasha Levin
2026-07-14 20:02 ` [PATCH 6.18.y 8/8] PCI: Skip Resizable BAR restore on read error Sasha Levin
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=20260714200236.3153778-6-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alex.bennee@linaro.org \
--cc=bhelgaas@google.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=stable@vger.kernel.org \
/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