Linux kernel -stable discussions
 help / color / mirror / Atom feed
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 5.10.y 4/6] PCI: Add kerneldoc for pci_resize_resource()
Date: Wed, 15 Jul 2026 12:32:21 -0400	[thread overview]
Message-ID: <20260715163223.952417-4-sashal@kernel.org> (raw)
In-Reply-To: <20260715163223.952417-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 9561365c95b37f..aa66e85a3a4715 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -422,6 +422,26 @@ void pci_release_resource(struct pci_dev *dev, int resno)
 }
 EXPORT_SYMBOL(pci_release_resource);
 
+/**
+ * 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


  parent reply	other threads:[~2026-07-15 16:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 13:24 FAILED: patch "[PATCH] PCI: Skip Resizable BAR restore on read error" failed to apply to 5.10-stable tree gregkh
2026-07-15 16:32 ` [PATCH 5.10.y 1/6] PCI: Prevent resource tree corruption when BAR resize fails Sasha Levin
2026-07-15 16:32   ` [PATCH 5.10.y 2/6] PCI: Free saved list without holding pci_bus_sem Sasha Levin
2026-07-15 16:32   ` [PATCH 5.10.y 3/6] PCI: Fix restoring BARs on BAR resize rollback path Sasha Levin
2026-07-15 16:32   ` Sasha Levin [this message]
2026-07-15 16:32   ` [PATCH 5.10.y 5/6] PCI: Move Resizable BAR code to rebar.c Sasha Levin
2026-07-15 16:32   ` [PATCH 5.10.y 6/6] 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=20260715163223.952417-4-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