public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-pci: Force NVME_QUIRK_SIMPLE_SUSPEND on Qualcomm hosts
@ 2024-10-24 17:33 Konrad Dybcio
  2024-10-25 11:35 ` Christoph Hellwig
  2024-10-25 16:12 ` Keith Busch
  0 siblings, 2 replies; 9+ messages in thread
From: Konrad Dybcio @ 2024-10-24 17:33 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: Bjorn Andersson, Marijn Suijten, linux-nvme, linux-kernel,
	Konrad Dybcio

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

The Qualcomm SC8280XP SoC requires that all PCIe hosts are powered down
before the platform can reach S3-like sleep states. This is very much
similar in nature to the issue described in [1].

Other Qualcomm platforms we support upstream require more complex code
additions across both the PCIe RC driver and other platform-specific
ones, before the link can be sustained in suspend. Hence, they
effectively need the same treatment for now.

Force NVME_QUIRK_SIMPLE_SUSPEND on all Qualcomm platforms (as
identified by the upstream bridge having a Qualcomm VID) to address
that. Once the aforementioned issues on non-SC8280XP platforms are
addressed, the condition will be made more specific, with a PID check
limiting it to only the platform(s) that require it due to HW design.

[1] Commit df4f9bc4fb9c ("nvme-pci: add support for ACPI StorageD3Enable property")

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 drivers/nvme/host/pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 4b9fda0b1d9a33af4d7030b72532835b205e9cbb..007b28a03cf2c7b3a90f7b7faa1c4c1950e25b6e 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2999,6 +2999,14 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
 	if (dmi_match(DMI_BOARD_NAME, "LXKT-ZXEG-N6"))
 		return NVME_QUIRK_NO_APST;
 
+	/*
+	 * Qualcomm SC8280XP must shut down the PCIe host to enter S3.
+	 * Other Qualcomm platforms require more driver changes to restore the
+	 * link state after wakeup.
+	 */
+	if (pci_upstream_bridge(pdev)->vendor == PCI_VENDOR_ID_QCOM)
+		return NVME_QUIRK_SIMPLE_SUSPEND;
+
 	return 0;
 }
 

---
base-commit: fd21fa4a912ebbf8a6a341c31d8456f61e7d4170
change-id: 20241024-topic-nvmequirk-10e70e6b13ba

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-28 13:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-24 17:33 [PATCH] nvme-pci: Force NVME_QUIRK_SIMPLE_SUSPEND on Qualcomm hosts Konrad Dybcio
2024-10-25 11:35 ` Christoph Hellwig
2024-10-25 15:30   ` Konrad Dybcio
2024-10-28  9:19     ` Christoph Hellwig
2024-10-28 13:15       ` Konrad Dybcio
2024-10-25 16:12 ` Keith Busch
2024-10-25 16:40   ` Konrad Dybcio
2024-10-25 16:57     ` Keith Busch
2024-10-25 17:20       ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox