[SRU] [Artful] [PATCH 0/1] Fix Samsung NVMe drops off PCI bus After S3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU] [Artful] [PATCH 0/1] Fix Samsung NVMe drops off PCI bus After S3

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1705748

[Impact]
A user reported his NVMe went out to lunch after S3.

[Fix]
Disable APST for this particular NVMe + Motherboard setup.

[Test]
User confirmed this quirk works for his system.

[Regression Potential]
Very Low. This applies to a specific device setup, also user can
override this quirk by "nvme_core.force_apst=1".

Kai-Heng Feng (1):
  nvme-pci: disable APST on Samsung SSD 960 EVO + ASUS PRIME B350M-A

 drivers/nvme/host/pci.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--
2.15.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU] [Artful] [PATCH 1/1] nvme-pci: disable APST on Samsung SSD 960 EVO + ASUS PRIME B350M-A

Kai-Heng Feng
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/1705748
Signed-off-by: Kai-Heng Feng <[hidden email]>
Signed-off-by: Christoph Hellwig <[hidden email]>
(cherry picked from commit 8427bbc224863e14d905c87920d4005cb3e88ac3)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/nvme/host/pci.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index ba41b660b259..c0e039cce4ab 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2269,7 +2269,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) {
  /*
@@ -2284,6 +2284,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;
@@ -2323,7 +2331,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
  if (result)
  goto unmap;
 
- 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);
--
2.15.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/APPLIED[B]: [SRU] [Artful] [PATCH 0/1] Fix Samsung NVMe drops off PCI bus After S3

Seth Forshee
In reply to this post by Kai-Heng Feng
On Tue, Jan 09, 2018 at 02:49:16PM +0800, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1705748
>
> [Impact]
> A user reported his NVMe went out to lunch after S3.
>
> [Fix]
> Disable APST for this particular NVMe + Motherboard setup.
>
> [Test]
> User confirmed this quirk works for his system.
>
> [Regression Potential]
> Very Low. This applies to a specific device setup, also user can
> override this quirk by "nvme_core.force_apst=1".

Acked-by: Seth Forshee <[hidden email]>

Please try to remember to include patches like this for the development
release as well. I have applied it to bionic/master-next. Thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU] [Artful] [PATCH 0/1] Fix Samsung NVMe drops off PCI bus After S3

Stefan Bader-2
In reply to this post by Kai-Heng Feng
On 09.01.2018 07:49, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1705748
>
> [Impact]
> A user reported his NVMe went out to lunch after S3.
>
> [Fix]
> Disable APST for this particular NVMe + Motherboard setup.
>
> [Test]
> User confirmed this quirk works for his system.
>
> [Regression Potential]
> Very Low. This applies to a specific device setup, also user can
> override this quirk by "nvme_core.force_apst=1".
>
> Kai-Heng Feng (1):
>   nvme-pci: disable APST on Samsung SSD 960 EVO + ASUS PRIME B350M-A
>
>  drivers/nvme/host/pci.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
Acked-by: Stefan Bader <[hidden email]>



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU] [Artful] [PATCH 0/1] Fix Samsung NVMe drops off PCI bus After S3

Khaled Elmously
In reply to this post by Kai-Heng Feng
Applied to artful

On 2018-01-09 14:49:16 , Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1705748
>
> [Impact]
> A user reported his NVMe went out to lunch after S3.
>
> [Fix]
> Disable APST for this particular NVMe + Motherboard setup.
>
> [Test]
> User confirmed this quirk works for his system.
>
> [Regression Potential]
> Very Low. This applies to a specific device setup, also user can
> override this quirk by "nvme_core.force_apst=1".
>
> Kai-Heng Feng (1):
>   nvme-pci: disable APST on Samsung SSD 960 EVO + ASUS PRIME B350M-A
>
>  drivers/nvme/host/pci.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> --
> 2.15.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team