All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Mario Limonciello <mario.limonciello@dell.com>
Cc: Crag Wang <Crag.Wang@dell.com>, Sagi Grimberg <sagi@grimberg.me>,
	sjg@google.com, LKML <linux-kernel@vger.kernel.org>,
	linux-nvme@lists.infradead.org, Jens Axboe <axboe@fb.com>,
	Ryan Hong <Ryan.Hong@Dell.com>,
	Jared Dominguez <jared.dominguez@dell.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] nvme-pci: Save PCI state before putting drive into deepest state
Date: Wed, 18 Sep 2019 11:28:59 -0600	[thread overview]
Message-ID: <20190918172859.GA51420@C02WT3WMHTD6> (raw)
In-Reply-To: <1568245353-13787-1-git-send-email-mario.limonciello@dell.com>

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;
> -- 

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

WARNING: multiple messages have this Message-ID (diff)
From: Keith Busch <kbusch@kernel.org>
To: Mario Limonciello <mario.limonciello@dell.com>
Cc: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org,
	LKML <linux-kernel@vger.kernel.org>,
	Ryan Hong <Ryan.Hong@Dell.com>, Crag Wang <Crag.Wang@dell.com>,
	sjg@google.com, Jared Dominguez <jared.dominguez@dell.com>
Subject: Re: [PATCH] nvme-pci: Save PCI state before putting drive into deepest state
Date: Wed, 18 Sep 2019 11:28:59 -0600	[thread overview]
Message-ID: <20190918172859.GA51420@C02WT3WMHTD6> (raw)
In-Reply-To: <1568245353-13787-1-git-send-email-mario.limonciello@dell.com>

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;
> -- 

  parent reply	other threads:[~2019-09-18 17:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 23:42 [PATCH] nvme-pci: Save PCI state before putting drive into deepest state Mario Limonciello
2019-09-11 23:42 ` Mario Limonciello
2019-09-17 21:24 ` Keith Busch
2019-09-17 21:24   ` Keith Busch
2019-09-17 21:35   ` Rafael J. Wysocki
2019-09-17 21:35     ` Rafael J. Wysocki
2019-09-18 16:52     ` Mario.Limonciello
2019-09-18 16:52       ` Mario.Limonciello
2019-09-18 21:27       ` Rafael J. Wysocki
2019-09-18 21:27         ` Rafael J. Wysocki
2019-09-18 17:28 ` Keith Busch [this message]
2019-09-18 17:28   ` Keith Busch
2019-09-18 21:31 ` Rafael J. Wysocki
2019-09-18 21:31   ` Rafael J. Wysocki
2019-09-18 21:42   ` Rafael J. Wysocki
2019-09-18 21:42     ` Rafael J. Wysocki
2019-09-18 21:43   ` Mario.Limonciello
2019-09-18 21:43     ` Mario.Limonciello
2019-09-18 21:57     ` Rafael J. Wysocki
2019-09-18 21:57       ` Rafael J. Wysocki
2019-09-18 22:00       ` Mario.Limonciello
2019-09-18 22:00         ` Mario.Limonciello
2019-09-18 22:03         ` Rafael J. Wysocki
2019-09-18 22:03           ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190918172859.GA51420@C02WT3WMHTD6 \
    --to=kbusch@kernel.org \
    --cc=Crag.Wang@dell.com \
    --cc=Ryan.Hong@Dell.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=jared.dominguez@dell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mario.limonciello@dell.com \
    --cc=sagi@grimberg.me \
    --cc=sjg@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.