Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1654204
| From | Alex Williamson <alex.williamson@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] PCI/PM: Set D3 power state only if the end device supports it. |
| Date | 2017-05-31 14:50 +0200 |
| Message-ID | <tNbez-4Mk-47@gated-at.bofh.it> (permalink) |
| References | <tNbez-4Mk-49@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, 31 May 2017 17:03:32 +0530 Geetha sowjanya <gakula@caviumnetworks.com> wrote: > Pci driver doesn't check if the device supports D3hot/D3cold power states > while setting these power states. The device that doesn't support these > states will fail when a driver like vfio try to do D0->D3 power transition. That's because support for D0 and D3 device states is REQUIRED by the PCIe spec (Rev 3.1a, 7.6). Is this yet more non-spec compliance? Thanks, Alex > This patch adds a check that allows to set D3 power state only > for the supported devices. > > Signed-off-by: Geetha sowjanya <gakula@caviumnetworks.com> > --- > drivers/pci/pci.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 563901c..cadd046 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -661,7 +661,8 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) > > /* check if this device supports the desired state */ > if ((state == PCI_D1 && !dev->d1_support) > - || (state == PCI_D2 && !dev->d2_support)) > + || (state == PCI_D2 && !dev->d2_support) > + || (state == PCI_D3hot && !pci_pme_capable(dev, state))) > return -EIO; > > pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH] PCI/PM: Set D3 power state only if the end device supports it. Alex Williamson <alex.williamson@redhat.com> - 2017-05-31 14:50 +0200
Re: [PATCH] PCI/PM: Set D3 power state only if the end device supports it. Geetha Akula <geethasowjanya.akula@gmail.com> - 2017-06-02 07:50 +0200
Re: [PATCH] PCI/PM: Set D3 power state only if the end device supports it. Alex Williamson <alex.williamson@redhat.com> - 2017-06-06 00:10 +0200
csiph-web