Re: [PATCH] of: dynamic: notify before revert

From: Rob Herring
Date: Wed Feb 28 2024 - 08:28:31 EST


On Wed, Feb 28, 2024 at 12:13 AM Peng Fan (OSS) <peng.fan@xxxxxxxxxxx> wrote:
>
> From: Peng Fan <peng.fan@xxxxxxx>
>
> When PCI node was created using an overlay and the overlay is
> reverted/destroyed, the "linux,pci-domain" property no longer
> exists, so of_get_pci_domain_nr will return failure. Then
> of_pci_bus_release_domain_nr will actually use the dynamic IDA,
> even if the IDA was allocated in static IDA.

That usage is broken to begin with unless there is a guarantee that
static and dynamic domain numbers don't overlap. For example, a
dynamic number is assigned and then you load an overlay with the same
number defined in it.

> So move the notify before revert to fix the issue.

You can't just change the timing. Something might require notify to be
after the revert.

> Fixes: c14f7ccc9f5d ("PCI: Assign PCI domain IDs by ida_alloc()")

I don't see where the notifier is even used.

Rob