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 3/8] PCI: Try BAR resize even when no window was released
Date: Tue, 14 Jul 2026 16:02:31 -0400 [thread overview]
Message-ID: <20260714200236.3153778-3-sashal@kernel.org> (raw)
In-Reply-To: <20260714200236.3153778-1-sashal@kernel.org>
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Upstream commit 121d3e9e4b217f2f23715901fb15c6a3ca2bab46 ]
Usually, resizing BARs requires releasing bridge windows in order to
resize it to fit a larger BAR into the window. This is not always the
case, however, FW could have made the window large enough to accommodate
larger BAR as is, or the user might prefer to shrink a BAR to make more
space for another Resizable BAR.
Thus, replace the check that requires that at least one bridge window
was released with a check that simply ensures bridge is not NULL.
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-5-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-bus.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index ae72a34b09c562..55f3ac3f3eb1cc 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -2376,7 +2376,7 @@ int pbus_reassign_bridge_resources(struct pci_bus *bus, struct resource *res)
{
unsigned long type = res->flags;
struct pci_dev_resource *dev_res;
- struct pci_dev *bridge;
+ struct pci_dev *bridge = NULL;
LIST_HEAD(saved);
LIST_HEAD(added);
LIST_HEAD(failed);
@@ -2411,10 +2411,8 @@ int pbus_reassign_bridge_resources(struct pci_bus *bus, struct resource *res)
bus = bus->parent;
}
- if (list_empty(&saved)) {
- up_read(&pci_bus_sem);
+ if (!bridge)
return -ENOENT;
- }
__pci_bus_size_bridges(bridge->subordinate, &added);
__pci_bridge_assign_resources(bridge, &added, &failed);
--
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 ` Sasha Levin [this message]
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 ` [PATCH 6.18.y 6/8] PCI: Add kerneldoc for pci_resize_resource() Sasha Levin
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-3-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