nvme: Add quirk for LiteON CL1 devices running FW 220TQ,22001
PATCH 1/1 nvme: Add quirk for LiteON CL1 devices running FW 220TQ,22001
LiteON(SSSTC) CL1 device running FW 220TQ,22001 has bugs with simple suspend.
When NVMe device receive D3hot from host, NVMe firmware will do garbage collection. While NVMe device do Garbage collection, firmware has chance to going incorrect address.
In that case, NVMe storage device goes to no device available state. Finally, host can't access the device any more.
Quirk devices will not use simple suspend even if HMB is enabled. In case of poweroff scenario, NVMe receive "PME turn off". So garbage collection will not be happening.
Liteon(SSSTC) will fix the issue, that's why quirk apply on specific vendor id and firmware version.
--- drivers/nvme/host/core.c | 30 ++++++++++++++++++++++++++++++ drivers/nvme/host/nvme.h | 4 ++++ drivers/nvme/host/pci.c | 6 +++++- 3 files changed, 39 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +30 -0
@@ -2637,6 +2637,36 @@ static const struct nvme_core_quirk_entry core_quirks[] = { .vid = 0x14a4, .fr = "22301111", .quirks = NVME_QUIRK_SIMPLE_SUSPEND, + }, + { +/* +* This LiteON CL1-3D256 CR22001 firmware version has some +* issue in simple suspend. +* Simple Suspend issue will be fixed in future firmware +*/ + .vid = 0x14a4, + .fr = "CR22001", + .quirks = NVME_QUIRK_NORMAL_SUSPEND_HMB, + }, + { +/* +* This LiteON CL1-3D256 CR220TQ firmware version has some +* issue in simple suspend. +* Simple Suspend issue will be fixed in future firmware +*/ + .vid = 0x14a4, + .fr = "CR220TQ", + .quirks = NVME_QUIRK_NORMAL_SUSPEND_HMB, + }, + { +/* +* This SSSTC CL1-3D256 CR22001 firmware version has some +* issue in simple suspend. +* Simple Suspend issue will be fixed in future firmware +*/ + .vid = 0x1e95, + .fr = "CR22001", + .quirks = NVME_QUIRK_NORMAL_SUSPEND_HMB, } };
drivers/nvme/host/nvme.h +4 -0
@@ -144,6 +144,10 @@ enum nvme_quirks {* NVMe 1.3 compliance. */ NVME_QUIRK_NO_NS_DESC_LIST = (1 <<15 ), +/* +* Force noraml suspend/resume path for HMB enabled devices. +*/ + NVME_QUIRK_NORMAL_SUSPEND_HMB = (1 << 16), };/*
drivers/nvme/host/pci.c +5 -1
@@ -3014,10 +3014,14 @@ static int nvme_suspend(struct device *dev)* specification allows the device to access the host memory buffer in * host DRAM from all power states, but hosts will fail access to DRAM * during S3. +* +* If NVME_QUIRK_NORMAL_SUSPEND_HMB is enabled, +* do not use SIMPLE_SUSPEND for HMB device. */ if (pm_suspend_via_firmware () || !ctrl->npss || !pcie_aspm_enabled (pdev) || - ndev->nr_host_mem_descs || + (ndev->nr_host_mem_descs && + !(ndev->ctrl.quirks &NVME_QUIRK_NORMAL_SUSPEND_HMB )) || (ndev->ctrl.quirks &NVME_QUIRK_SIMPLE_SUSPEND ))return nvme_disable_prepare_reset (ndev, true);
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Keith Busch
maintainerQuoted 8 lines · Jongpil Jung
suspend.
When NVMe device receive D3hot from host, NVMe firmware will do garbage collection. While NVMe device do Garbage collection, firmware has chance to going incorrect address.
In that case, NVMe storage device goes to no device available state. Finally, host can't access the device any more.
Quoted 6 lines
Quirk devices will not use simple suspend even if HMB is enabled. In case of poweroff scenario, NVMe receive "PME turn off". So garbage collection will not be happening.
Liteon(SSSTC) will fix the issue, that's why quirk apply on specific vendor id and firmware version.
This is a concerning quirk. We use the simple suspend when HMB is enabled because at least some platforms disable device DMA access in the runtime suspend state. Many devices continue to access their HMB while in low power, so we can't let both conditions occur concurrently. Unless you know for sure this device doesn't access host memory in low-power, there will be at least some platform combinations where this quirk will fail.
Quoted 16 lines · Keith Busch
Quoted 8 lines · Jongpil Jung
suspend.
When NVMe device receive D3hot from host, NVMe firmware will do garbage collection. While NVMe device do Garbage collection, firmware has chance to going incorrect address.
In that case, NVMe storage device goes to no device available state. Finally, host can't access the device any more.Quoted 6 lines
Quirk devices will not use simple suspend even if HMB is enabled. In case of poweroff scenario, NVMe receive "PME turn off". So garbage collection will not be happening.
Liteon(SSSTC) will fix the issue, that's why quirk apply on specific vendor id and firmware version.
Quoted 7 lines
This is a concerning quirk. We use the simple suspend when HMB is enabled because at least some platforms disable device DMA access in the runtime suspend state. Many devices continue to access their HMB while in low power, so we can't let both conditions occur concurrently. Unless you know for sure this device doesn't access host memory in low-power, there will be at least some platform combinations where this quirk will fail.
I will submit another patch to check platform.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme