[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/4] pcie: update slot power status only is power control is
|
From: |
Gerd Hoffmann |
|
Subject: |
Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled |
|
Date: |
Fri, 25 Feb 2022 11:12:59 +0100 |
Hi,
> pcie_cap_slot_post_load()
> -> pcie_cap_update_power()
> -> pcie_set_power_device()
> -> pci_set_power()
> -> pci_update_mappings()
> Fix it by honoring PCI_EXP_SLTCAP_PCP and updating power status
> only if capability is enabled.
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index d7d73a31e4..2339729a7c 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -383,10 +383,9 @@ static void pcie_cap_update_power(PCIDevice *hotplug_dev)
>
> if (sltcap & PCI_EXP_SLTCAP_PCP) {
> power = (sltctl & PCI_EXP_SLTCTL_PCC) == PCI_EXP_SLTCTL_PWR_ON;
> + pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
> + pcie_set_power_device, &power);
> }
> -
> - pci_for_each_device(sec_bus, pci_bus_num(sec_bus),
> - pcie_set_power_device, &power);
> }
The change makes sense, although I don't see how that changes qemu
behavior.
'power' defaults to true, so when SLTCAP_PCP is off it should never
ever try to power off the devices. And pci_set_power() should figure
the state didn't change and instantly return without touching the
device.
take care,
Gerd
- [PATCH 0/4] Fix broken PCIe device after migration, Igor Mammedov, 2022/02/24
- [PATCH 1/4] pci: expose TYPE_XIO3130_DOWNSTREAM name, Igor Mammedov, 2022/02/24
- [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/24
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled,
Gerd Hoffmann <=
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Michael S. Tsirkin, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/25
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Gerd Hoffmann, 2022/02/28
- Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled, Igor Mammedov, 2022/02/28
[PATCH 3/4] acpi: pcihp: disable power control on PCIe slot, Igor Mammedov, 2022/02/24
[PATCH 4/4] q35: compat: keep hotplugged PCIe device broken after migration for 6.2-older machine types, Igor Mammedov, 2022/02/24