Re: [PATCH v2] PCI: Fix BAR resize for devices on a root bus

Krzysztof Wilczyński <[email protected]> Fri, 31 Jul 2026 13:54:18 +0900
Newsgroups dev.linux.lists.regressions,org.freedesktop.lists.amd-gfx,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.stable
Message-ID <20260731044456.GA257970@rocinante>
Hello,

> Assign the released BARs directly from the root bus windows when there
> is no upstream bridge. On failure, roll back through the existing
> restore path exactly as in the bridged case.
> 
> The root bus path also had a locking bug that any fix here necessarily
> touches: the old "goto out" jumped to up_read(&pci_bus_sem) without a
> matching down_read() (as does the "goto restore" taken when
> pci_dev_res_add_to_list() fails in the release loop). Take pci_bus_sem
> before the BAR release loop so every path through the function holds
> it exactly once.

Thank you for also fixing this pci_bus_sem imbalance, appreciated.

With that,

  Reviewed-by: Krzysztof Wilczyński <[email protected]>

Thank you!

	Krzysztof