nvme-pci: Save PCI state before putting drive into deepest state
authorMario Limonciello <mario.limonciello@dell.com>
Wed, 18 Sep 2019 18:15:55 +0000 (13:15 -0500)
committerSagi Grimberg <sagi@grimberg.me>
Wed, 25 Sep 2019 19:53:14 +0000 (12:53 -0700)
commit7cbb5c6f9aa7cfda7175d82a9cf77a92965b0c5e
treed4e5df4625bc631717687ee174a5fec0d0438723
parentddef29578a81a1d4d8f2b26a7adbfe21407ee3ea
nvme-pci: Save PCI state before putting drive into deepest state

The action of saving the PCI state will cause numerous PCI configuration
space reads which depending upon the vendor implementation may cause
the drive to exit the deepest NVMe state.

In these cases ASPM will typically resolve the PCIe link state and APST
may resolve the NVMe power state.  However it has also been observed
that this register access after quiesced will cause PC10 failure
on some device combinations.

To resolve this, move the PCI state saving to before SetFeatures has been
called.  This has been proven to resolve the issue across a 5000 sample
test on previously failing disk/system combinations.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/pci.c