Hi Cédric,

>-----Original Message-----
>From: Cédric Le Goater <c...@redhat.com>
>Subject: Re: [PATCH 4/5] pcie, virtio: Remove redundant pm_cap
>
>Hello Zhenzhong,
>
>On 2/21/25 07:12, Duan, Zhenzhong wrote:
>>
>>
>>> -----Original Message-----
>>> From: Alex Williamson <alex.william...@redhat.com>
>>> Subject: [PATCH 4/5] pcie, virtio: Remove redundant pm_cap
>>>
>>> The pm_cap on the PCIExpressDevice object can be distilled down
>>> to the new instance on the PCIDevice object.
>>>
>>> Cc: Michael S. Tsirkin <m...@redhat.com>
>>> Cc: Marcel Apfelbaum <marcel.apfelb...@gmail.com>
>>> Signed-off-by: Alex Williamson <alex.william...@redhat.com>
>>> ---
>>> hw/pci-bridge/pcie_pci_bridge.c | 1 -
>>> hw/virtio/virtio-pci.c          | 8 +++-----
>>> include/hw/pci/pcie.h           | 2 --
>>> 3 files changed, 3 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/hw/pci-bridge/pcie_pci_bridge.c 
>>> b/hw/pci-bridge/pcie_pci_bridge.c
>>> index 9fa656b43b42..2429503cfbbf 100644
>>> --- a/hw/pci-bridge/pcie_pci_bridge.c
>>> +++ b/hw/pci-bridge/pcie_pci_bridge.c
>>> @@ -56,7 +56,6 @@ static void pcie_pci_bridge_realize(PCIDevice *d, Error
>>> **errp)
>>>      if (pos < 0) {
>>>          goto pm_error;
>>>      }
>>> -    d->exp.pm_cap = pos;
>>>      pci_set_word(d->config + pos + PCI_PM_PMC, 0x3);
>>>
>>>      pcie_cap_arifwd_init(d);
>>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
>>> index afe8b5551c5c..3ca3f849d391 100644
>>> --- a/hw/virtio/virtio-pci.c
>>> +++ b/hw/virtio/virtio-pci.c
>>> @@ -2209,8 +2209,6 @@ static void virtio_pci_realize(PCIDevice *pci_dev,
>Error
>>> **errp)
>>>              return;
>>>          }
>>>
>>> -        pci_dev->exp.pm_cap = pos;
>>> -
>>>          /*
>>>           * Indicates that this function complies with revision 1.2 of the
>>>           * PCI Power Management Interface Specification.
>>> @@ -2309,11 +2307,11 @@ static bool virtio_pci_no_soft_reset(PCIDevice
>*dev)
>>> {
>>>      uint16_t pmcsr;
>>>
>>> -    if (!pci_is_express(dev) || !dev->exp.pm_cap) {
>>> +    if (!pci_is_express(dev) || !(dev->cap_present & QEMU_PCI_CAP_PM)) {
>>
>> Maybe a bit more optimized by checking dev->pm_cap,
>> but it's also ok checking present bit. For the whole series,
>>
>> Reviewed-by: Zhenzhong Duan <zhenzhong.d...@intel.com>
>
>Could you please reply to the cover letter instead ? Tools like b4
>will apply the provided trailers to the whole series and not this
>patch only.

Got it, just done.

Thanks
Zhenzhong

Reply via email to