On Thu, Nov 11, 2021 at 10:39:59AM -0500, Michael S. Tsirkin wrote: > On Thu, Nov 11, 2021 at 01:09:05PM +0100, Gerd Hoffmann wrote: > > Hi, > > > > > When the acpihp driver is used the linux kernel will just call the aml > > > methods and I suspect the pci device will stay invisible then because > > > nobody flips the slot power control bit (with native-hotplug=on, for > > > native-hotplug=off this isn't a problem of course). > > > > Hmm, on a quick smoke test with both patch series (mine + igors) applied > > everything seems to work fine on a quick glance. Dunno why. Maybe the > > pcieport driver turns on slot power even in case pciehp is not active.
Digged deeper. Updating power status is handled by the plug() callback, which is never called in case acpi hotplug is active. The guest seems to never touch slot power control either, so it's working fine. Still feels a bit fragile though. > Well power and hotplug capabilities are mostly unrelated, right? At least they are separate slot capabilities. The linux pciehp driver checks whenever the power control is present before using it, so having PwrCtrl- HotPlug+ seems to be a valid combination. We even have an option for that: pcie-root-port.power_controller_present So flipping that to off in case apci hotplug is active should make sure we never run into trouble with pci devices being powered off. Igor? Can you add that to your patch series? > I feel switching to native so late would be inappropriate, looks more > like a feature than a bugfix. Given that - we need Igor's patches. > Given that - would you say I should apply yours? I think when setting power_controller_present=off for acpi hotplug it is safe to merge both mine and igor's. take care, Gerd