RE: [PATCH V2] pci: introduce static_nr to indicate domain_nr from which IDA

From: Peng Fan
Date: Thu Sep 14 2023 - 02:10:31 EST


Sorry for not being clear when Ccing you.

> Subject: Re: [PATCH V2] pci: introduce static_nr to indicate domain_nr from

The Major question is Bjorn says "
It looks like you're using a notifier call chain to remove the devices
when the of_changeset is removed. I think that's the wrong approach.
The only in-tree user of of_changeset_revert() is i2c-demux-pinctrl.c,
which uses the ordering I suggested:
"
And
"
The current ordering is this, where A happens before B:
A overlay is removed
B pci_host_common_remove
pci_bus_release_domain_nr
of_pci_bus_release_domain_nr
of_get_pci_domain_nr # fails because overlay is gone
ida_free(&pci_domain_nr_dynamic_ida)

But if the host bridge were removed first, the ordering would be as follows,
and the problem would not occur:

B pci_host_common_remove
pci_bus_release_domain_nr
of_pci_bus_release_domain_nr
of_get_pci_domain_nr # succeeds in this order
ida_free(&pci_domain_nr_static_ida)
A overlay is removed
"

I wonder whether it is a must to call pci_host_common_remove, then
remove overlay, or overlay remove automatically trigger
pci_host_common_remove is correct?

Thanks,
Peng.

>
> This does not work like this. Ccing me on some huge bunch of quoted text
> without any comment is pointless. Do you expect me to read everything just
> because you want? I clearly have not enough of work to do, right?
>
> Ask specific question if you need anything from other people. Direct and
> specific question, but not "what do you think?" (the same as this quote). I am
> going just to ignore this email.
>
> Best regards,
> Krzysztof