From: Prike Liang <Prike.Liang@amd.com>
To: linux-nvme@lists.infradead.org, kbusch@kernel.org, axboe@fb.com,
hch@lst.de, sagi@grimberg.me
Cc: Alexander.Deucher@amd.com, Shyam-sundar.S-k@amd.com,
Prike Liang <Prike.Liang@amd.com>
Subject: [PATCH] nvme: put some AMD PCIE downstream NVME device to simple suspend/resume path
Date: Tue, 30 Mar 2021 20:54:04 +0800 [thread overview]
Message-ID: <1617108844-30110-1-git-send-email-Prike.Liang@amd.com> (raw)
The NVME device pluged in some AMD PCIE root port will resume timeout from s2idle which
caused by NVME power CFG lost in the SMU FW restore.This issue can be workaround by using
PCIe power set with simple suspend/resume process path. In the onwards ASIC will try do
the NVME shutdown save and restore in the SMU FW instead of PCIe power set in the driver.
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
drivers/nvme/host/pci.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 6bad4d4..33c48ee 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -42,6 +42,8 @@
#define NVME_MAX_KB_SZ 4096
#define NVME_MAX_SEGS 127
+#define AMD_PCIE_ID_CZN 0x1634
+#define AMD_PCIE_ID_RN AMD_PCIE_ID_CZN
static int use_threaded_interrupts;
module_param(use_threaded_interrupts, int, 0);
@@ -70,6 +72,12 @@ static unsigned int io_queue_depth = 1024;
module_param_cb(io_queue_depth, &io_queue_depth_ops, &io_queue_depth, 0644);
MODULE_PARM_DESC(io_queue_depth, "set io queue depth, should >= 2");
+static const struct pci_device_id pcie_rp_ids[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_PCIE_ID_RN) },
+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_PCIE_ID_CZN) },
+ { }
+};
+
static int io_queue_count_set(const char *val, const struct kernel_param *kp)
{
unsigned int n;
@@ -2786,6 +2794,9 @@ static int nvme_dev_map(struct nvme_dev *dev)
static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
{
+ struct pci_dev *root;
+ root = pcie_find_root_port(pdev);
+
if (pdev->vendor == 0x144d && pdev->device == 0xa802) {
/*
* Several Samsung devices seem to drop off the PCIe bus
@@ -2822,6 +2833,12 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) &&
dmi_match(DMI_BOARD_NAME, "LNVNB161216"))
return NVME_QUIRK_SIMPLE_SUSPEND;
+ } else if (root && pci_match_id(pcie_rp_ids, root)) {
+ /* Detect NVME device which pluged in the Renoir PCIE root port
+ * then force use quick suspend/resume path for workaround the resume
+ * timeout for s0ix.
+ */
+ return NVME_QUIRK_SIMPLE_SUSPEND;
}
return 0;
--
2.7.4
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next reply other threads:[~2021-03-30 12:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 12:54 Prike Liang [this message]
2021-03-30 23:31 ` [PATCH] nvme: put some AMD PCIE downstream NVME device to simple suspend/resume path Chaitanya Kulkarni
2021-03-31 12:43 ` Liang, Prike
-- strict thread matches above, loose matches on Subject: below --
2021-04-13 9:00 Prike Liang
2021-04-13 9:12 ` Greg KH
2021-04-13 9:30 ` Liang, Prike
2021-04-13 9:40 ` Greg KH
2021-04-13 10:04 Prike Liang
2021-04-13 10:11 ` Greg KH
2021-04-13 15:56 ` 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=1617108844-30110-1-git-send-email-Prike.Liang@amd.com \
--to=prike.liang@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.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