+++ /dev/null
-From f3ace52de88566529e304adce0d528d12533f676 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Aug 2025 15:00:01 +0200
-Subject: gpio: TODO: remove the task for converting to the new line setters
-
-From: Geert Uytterhoeven <geert+renesas@glider.be>
-
-[ Upstream commit 6ec4b94e8e959b4201ca0bfc43fa50dc946d10cb ]
-
-The task is complete, but this was not reflected in the TODO file.
-
-Fixes: d9d87d90cc0b10cd ("treewide: rename GPIO set callbacks back to their original names")
-Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
-Link: https://lore.kernel.org/r/417af7e5a110c527eb759289bd5d2fd6885f4e01.1754917104.git.geert+renesas@glider.be
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/TODO | 12 ------------
- 1 file changed, 12 deletions(-)
-
-diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
-index 7a09a4f58551b..b797499e627ee 100644
---- a/drivers/gpio/TODO
-+++ b/drivers/gpio/TODO
-@@ -176,18 +176,6 @@ cannot be converted yet, but watch this space!
-
- -------------------------------------------------------------------------------
-
--Convert all GPIO chips to using the new, value returning line setters
--
--struct gpio_chip's set() and set_multiple() callbacks are now deprecated. They
--return void and thus do not allow drivers to indicate failure to set the line
--value back to the caller.
--
--We've now added new variants - set_rv() and set_multiple_rv() that return an
--integer. Let's convert all GPIO drivers treewide to use the new callbacks,
--remove the old ones and finally rename the new ones back to the old names.
--
---------------------------------------------------------------------------------
--
- Remove legacy sysfs features
-
- We have two parallel per-chip class devices and per-exported-line attribute
---
-2.51.0
-
+++ /dev/null
-From 073fc78eebc9afb31a734e2db256e086b8a3c26f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 26 Sep 2025 09:02:54 +0530
-Subject: hugetlbfs: skip VMAs without shareable locks in hugetlb_vmdelete_list
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Deepanshu Kartikey <kartikey406@gmail.com>
-
-[ Upstream commit dd83609b88986f4add37c0871c3434310652ebd5 ]
-
-hugetlb_vmdelete_list() uses trylock to acquire VMA locks during truncate
-operations. As per the original design in commit 40549ba8f8e0 ("hugetlb:
-use new vma_lock for pmd sharing synchronization"), if the trylock fails
-or the VMA has no lock, it should skip that VMA. Any remaining mapped
-pages are handled by remove_inode_hugepages() which is called after
-hugetlb_vmdelete_list() and uses proper lock ordering to guarantee
-unmapping success.
-
-Currently, when hugetlb_vma_trylock_write() returns success (1) for VMAs
-without shareable locks, the code proceeds to call unmap_hugepage_range().
-This causes assertion failures in huge_pmd_unshare() →
-hugetlb_vma_assert_locked() because no lock is actually held:
-
- WARNING: CPU: 1 PID: 6594 Comm: syz.0.28 Not tainted
- Call Trace:
- hugetlb_vma_assert_locked+0x1dd/0x250
- huge_pmd_unshare+0x2c8/0x540
- __unmap_hugepage_range+0x6e3/0x1aa0
- unmap_hugepage_range+0x32e/0x410
- hugetlb_vmdelete_list+0x189/0x1f0
-
-Fix by using goto to ensure locks acquired by trylock are always released,
-even when skipping VMAs without shareable locks.
-
-Link: https://lkml.kernel.org/r/20250926033255.10930-1-kartikey406@gmail.com
-Fixes: 40549ba8f8e0 ("hugetlb: use new vma_lock for pmd sharing synchronization")
-Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
-Reported-by: syzbot+f26d7c75c26ec19790e7@syzkaller.appspotmail.com
-Closes: https://syzkaller.appspot.com/bug?extid=f26d7c75c26ec19790e7
-Suggested-by: Andrew Morton <akpm@linux-foundation.org>
-Cc: David Hildenbrand <david@redhat.com>
-Cc: Muchun Song <muchun.song@linux.dev>
-Cc: Oscar Salvador <osalvador@suse.de>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/hugetlbfs/inode.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
-index be4be99304bc0..dbeef80811a32 100644
---- a/fs/hugetlbfs/inode.c
-+++ b/fs/hugetlbfs/inode.c
-@@ -490,6 +490,14 @@ hugetlb_vmdelete_list(struct rb_root_cached *root, pgoff_t start, pgoff_t end,
- if (!hugetlb_vma_trylock_write(vma))
- continue;
-
-+ /*
-+ * Skip VMAs without shareable locks. Per the design in commit
-+ * 40549ba8f8e0, these will be handled by remove_inode_hugepages()
-+ * called after this function with proper locking.
-+ */
-+ if (!__vma_shareable_lock(vma))
-+ goto skip;
-+
- v_start = vma_offset_start(vma, start);
- v_end = vma_offset_end(vma, end);
-
-@@ -500,6 +508,7 @@ hugetlb_vmdelete_list(struct rb_root_cached *root, pgoff_t start, pgoff_t end,
- * vmas. Therefore, lock is not held when calling
- * unmap_hugepage_range for private vmas.
- */
-+skip:
- hugetlb_vma_unlock_write(vma);
- }
- }
---
-2.51.0
-
+++ /dev/null
-From 7b731956a833951f1fec3513556612027041f6c6 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 30 Jun 2025 17:26:40 +0300
-Subject: PCI: Fix pdev_resources_assignable() disparity
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-
-[ Upstream commit ff77c5219747d6b78e8b0ffc4c43d3dd8173d1b2 ]
-
-pdev_sort_resources() uses pdev_resources_assignable() helper to decide if
-device's resources cannot be assigned, so it ignores class 0
-(PCI_CLASS_NOT_DEFINED) devices. pbus_size_mem(), on the other hand, does
-not do the same check. This could lead into a situation where a resource
-ends up on realloc_head list but is not on the head list, which in turn
-prevents emptying the resource from the realloc_head list in
-__assign_resources_sorted().
-
-A non-empty realloc_head is unacceptable because it triggers an internal
-sanity check as shown in this log with a device that has class 0
-(PCI_CLASS_NOT_DEFINED):
-
- pci 0001:01:00.0: [144d:a5a5] type 00 class 0x000000 PCIe Endpoint
- pci 0001:01:00.0: BAR 0 [mem 0x00000000-0x000fffff 64bit]
- pci 0001:01:00.0: ROM [mem 0x00000000-0x0000ffff pref]
- pcieport 0001:00:00.0: bridge window [mem 0x00100000-0x001fffff] to [bus 01-ff] add_size 100000 add_align 100000
- pcieport 0001:00:00.0: bridge window [mem 0x40000000-0x401fffff]: assigned
- ------------[ cut here ]------------
- kernel BUG at drivers/pci/setup-bus.c:2532!
- Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
- ...
- Call trace:
- pci_assign_unassigned_bus_resources+0x110/0x114 (P)
- pci_rescan_bus+0x28/0x48
-
-Use pdev_resources_assignable() also within pbus_size_mem() to skip
-processing of non-assignable resources which removes the disparity in
-between what resources pdev_sort_resources() and pbus_size_mem() consider.
-As non-assignable resources are no longer processed, they are not added to
-the realloc_head list, thus the sanity check no longer triggers.
-
-This disparity problem is very old but only now became apparent after
-2499f5348431 ("PCI: Rework optional resource handling") that made the ROM
-resources optional when calculating bridge window sizes which required
-adding the resource to the realloc_head list. Previously, bridge windows
-were just sized larger than necessary.
-
-Fixes: 2499f5348431 ("PCI: Rework optional resource handling")
-Reported-by: Tudor Ambarus <tudor.ambarus@linaro.org>
-Closes: https://lore.kernel.org/all/5f103643-5e1c-43c6-b8fe-9617d3b5447c@linaro.org/
-Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Cc: stable@vger.kernel.org # v6.15+
-Link: https://patch.msgid.link/20250822123359.16305-3-ilpo.jarvinen@linux.intel.com
-Stable-dep-of: 8278c6914306 ("PCI: Preserve bridge window resource type flags")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/setup-bus.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
-index 7853ac6999e2c..c992707a8ebd6 100644
---- a/drivers/pci/setup-bus.c
-+++ b/drivers/pci/setup-bus.c
-@@ -1190,6 +1190,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
- resource_size_t r_size;
-
- if (r->parent || (r->flags & IORESOURCE_PCI_FIXED) ||
-+ !pdev_resources_assignable(dev) ||
- ((r->flags & mask) != type &&
- (r->flags & mask) != type2 &&
- (r->flags & mask) != type3))
---
-2.51.0
-
+++ /dev/null
-From b871817e3ba3e462dbc10491a2786cd3fb9dc064 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 29 Aug 2025 16:10:59 +0300
-Subject: PCI: Preserve bridge window resource type flags
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-
-[ Upstream commit 8278c6914306f35f32d73bdf2a918950919a0051 ]
-
-When a bridge window is found unused or fails to assign, the flags of the
-associated resource are cleared. Clearing flags is problematic as it also
-removes the type information of the resource which is needed later.
-
-Thus, always preserve the bridge window type flags and use IORESOURCE_UNSET
-and IORESOURCE_DISABLED to indicate the status of the bridge window. Also,
-when initializing resources, make sure all valid bridge windows do get
-their type flags set.
-
-Change various places that relied on resource flags being cleared to check
-for IORESOURCE_UNSET and IORESOURCE_DISABLED to allow bridge window
-resource to retain their type flags. Add pdev_resource_assignable() and
-pdev_resource_should_fit() helpers to filter out disabled bridge windows
-during resource fitting; the latter combines more common checks into the
-helper.
-
-When reading the bridge windows from the registers, instead of leaving the
-resource flags cleared for bridge windows that are not enabled, always
-set up the flags and set IORESOURCE_UNSET | IORESOURCE_DISABLED as needed.
-
-When resource fitting or assignment fails for a bridge window resource, or
-the bridge window is not needed, mark the resource with IORESOURCE_UNSET or
-IORESOURCE_DISABLED, respectively.
-
-Use dummy zero resource in resource_show() for backwards compatibility as
-lspci will otherwise misrepresent disabled bridge windows.
-
-This change fixes an issue which highlights the importance of keeping the
-resource type flags intact:
-
- At the end of __assign_resources_sorted(), reset_resource() is called,
- previously clearing the flags. Later, pci_prepare_next_assign_round()
- attempted to release bridge resources using
- pci_bus_release_bridge_resources() that calls into
- pci_bridge_release_resources() that assumes type flags are still present.
- As type flags were cleared, IORESOURCE_MEM_64 was not set leading to
- resources under an incorrect bridge window to be released (idx = 1
- instead of idx = 2). While the assignments performed later covered this
- problem so that the wrongly released resources got assigned in the end,
- it was still causing extra release+assign pairs.
-
-There are other reasons why the resource flags should be retained in
-upcoming changes too.
-
-Removing the flag reset for non-bridge window resource is left as future
-work, in part because it has a much higher regression potential due to
-pci_enable_resources() that will start to work also for those resources
-then and due to what endpoint drivers might assume about resources.
-
-Despite the Fixes tag, backporting this (at least any time soon) is highly
-discouraged. The issue fixed is borderline cosmetic as the later
-assignments normally cover the problem entirely. Also there might be
-non-obvious dependencies.
-
-Fixes: 5b28541552ef ("PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources")
-Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Link: https://patch.msgid.link/20250829131113.36754-11-ilpo.jarvinen@linux.intel.com
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/bus.c | 3 ++
- drivers/pci/pci-sysfs.c | 7 ++++
- drivers/pci/probe.c | 25 +++++++++---
- drivers/pci/setup-bus.c | 89 +++++++++++++++++++++++++++--------------
- drivers/pci/setup-res.c | 3 ++
- 5 files changed, 90 insertions(+), 37 deletions(-)
-
-diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
-index b77fd30bbfd9d..58b5388423ee3 100644
---- a/drivers/pci/bus.c
-+++ b/drivers/pci/bus.c
-@@ -204,6 +204,9 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res,
- if (!r)
- continue;
-
-+ if (r->flags & (IORESOURCE_UNSET|IORESOURCE_DISABLED))
-+ continue;
-+
- /* type_mask must match */
- if ((res->flags ^ r->flags) & type_mask)
- continue;
-diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
-index 5eea14c1f7f5f..162a5241c7f70 100644
---- a/drivers/pci/pci-sysfs.c
-+++ b/drivers/pci/pci-sysfs.c
-@@ -177,6 +177,13 @@ static ssize_t resource_show(struct device *dev, struct device_attribute *attr,
-
- for (i = 0; i < max; i++) {
- struct resource *res = &pci_dev->resource[i];
-+ struct resource zerores = {};
-+
-+ /* For backwards compatibility */
-+ if (i >= PCI_BRIDGE_RESOURCES && i <= PCI_BRIDGE_RESOURCE_END &&
-+ res->flags & (IORESOURCE_UNSET | IORESOURCE_DISABLED))
-+ res = &zerores;
-+
- pci_resource_to_user(pci_dev, i, res, &start, &end);
- len += sysfs_emit_at(buf, len, "0x%016llx 0x%016llx 0x%016llx\n",
- (unsigned long long)start,
-diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
-index f41128f91ca76..f31d27c7708a6 100644
---- a/drivers/pci/probe.c
-+++ b/drivers/pci/probe.c
-@@ -419,13 +419,17 @@ static void pci_read_bridge_io(struct pci_dev *dev, struct resource *res,
- limit |= ((unsigned long) io_limit_hi << 16);
- }
-
-+ res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
-+
- if (base <= limit) {
-- res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
- region.start = base;
- region.end = limit + io_granularity - 1;
- pcibios_bus_to_resource(dev->bus, res, ®ion);
- if (log)
- pci_info(dev, " bridge window %pR\n", res);
-+ } else {
-+ resource_set_range(res, 0, 0);
-+ res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED;
- }
- }
-
-@@ -440,13 +444,18 @@ static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res,
- pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo);
- base = ((unsigned long) mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16;
- limit = ((unsigned long) mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16;
-+
-+ res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
-+
- if (base <= limit) {
-- res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
- region.start = base;
- region.end = limit + 0xfffff;
- pcibios_bus_to_resource(dev->bus, res, ®ion);
- if (log)
- pci_info(dev, " bridge window %pR\n", res);
-+ } else {
-+ resource_set_range(res, 0, 0);
-+ res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED;
- }
- }
-
-@@ -489,16 +498,20 @@ static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res,
- return;
- }
-
-+ res->flags = (mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) | IORESOURCE_MEM |
-+ IORESOURCE_PREFETCH;
-+ if (res->flags & PCI_PREF_RANGE_TYPE_64)
-+ res->flags |= IORESOURCE_MEM_64;
-+
- if (base <= limit) {
-- res->flags = (mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) |
-- IORESOURCE_MEM | IORESOURCE_PREFETCH;
-- if (res->flags & PCI_PREF_RANGE_TYPE_64)
-- res->flags |= IORESOURCE_MEM_64;
- region.start = base;
- region.end = limit + 0xfffff;
- pcibios_bus_to_resource(dev->bus, res, ®ion);
- if (log)
- pci_info(dev, " bridge window %pR\n", res);
-+ } else {
-+ resource_set_range(res, 0, 0);
-+ res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED;
- }
- }
-
-diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
-index 203c8ebef7029..8078ee30e675f 100644
---- a/drivers/pci/setup-bus.c
-+++ b/drivers/pci/setup-bus.c
-@@ -154,6 +154,31 @@ static bool pdev_resources_assignable(struct pci_dev *dev)
- return true;
- }
-
-+static bool pdev_resource_assignable(struct pci_dev *dev, struct resource *res)
-+{
-+ int idx = pci_resource_num(dev, res);
-+
-+ if (!res->flags)
-+ return false;
-+
-+ if (idx >= PCI_BRIDGE_RESOURCES && idx <= PCI_BRIDGE_RESOURCE_END &&
-+ res->flags & IORESOURCE_DISABLED)
-+ return false;
-+
-+ return true;
-+}
-+
-+static bool pdev_resource_should_fit(struct pci_dev *dev, struct resource *res)
-+{
-+ if (res->parent)
-+ return false;
-+
-+ if (res->flags & IORESOURCE_PCI_FIXED)
-+ return false;
-+
-+ return pdev_resource_assignable(dev, res);
-+}
-+
- /* Sort resources by alignment */
- static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
- {
-@@ -169,10 +194,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
- resource_size_t r_align;
- struct list_head *n;
-
-- if (r->flags & IORESOURCE_PCI_FIXED)
-- continue;
--
-- if (!(r->flags) || r->parent)
-+ if (!pdev_resource_should_fit(dev, r))
- continue;
-
- r_align = pci_resource_alignment(dev, r);
-@@ -221,8 +243,15 @@ bool pci_resource_is_optional(const struct pci_dev *dev, int resno)
- return false;
- }
-
--static inline void reset_resource(struct resource *res)
-+static inline void reset_resource(struct pci_dev *dev, struct resource *res)
- {
-+ int idx = pci_resource_num(dev, res);
-+
-+ if (idx >= PCI_BRIDGE_RESOURCES && idx <= PCI_BRIDGE_RESOURCE_END) {
-+ res->flags |= IORESOURCE_UNSET;
-+ return;
-+ }
-+
- res->start = 0;
- res->end = 0;
- res->flags = 0;
-@@ -568,7 +597,7 @@ static void __assign_resources_sorted(struct list_head *head,
- 0 /* don't care */);
- }
-
-- reset_resource(res);
-+ reset_resource(dev, res);
- }
-
- free_list(head);
-@@ -997,8 +1026,11 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
-
- if (r->parent || !(r->flags & IORESOURCE_IO))
- continue;
-- r_size = resource_size(r);
-
-+ if (!pdev_resource_assignable(dev, r))
-+ continue;
-+
-+ r_size = resource_size(r);
- if (r_size < SZ_1K)
- /* Might be re-aligned for ISA */
- size += r_size;
-@@ -1017,6 +1049,9 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
- size0 = calculate_iosize(size, min_size, size1, 0, 0,
- resource_size(b_res), min_align);
-
-+ if (size0)
-+ b_res->flags &= ~IORESOURCE_DISABLED;
-+
- size1 = size0;
- if (realloc_head && (add_size > 0 || children_add_size > 0)) {
- size1 = calculate_iosize(size, min_size, size1, add_size,
-@@ -1028,13 +1063,14 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
- if (bus->self && (b_res->start || b_res->end))
- pci_info(bus->self, "disabling bridge window %pR to %pR (unused)\n",
- b_res, &bus->busn_res);
-- b_res->flags = 0;
-+ b_res->flags |= IORESOURCE_DISABLED;
- return;
- }
-
- resource_set_range(b_res, min_align, size0);
- b_res->flags |= IORESOURCE_STARTALIGN;
- if (bus->self && size1 > size0 && realloc_head) {
-+ b_res->flags &= ~IORESOURCE_DISABLED;
- add_to_list(realloc_head, bus->self, b_res, size1-size0,
- min_align);
- pci_info(bus->self, "bridge window %pR to %pR add_size %llx\n",
-@@ -1180,11 +1216,13 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
- const char *r_name = pci_resource_name(dev, i);
- resource_size_t r_size;
-
-- if (r->parent || (r->flags & IORESOURCE_PCI_FIXED) ||
-- !pdev_resources_assignable(dev) ||
-- ((r->flags & mask) != type &&
-- (r->flags & mask) != type2 &&
-- (r->flags & mask) != type3))
-+ if (!pdev_resources_assignable(dev) ||
-+ !pdev_resource_should_fit(dev, r))
-+ continue;
-+
-+ if ((r->flags & mask) != type &&
-+ (r->flags & mask) != type2 &&
-+ (r->flags & mask) != type3)
- continue;
- r_size = resource_size(r);
-
-@@ -1235,6 +1273,9 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
- min_align = max(min_align, win_align);
- size0 = calculate_memsize(size, min_size, 0, 0, resource_size(b_res), min_align);
-
-+ if (size0)
-+ b_res->flags &= ~IORESOURCE_DISABLED;
-+
- if (bus->self && size0 &&
- !pbus_upstream_space_available(bus, mask | IORESOURCE_PREFETCH, type,
- size0, min_align)) {
-@@ -1267,13 +1308,14 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
- if (bus->self && (b_res->start || b_res->end))
- pci_info(bus->self, "disabling bridge window %pR to %pR (unused)\n",
- b_res, &bus->busn_res);
-- b_res->flags = 0;
-+ b_res->flags |= IORESOURCE_DISABLED;
- return 0;
- }
-
- resource_set_range(b_res, min_align, size0);
- b_res->flags |= IORESOURCE_STARTALIGN;
- if (bus->self && size1 > size0 && realloc_head) {
-+ b_res->flags &= ~IORESOURCE_DISABLED;
- add_to_list(realloc_head, bus->self, b_res, size1-size0, add_align);
- pci_info(bus->self, "bridge window %pR to %pR add_size %llx add_align %llx\n",
- b_res, &bus->busn_res,
-@@ -1705,7 +1747,6 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
- {
- struct pci_dev *dev = bus->self;
- struct resource *r;
-- unsigned int old_flags;
- struct resource *b_res;
- int idx, ret;
-
-@@ -1742,17 +1783,15 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
- /* If there are children, release them all */
- release_child_resources(r);
-
-- type = old_flags = r->flags & PCI_RES_TYPE_MASK;
- ret = pci_release_resource(dev, PCI_BRIDGE_RESOURCES + idx);
- if (ret)
- return;
-
-+ type = r->flags & PCI_RES_TYPE_MASK;
- /* Avoiding touch the one without PREF */
- if (type & IORESOURCE_PREFETCH)
- type = IORESOURCE_PREFETCH;
- __pci_setup_bridge(bus, type);
-- /* For next child res under same bridge */
-- r->flags = old_flags;
- }
-
- enum release_type {
-@@ -2230,21 +2269,9 @@ static void pci_prepare_next_assign_round(struct list_head *fail_head,
- }
-
- /* Restore size and flags */
-- list_for_each_entry(fail_res, fail_head, list) {
-- struct resource *res = fail_res->res;
-- struct pci_dev *dev = fail_res->dev;
-- int idx = pci_resource_num(dev, res);
--
-+ list_for_each_entry(fail_res, fail_head, list)
- restore_dev_resource(fail_res);
-
-- if (!pci_is_bridge(dev))
-- continue;
--
-- if (idx >= PCI_BRIDGE_RESOURCES &&
-- idx <= PCI_BRIDGE_RESOURCE_END)
-- res->flags = 0;
-- }
--
- free_list(fail_head);
- }
-
-diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
-index 0468c058b5987..c5ef8ef54d3ce 100644
---- a/drivers/pci/setup-res.c
-+++ b/drivers/pci/setup-res.c
-@@ -359,6 +359,9 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
-
- res->flags &= ~IORESOURCE_UNSET;
- res->flags &= ~IORESOURCE_STARTALIGN;
-+ if (resno >= PCI_BRIDGE_RESOURCES && resno <= PCI_BRIDGE_RESOURCE_END)
-+ res->flags &= ~IORESOURCE_DISABLED;
-+
- pci_info(dev, "%s %pR: assigned\n", res_name, res);
- if (resno < PCI_BRIDGE_RESOURCES)
- pci_update_resource(dev, resno);
---
-2.51.0
-
+++ /dev/null
-From a5c01cacc40950fb11cd299334cfbaf0542be443 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 29 Aug 2025 16:10:57 +0300
-Subject: PCI: Use pci_release_resource() instead of release_resource()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-
-[ Upstream commit 3baeae36039afc233d4a42d6ff4aa7019892619f ]
-
-A few places in setup-bus.c call release_resource() directly and end up
-duplicating functionality from pci_release_resource() such as parent check,
-logging, and clearing the resource. Worse yet, the way the resource is
-cleared is inconsistent between different sites.
-
-Convert release_resource() calls into pci_release_resource() to remove code
-duplication. This will also make the resource start, end, and flags
-behavior consistent, i.e., start address is cleared, and only
-IORESOURCE_UNSET is asserted for the resource.
-
-While at it, eliminate the unnecessary initialization of idx variable in
-pci_bridge_release_resources().
-
-Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Link: https://patch.msgid.link/20250829131113.36754-9-ilpo.jarvinen@linux.intel.com
-Stable-dep-of: 8278c6914306 ("PCI: Preserve bridge window resource type flags")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/setup-bus.c | 46 +++++++++++++----------------------------
- drivers/pci/setup-res.c | 11 +++++++---
- include/linux/pci.h | 2 +-
- 3 files changed, 23 insertions(+), 36 deletions(-)
-
-diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
-index c992707a8ebd6..203c8ebef7029 100644
---- a/drivers/pci/setup-bus.c
-+++ b/drivers/pci/setup-bus.c
-@@ -431,8 +431,6 @@ static void __assign_resources_sorted(struct list_head *head,
- struct pci_dev_resource *dev_res, *tmp_res, *dev_res2;
- struct resource *res;
- struct pci_dev *dev;
-- const char *res_name;
-- int idx;
- unsigned long fail_type;
- resource_size_t add_align, align;
-
-@@ -540,14 +538,7 @@ static void __assign_resources_sorted(struct list_head *head,
- res = dev_res->res;
- dev = dev_res->dev;
-
-- if (!res->parent)
-- continue;
--
-- idx = pci_resource_num(dev, res);
-- res_name = pci_resource_name(dev, idx);
-- pci_dbg(dev, "%s %pR: releasing\n", res_name, res);
--
-- release_resource(res);
-+ pci_release_resource(dev, pci_resource_num(dev, res));
- restore_dev_resource(dev_res);
- }
- /* Restore start/end/flags from saved list */
-@@ -1716,7 +1707,7 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
- struct resource *r;
- unsigned int old_flags;
- struct resource *b_res;
-- int idx = 1;
-+ int idx, ret;
-
- b_res = &dev->resource[PCI_BRIDGE_RESOURCES];
-
-@@ -1750,21 +1741,18 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
-
- /* If there are children, release them all */
- release_child_resources(r);
-- if (!release_resource(r)) {
-- type = old_flags = r->flags & PCI_RES_TYPE_MASK;
-- pci_info(dev, "resource %d %pR released\n",
-- PCI_BRIDGE_RESOURCES + idx, r);
-- /* Keep the old size */
-- resource_set_range(r, 0, resource_size(r));
-- r->flags = 0;
-
-- /* Avoiding touch the one without PREF */
-- if (type & IORESOURCE_PREFETCH)
-- type = IORESOURCE_PREFETCH;
-- __pci_setup_bridge(bus, type);
-- /* For next child res under same bridge */
-- r->flags = old_flags;
-- }
-+ type = old_flags = r->flags & PCI_RES_TYPE_MASK;
-+ ret = pci_release_resource(dev, PCI_BRIDGE_RESOURCES + idx);
-+ if (ret)
-+ return;
-+
-+ /* Avoiding touch the one without PREF */
-+ if (type & IORESOURCE_PREFETCH)
-+ type = IORESOURCE_PREFETCH;
-+ __pci_setup_bridge(bus, type);
-+ /* For next child res under same bridge */
-+ r->flags = old_flags;
- }
-
- enum release_type {
-@@ -2409,7 +2397,6 @@ int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type)
- for (i = PCI_BRIDGE_RESOURCES; i < PCI_BRIDGE_RESOURCE_END;
- i++) {
- struct resource *res = &bridge->resource[i];
-- const char *res_name = pci_resource_name(bridge, i);
-
- if ((res->flags ^ type) & PCI_RES_TYPE_MASK)
- continue;
-@@ -2422,12 +2409,7 @@ int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type)
- if (ret)
- goto cleanup;
-
-- pci_info(bridge, "%s %pR: releasing\n", res_name, res);
--
-- if (res->parent)
-- release_resource(res);
-- res->start = 0;
-- res->end = 0;
-+ pci_release_resource(bridge, i);
- break;
- }
- if (i == PCI_BRIDGE_RESOURCE_END)
-diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
-index d2b3ed51e8804..0468c058b5987 100644
---- a/drivers/pci/setup-res.c
-+++ b/drivers/pci/setup-res.c
-@@ -406,20 +406,25 @@ int pci_reassign_resource(struct pci_dev *dev, int resno,
- return 0;
- }
-
--void pci_release_resource(struct pci_dev *dev, int resno)
-+int pci_release_resource(struct pci_dev *dev, int resno)
- {
- struct resource *res = pci_resource_n(dev, resno);
- const char *res_name = pci_resource_name(dev, resno);
-+ int ret;
-
- if (!res->parent)
-- return;
-+ return 0;
-
- pci_info(dev, "%s %pR: releasing\n", res_name, res);
-
-- release_resource(res);
-+ ret = release_resource(res);
-+ if (ret)
-+ return ret;
- res->end = resource_size(res) - 1;
- res->start = 0;
- res->flags |= IORESOURCE_UNSET;
-+
-+ return 0;
- }
- EXPORT_SYMBOL(pci_release_resource);
-
-diff --git a/include/linux/pci.h b/include/linux/pci.h
-index 59876de13860d..275df40587672 100644
---- a/include/linux/pci.h
-+++ b/include/linux/pci.h
-@@ -1417,7 +1417,7 @@ void pci_reset_secondary_bus(struct pci_dev *dev);
- void pcibios_reset_secondary_bus(struct pci_dev *dev);
- void pci_update_resource(struct pci_dev *dev, int resno);
- int __must_check pci_assign_resource(struct pci_dev *dev, int i);
--void pci_release_resource(struct pci_dev *dev, int resno);
-+int pci_release_resource(struct pci_dev *dev, int resno);
- static inline int pci_rebar_bytes_to_size(u64 bytes)
- {
- bytes = roundup_pow_of_two(bytes);
---
-2.51.0
-
btrfs-return-any-hit-error-from-extent_writepage_io.patch
btrfs-fix-symbolic-link-reading-when-bs-ps.patch
pinctrl-renesas-rzg2l-fix-invalid-unsigned-return-in.patch
-gpio-todo-remove-the-task-for-converting-to-the-new-.patch
arm64-dts-renesas-rzg2lc-smarc-disable-can-fd-channe.patch
bpf-tidy-verifier-bug-message.patch
regmap-remove-superfluous-check-for-config-in-__regm.patch
risc-v-kvm-write-hgatp-register-with-valid-mode-bits.patch
alsa-pcm-disable-bottom-softirqs-as-part-of-spin_loc.patch
acpi-nfit-fix-incorrect-ndr_desc-being-reportedin-de.patch
-pci-fix-pdev_resources_assignable-disparity.patch
-pci-use-pci_release_resource-instead-of-release_reso.patch
-pci-preserve-bridge-window-resource-type-flags.patch
scsi-qla2xxx-edif-fix-incorrect-sign-of-error-code.patch
scsi-qla2xxx-fix-incorrect-sign-of-error-code-in-sta.patch
scsi-qla2xxx-fix-incorrect-sign-of-error-code-in-qla.patch
cramfs-fix-incorrect-physical-page-address-calculati.patch
ocfs2-fix-double-free-in-user_cluster_connect.patch
drivers-base-node-fix-double-free-in-register_one_no.patch
-hugetlbfs-skip-vmas-without-shareable-locks-in-huget.patch
f2fs-fix-uaf-issue-in-f2fs_merge_page_bio.patch
mtd-rawnand-atmel-fix-error-handling-path-in-atmel_n.patch
pci-j721e-fix-incorrect-error-message-in-probe.patch