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

From: Krzysztof Wilczyński

Date: Fri Jul 31 2026 - 00:54:38 EST


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 <kwilczynski@xxxxxxxxxx>

Thank you!

Krzysztof