* [PATCH v2] PCI: vmd: Update VMD PM to correctly use generic PCI PM
@ 2020-08-06 21:00 Jon Derrick
2020-09-07 16:59 ` Lorenzo Pieralisi
0 siblings, 1 reply; 2+ messages in thread
From: Jon Derrick @ 2020-08-06 21:00 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Lorenzo Pieralisi, linux-pci, Jon Derrick, Kai-Heng Feng, You-Sheng Yang
The pci_save_state() call in vmd_suspend() can be performed by
pci_pm_suspend_irq(). This also allows VMD to benefit from the call into
pci_prepare_to_sleep().
The pci_restore_state() call in vmd_resume() was restoring state after
pci_pm_resume()::pci_restore_standard_config() had already restored
state. It's also been suspected that the config state should have been
restored before re-requesting IRQs instead of afterwards.
This patch removes the pci_save_state()/pci_restore_state() calls in
vmd_suspend()/vmd_resume() in order to allow proper flow through generic
PCI core Power Management code.
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: You-Sheng Yang <vicamo.yang@canonical.com>
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
---
v1->v2: Commit message cleanup
drivers/pci/controller/vmd.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 76d8acbee7d5..15c1d85d8780 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -719,7 +719,6 @@ static int vmd_suspend(struct device *dev)
for (i = 0; i < vmd->msix_count; i++)
devm_free_irq(dev, pci_irq_vector(pdev, i), &vmd->irqs[i]);
- pci_save_state(pdev);
return 0;
}
@@ -737,7 +736,6 @@ static int vmd_resume(struct device *dev)
return err;
}
- pci_restore_state(pdev);
return 0;
}
#endif
--
2.18.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] PCI: vmd: Update VMD PM to correctly use generic PCI PM
2020-08-06 21:00 [PATCH v2] PCI: vmd: Update VMD PM to correctly use generic PCI PM Jon Derrick
@ 2020-09-07 16:59 ` Lorenzo Pieralisi
0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2020-09-07 16:59 UTC (permalink / raw)
To: Jon Derrick; +Cc: Bjorn Helgaas, linux-pci, Kai-Heng Feng, You-Sheng Yang
On Thu, Aug 06, 2020 at 05:00:17PM -0400, Jon Derrick wrote:
> The pci_save_state() call in vmd_suspend() can be performed by
> pci_pm_suspend_irq(). This also allows VMD to benefit from the call into
> pci_prepare_to_sleep().
>
> The pci_restore_state() call in vmd_resume() was restoring state after
> pci_pm_resume()::pci_restore_standard_config() had already restored
> state. It's also been suspected that the config state should have been
> restored before re-requesting IRQs instead of afterwards.
>
> This patch removes the pci_save_state()/pci_restore_state() calls in
> vmd_suspend()/vmd_resume() in order to allow proper flow through generic
> PCI core Power Management code.
>
> Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
> Cc: You-Sheng Yang <vicamo.yang@canonical.com>
> Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
> ---
> v1->v2: Commit message cleanup
>
> drivers/pci/controller/vmd.c | 2 --
> 1 file changed, 2 deletions(-)
Applied to pci/vmd, thanks.
Lorenzo
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index 76d8acbee7d5..15c1d85d8780 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -719,7 +719,6 @@ static int vmd_suspend(struct device *dev)
> for (i = 0; i < vmd->msix_count; i++)
> devm_free_irq(dev, pci_irq_vector(pdev, i), &vmd->irqs[i]);
>
> - pci_save_state(pdev);
> return 0;
> }
>
> @@ -737,7 +736,6 @@ static int vmd_resume(struct device *dev)
> return err;
> }
>
> - pci_restore_state(pdev);
> return 0;
> }
> #endif
> --
> 2.18.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-07 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 21:00 [PATCH v2] PCI: vmd: Update VMD PM to correctly use generic PCI PM Jon Derrick
2020-09-07 16:59 ` Lorenzo Pieralisi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).