Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. ---
  2. drivers/nvme/host/nvme.h | 5 +++++
  3. drivers/nvme/host/pci.c | 10 ++++++++++
  4. 2 files changed, 15 insertions(+)
  5.  
  6. diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
  7. index 8e4550fa08f8..e970423b7944 100644
  8. --- a/drivers/nvme/host/nvme.h
  9. +++ b/drivers/nvme/host/nvme.h
  10. @@ -83,6 +83,11 @@ enum nvme_quirks {
  11. * Supports the LighNVM command set if indicated in vs[1].
  12. */
  13. NVME_QUIRK_LIGHTNVM = (1 << 6),
  14. +
  15. + /*
  16. + * The controller needs to do a PCI reset after resume.
  17. + */
  18. + NVME_QUIRK_PCI_RESET_RESUME = (1 << 7),
  19. };
  20.  
  21. /*
  22. diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
  23. index 6fe7af00a1f4..e96dc301a4e7 100644
  24. --- a/drivers/nvme/host/pci.c
  25. +++ b/drivers/nvme/host/pci.c
  26. @@ -2084,6 +2084,9 @@ static int nvme_pci_enable(struct nvme_dev *dev)
  27. int result = -ENOMEM;
  28. struct pci_dev *pdev = to_pci_dev(dev->dev);
  29.  
  30. + if (dev->ctrl.quirks & NVME_QUIRK_PCI_RESET_RESUME)
  31. + pci_reset_function(pdev);
  32. +
  33. if (pci_enable_device_mem(pdev))
  34. return result;
  35.  
  36. @@ -2455,6 +2458,13 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
  37. if (dmi_match(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC.") &&
  38. dmi_match(DMI_BOARD_NAME, "PRIME B350M-A"))
  39. return NVME_QUIRK_NO_APST;
  40. + /*
  41. + * Samsung SSD 960 EVO and SM961/PM961 drop off the PCIe bus
  42. + * after system suspend on Razer Blade Stealth.
  43. + */
  44. + else if (dmi_match(DMI_SYS_VENDOR, "Razer") &&
  45. + dmi_match(DMI_PRODUCT_NAME, "Blade Stealth"))
  46. + return NVME_QUIRK_PCI_RESET_RESUME;
  47. }
  48.  
  49. return 0;
  50. --
  51. 2.15.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement