[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190918172859.GA51420@C02WT3WMHTD6>
Date: Wed, 18 Sep 2019 11:28:59 -0600
From: Keith Busch <kbusch@...nel.org>
To: Mario Limonciello <mario.limonciello@...l.com>
Cc: Jens Axboe <axboe@...com>, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
linux-nvme@...ts.infradead.org,
LKML <linux-kernel@...r.kernel.org>,
Ryan Hong <Ryan.Hong@...l.com>, Crag Wang <Crag.Wang@...l.com>,
sjg@...gle.com, Jared Dominguez <jared.dominguez@...l.com>
Subject: Re: [PATCH] nvme-pci: Save PCI state before putting drive into
deepest state
On Wed, Sep 11, 2019 at 06:42:33PM -0500, Mario Limonciello wrote:
> ---
> drivers/nvme/host/pci.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 732d5b6..9b3fed4 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2894,6 +2894,13 @@ static int nvme_suspend(struct device *dev)
> if (ret < 0)
> goto unfreeze;
>
> + /*
> + * A saved state prevents pci pm from generically controlling the
> + * device's power. If we're using protocol specific settings, we don't
> + * want pci interfering.
> + */
> + pci_save_state(pdev);
> +
> ret = nvme_set_power_state(ctrl, ctrl->npss);
> if (ret < 0)
> goto unfreeze;
> @@ -2908,12 +2915,6 @@ static int nvme_suspend(struct device *dev)
> ret = 0;
> goto unfreeze;
We would need to clear the saved state here, though. You can also
infact remove the unfreeze label and goto.
> }
> - /*
> - * A saved state prevents pci pm from generically controlling the
> - * device's power. If we're using protocol specific settings, we don't
> - * want pci interfering.
> - */
> - pci_save_state(pdev);
> unfreeze:
> nvme_unfreeze(ctrl);
> return ret;
> --
Powered by blists - more mailing lists