[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] pcie: Do not set power state for some hot-plugged device
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH 1/1] pcie: Do not set power state for some hot-plugged devices |
Date: |
Thu, 16 Dec 2021 07:11:28 +0100 |
Hi,
> > Maybe we should just not set DeviceState->hotplugged = true for devices
> > added in VM_STATE_PRELAUNCH? It's not actual hotplug (i.e. device added
> > while the system is running) after all ...
> Simply not setting "DeviceState->hotplugged" doesn't work. Devices created
> in
> PHASE_MACHINE_READY phase are treated as hot-plugged devices. So I just
> tried
> following change for the quick test, the device is still invisible to the
> firmware with
> this change.
Looking again, the difference is probably the reset handling.
pcie_cap_slot_reset() will turn on power (via PCI_EXP_SLTCTL_PCC) in
case some device is plugged into the slot.
So I suspect when plugging devices during VM_STATE_PRELAUNCH they are
resetted individually (specifically before the device is plugged),
whereas otherwise they are resetted when all devices are plugged in.
Does resetting devices when leaving RUN_STATE_PRELAUNCH fix this?
take care,
Gerd