Re: [PATCH 24/25] PCI: Perform reset_resource() and build fail list in sync

From: Tudor Ambarus
Date: Tue Jun 03 2025 - 07:44:05 EST




On 6/3/25 11:48 AM, Tudor Ambarus wrote:
>
>
> On 6/3/25 11:36 AM, Tudor Ambarus wrote:
>>
>>
>> On 6/3/25 9:13 AM, Ilpo Järvinen wrote:
>>> So please test if this patch solves your problem:
>>
>> It fails in a different way, the bridge window resource never gets
>> assigned with the proposed patch.
>>
>> With the patch applied: https://termbin.com/h3w0
>
> above is no revert and with the proposed fix. It also contains the
> prints https://termbin.com/g4zn
>
> It seems the prints in pbus_size_mem are not longer hit, likely because
> of the new condition added: ``!pdev_resources_assignable(dev) ||``,
> pci_dev_for_each_resource() finishes without doing anything.
>
>> With the blamed commit reverted: https://termbin.com/3rh6
>

I think I found the inconsistency.

__pci_bus_assign_resources()
pbus_assign_resources_sorted()
pdev_sort_resources(dev, &head);

But pdev_sort_resources() is called with a newly LIST_HEAD(head), not
with realloc_head, thus the resources never get sorted.

pdev_sort_resources() exits early at
``if (!pdev_resources_assignable(dev))``