From: Christoph Hellwig <hch@lst.de>
To: Moritz Hiller <m.hiller@pc-heini.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [bug report] nvme-pci: NVMe lost after S3 resume, CSTS reads all-ones for a few 100 ms
Date: Fri, 20 Nov 2026 19:08:14 +0100 [thread overview]
Message-ID: <20261120180814.GB1810@lst.de> (raw)
In-Reply-To: <598ee2b4-32aa-4ad3-99c7-db7f9a7e7736@pc-heini.de>
> +/*
> + * A controller that was shut down for suspend may have lost power while the
> + * PCI core still treats it as D3hot, so nothing waited for it to come back.
> + * Config space can already answer while MMIO still reads all-ones. Give such
> + * a controller some time instead of declaring it dead on the first read.
> + */
> +#define NVME_RESUME_MMIO_TIMEOUT_MS 10000
> +#define NVME_RESUME_MMIO_POLL_MS 100
> +
> +static bool nvme_pci_wait_mmio_after_suspend(struct nvme_dev *dev)
I'd probably rename this function and do the initial read of
NVME_REG_CSTS inside of the helper as well to keep everything in a
single place. Otherwise this does look reasonable to me as it
automatically takes care of this issue without affecting setups
that don't have this quirk.
prev parent reply other threads:[~2026-11-20 18:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 2:24 Moritz Hiller
2026-11-20 18:08 ` Christoph Hellwig [this message]
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=20261120180814.GB1810@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=bhelgaas@google.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.hiller@pc-heini.de \
--cc=rafael@kernel.org \
--cc=sagi@grimberg.me \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®