Re: [PATCH] nvme-pci: Shutdown the device if D3Cold is allowed by the user
From: Rafael J. Wysocki
Date: Thu Dec 12 2024 - 07:22:03 EST
On Thursday, December 12, 2024 6:59:20 AM CET Christoph Hellwig wrote:
> On Mon, Dec 09, 2024 at 08:08:21PM +0530, Manivannan Sadhasivam wrote:
> > >
> > > The istory here is the the NVMe internal power states are significantly
> > > better for the SSDs. It avoid shutting down the SSD frequently, which
> > > creates a lot of extra erase cycles and reduces life time. It also
> > > prevents the SSD from performing maintainance operations while the host
> > > system is idle, which is the perfect time for them. But the idea of
> > > putting all periphals into D3 is gaining a lot of ground because it
> > > makes the platform vendors life a lot simpler at the cost of others.
> >
> > No, I disagree with the last comment. When the system goes to low power mode
> > (like S2R/hibernate), it *does* makes a lot of sense to put the devices into
> > D3Cold to save power.
>
> Yes. That's what the pm_suspend_via_firmware call in nvme_suspend is
> supposed to catch.
pm_suspend_via_firmware() is to distinguish different flavors of system
suspend.
For runtime-suspend, there are different callbacks, but it doesn't look
like they are used by NVMe. At least nvme_dev_pm_ops doesn't set them.