All of lore.kernel.org
 help / color / mirror / Atom feed
From: kai.heng.feng@canonical.com (Kai-Heng Feng)
Subject: [PATCHv2 6/6] nvme-pci: Use host managed power state for suspend
Date: Fri, 17 May 2019 17:22:54 +0800	[thread overview]
Message-ID: <E72968DB-907D-41F9-BD51-5D7672659802@canonical.com> (raw)
In-Reply-To: <CAJZ5v0j0V10BYrME=KU1AJXGDMRUFFHiZEHQnsXhNJGPZKBSUw@mail.gmail.com>

at 16:39, Rafael J. Wysocki <rafael@kernel.org> wrote:

> On Thu, May 16, 2019 at 10:56 PM Rafael J. Wysocki <rafael at kernel.org>  
> wrote:
>> On Thu, May 16, 2019@10:45 PM Keith Busch <kbusch@kernel.org> wrote:
>>> On Thu, May 16, 2019@10:25:47PM +0200, Rafael J. Wysocki wrote:
>>>> On Thu, May 16, 2019@9:43 PM Keith Busch <kbusch@kernel.org> wrote:
>>>>> If we're going to replace our SIMPLE_DEV_PM_OPS as Rafael suggests,
>>>>> might as well add a .suspend_noirq callback. We can just save the
>>>>> state again to work around this too.
>>>>
>>>> Relax, pretty please.  Saving the state again shouldn't be necessary.
>>>>
>>>> Let's first understand what's going on.
>>>
>>> Hah, okay fair enough.
>>>
>>> FWIW, I've tried current mainline on two different platforms and I see
>>> only the expected number of calls to pci_pm_suspend_noirq, so everything
>>> works for me.
>>
>> And I don't see why it might not work anywhere else other than a
>> kernel source hacked into pieces or a platform with fundamental
>> problems. :-)
>
> I forgot about one thing which is relevant here, sorry about that.
>
> If there is a spurious EC wakeup during s2idle, pci_pm_suspend_noirq()
> *will* be run again after pci_pm_resume_noirq() without going through
> the entire system resume and next suspend.  In that case the second
> iteration of pci_pm_suspend_noirq() will put the device into D3, if
> that's the target power state of the device as determined by
> pci_prepare_to_sleep(), because pci_pm_resume_noirq() calls
> pci_restore_state() which clears state_saved.
>
> That's not what appears to happen on the test platform as per the
> posted log, but nevertheless it can happen.

The patch Mario pointed solves the issue for the test platform I used.

I?ve tested a dozen NVMes, all of them work properly with Keith?s patch  
series, once the LPIT fix is applied.

>
> Arguably, the driver should not need to worry about that, so that
> needs to be addressed in the PCI core IMO.
>
> The attached patch should help (not inline to avoid gmail-induced
> white space damage).
>
> I will post it properly with a changelog shortly.
> <pci-pm-skip-noirq.patch>

Since the patch Mario suggested solves the issue, do you still want me to  
test this patch?

Kai-Heng

  parent reply	other threads:[~2019-05-17  9:22 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 16:36 [PATCH 1/6] nvme-pci: Fix controller freeze wait disabling Keith Busch
2019-05-15 16:36 ` [PATCH 2/6] nvme-pci: Don't disable on timeout in reset state Keith Busch
2019-05-16  3:07   ` Ming Lei
2019-05-16 14:33     ` Keith Busch
2019-05-16  6:27   ` Christoph Hellwig
2019-05-15 16:36 ` [PATCH 3/6] nvme-pci: Unblock reset_work on IO failure Keith Busch
2019-05-16  3:13   ` Ming Lei
2019-05-16 14:14     ` Keith Busch
2019-05-17  2:31       ` Ming Lei
2019-05-16  6:28   ` Christoph Hellwig
2019-05-15 16:36 ` [PATCH 4/6] nvme-pci: Sync queues on reset Keith Busch
2019-05-16  3:34   ` Ming Lei
2019-05-16  6:29   ` Christoph Hellwig
2019-05-16 14:08     ` Keith Busch
2019-05-16 13:43   ` Minwoo Im
2019-05-15 16:36 ` [PATCH 5/6] nvme: Export get and set features Keith Busch
2019-05-16  6:26   ` Christoph Hellwig
2019-05-16 13:47   ` Minwoo Im
2019-05-15 16:36 ` [PATCHv2 6/6] nvme-pci: Use host managed power state for suspend Keith Busch
2019-05-15 19:33   ` Mario.Limonciello
2019-05-15 19:34     ` Keith Busch
2019-05-15 19:43       ` Mario.Limonciello
2019-05-16  6:25   ` Christoph Hellwig
2019-05-16 14:24     ` Keith Busch
2019-05-17  9:08       ` Christoph Hellwig
2019-05-16  9:29   ` Rafael J. Wysocki
2019-05-16 14:26     ` Keith Busch
2019-05-16 18:27       ` Kai-Heng Feng
2019-05-16 18:33         ` Mario.Limonciello
2019-05-16 19:38           ` Keith Busch
2019-05-16 20:25             ` Rafael J. Wysocki
2019-05-16 20:39               ` Keith Busch
2019-05-16 20:56                 ` Rafael J. Wysocki
2019-05-17  8:39                   ` Rafael J. Wysocki
2019-05-17  9:05                     ` Christoph Hellwig
2019-05-17  9:17                       ` Rafael J. Wysocki
2019-05-17  9:35                         ` Christoph Hellwig
2019-05-17 10:34                           ` Rafael J. Wysocki
2019-05-22  6:47                             ` Kai Heng Feng
2019-05-22 15:52                               ` Christoph Hellwig
2019-05-22 16:02                                 ` Keith Busch
2019-05-22 16:35                                   ` Mario.Limonciello
2019-05-22 16:56                                     ` Keith Busch
2019-05-22 23:08                                     ` Keith Busch
2019-05-23 15:27                                       ` Keith Busch
2019-05-17  9:22                     ` Kai-Heng Feng [this message]
2019-05-17  9:32                       ` Rafael J. Wysocki
2019-05-16 20:24         ` Rafael J. Wysocki
2019-05-16  2:43 ` [PATCH 1/6] nvme-pci: Fix controller freeze wait disabling Ming Lei
2019-05-17 18:40   ` Keith Busch
2019-05-16  6:27 ` Christoph Hellwig

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=E72968DB-907D-41F9-BD51-5D7672659802@canonical.com \
    --to=kai.heng.feng@canonical.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.