Of course, we can always add things later. What I'm concerned aboutis that once we add an interface like this to sysfs, it's difficult toremove. Therefore, I don't want to add things that are clearly notwhat we really want.

> I am thinking to add some non-intrusive way to make notification work> for root-bus hot removal/add.

The Way Things Are Supposed To Work is that ACPI notifies the OS thata device (a PNP0A08 host bridge in this case) is being removed. TheOS driver does its cleanup and lets go of the device. There areseveral things in the ACPI part of that path that are not implementedyet, so I understand that we might need a sysfs knob to kick thingsoff. But can't we make a knob that just calls the host bridge driver.remove() method, i.e., acpi_pci_root_remove()?

> also in some case, cpu buses get scan during booting, could use that> to remove those not needed> root buses.

I don't see the value in this. I think you're talking about removingthe devices we discovered by blindly probing, i.e., the ones the BIOSdidn't tell us about. I do think we should stop blindly probing forthem, but I don't see what we gain by adding a sysfs knob to removethem.

>> I'm not sure it makes sense to talk about removing a "bus" and leaving>> the upstream bridge (either a host bridge or a P2P bridge). I think>> it'd make more sense to remove the bridge itself, which would of>> course have the consequence of removing the secondary bus.>> for root bus, that remove pci_host_bridge and pci root bus.>> for pci bus under pci bridge, will remove that pci bus, but will still> keep that pci bridge.> that should be ok. just like some pci bridge is there, and later can> not create child bus for it.>> there is one case: during test busn_alloc, i need to remove all device> on one bus, and> use setpci to change bridge bus number register. then use rescan> bridge to create new bus.>> with this one, I just need to remove that bus, instead of remove> children devices one by one.

I don't think making it convenient for manual testing is an argumentfor this interface. For sysfs interfaces it is more important to makesomething that fits well into the grand plan of how things ShouldWork. If you need internal helper functions for convenience, I'm OKwith that, because it's easier to change those than to change sysfsinterfaces.