Commit 86f9f48d authored by Kai-Heng Feng's avatar Kai-Heng Feng Committed by Kleber Sacilotto de Souza

nvme-pci: disable APST on Samsung SSD 960 EVO + ASUS PRIME B350M-A

BugLink: https://bugs.launchpad.net/bugs/1664602

The NVMe device in question drops off the PCIe bus after system suspend.
I've tried several approaches to workaround this issue, but none of them
works:
- NVME_QUIRK_DELAY_BEFORE_CHK_RDY
- NVME_QUIRK_NO_DEEPEST_PS
- Disable APST before controller shutdown
- Delay between controller shutdown and system suspend
- Explicitly set power state to 0 before controller shutdown

Fortunately it's a desktop, so disable APST won't hurt the battery.

Also, change the quirk function name to reflect it's for vendor
combination quirks.

BugLink: https://bugs.launchpad.net/bugs/1705748Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
(cherry picked from commit 8427bbc2)
Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Acked-By: default avatarAceLan Kao <acelan.kao@canonical.com>
Acked-By: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 675f069f
......@@ -2199,7 +2199,7 @@ static int nvme_dev_map(struct nvme_dev *dev)
return -ENODEV;
}
static unsigned long check_dell_samsung_bug(struct pci_dev *pdev)
static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
{
if (pdev->vendor == 0x144d && pdev->device == 0xa802) {
/*
......@@ -2214,6 +2214,14 @@ static unsigned long check_dell_samsung_bug(struct pci_dev *pdev)
(dmi_match(DMI_PRODUCT_NAME, "XPS 15 9550") ||
dmi_match(DMI_PRODUCT_NAME, "Precision 5510")))
return NVME_QUIRK_NO_DEEPEST_PS;
} else if (pdev->vendor == 0x144d && pdev->device == 0xa804) {
/*
* Samsung SSD 960 EVO drops off the PCIe bus after system
* suspend on a Ryzen board, ASUS PRIME B350M-A.
*/
if (dmi_match(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC.") &&
dmi_match(DMI_BOARD_NAME, "PRIME B350M-A"))
return NVME_QUIRK_NO_APST;
}
return 0;
......@@ -2261,7 +2269,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (result)
goto put_pci;
quirks |= check_dell_samsung_bug(pdev);
quirks |= check_vendor_combination_bug(pdev);
result = nvme_init_ctrl(&dev->ctrl, &pdev->dev, &nvme_pci_ctrl_ops,
quirks);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment