[PATCH 1/1] PCI: Restore assigned resources fully after release
Nicolas Frattaroli
nicolas.frattaroli at collabora.com
Thu Apr 17 07:49:13 PDT 2025
On Thursday, 3 April 2025 11:31:37 Central European Summer Time Ilpo Järvinen wrote:
> PCI resource fitting code in __assign_resources_sorted() runs in
> multiple steps. A resource that was successfully assigned may have to
> be released before the next step attempts assignment again. The
> assign+release cycle is destructive to a start-aligned struct resource
> (bridge window or IOV resource) because the start field is overwritten
> with the real address when the resource got assigned.
>
> Properly restore the resource after releasing it. The start, end, and
> flags fields must be stored into the related struct pci_dev_resource in
> order to be able to restore the resource to its original state.
>
> Reported-by: Guenter Roeck <linux at roeck-us.net>
> Fixes: 96336ec70264 ("PCI: Perform reset_resource() and build fail list in sync")
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen at linux.intel.com>
> ---
> drivers/pci/setup-bus.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
+Cc: linux-rockchip
Tested-by: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>
This fixes a regression on the RK3588 that I ran into with v6.15-rc<=2.
Specifically, the PCIe3 controller will fail to map the address space
of a
Non-Volatile memory controller: KIOXIA Corporation NVMe SSD (rev 01)
(prog-if 02 [NVM Express])
drive on most, but not all, boots, depending on the order initialisation
happens, it seems. A different drive I tested seems to work fine, so not
only does the regression only rear its head based on boot timing, but
also based on the device attached to the PCIe3 controller. Bisecting was
a bit of a tortured affair, as the bad commit 96336ec70264 doesn't seem
to build for me, so I had to `git bisect skip` it.
The specific problematic behaviour fixed by this patch is that we get:
pci 0000:00:00.0: bridge window [mem size 0x00100000]: can't assign; bogus alignment
It sounds like Ondřej Jirman ran into the same regression, since the
devices he mentioned (Orange Pi 5+ and QuartzPro64) both use the
Rockchip RK3588 SoC.
Kind regards,
Nicolas Frattaroli
More information about the Linux-rockchip
mailing list