On Fri, Aug 23, 2024 at 5:10 PM Bjorn Helgaas <helgaas@xxxxxxxxxx> wrote: > > [+to Rob] > > On Fri, Aug 23, 2024 at 11:33:22AM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx> > > > > of_platform_depopulate() doesn't play nice with reused OF nodes - it > > ignores the ones that are not marked explicitly as populated and it may > > happen that the PCI device goes away before the platform device in which > > case the PCI core clears the OF_POPULATED bit. We need to > > unconditionally unregister the platform devices for child nodes when > > stopping the PCI device. > > Rob, any concerns with this? Yes, the flag bits are a mess. I don't have a better solution other than perhaps what Bartosz suggests. I was going to say we shouldn't really be mucking with the OF_POPULATED flag outside the DT code, but then I grep'ed the tree. :( Rob