diff mbox series

[RESEND,1/1,B,OEM-B] SAUCE: pci/nvme: prevent WDC PC SN720 NVMe from entering D3 and being disabled

Message ID 20181129081314.8673-1-acelan.kao@canonical.com
State Accepted
Headers show
Series [RESEND,1/1,B,OEM-B] SAUCE: pci/nvme: prevent WDC PC SN720 NVMe from entering D3 and being disabled | expand

Commit Message

AceLan Kao Nov. 29, 2018, 8:13 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1805775

It leads to the power consumption increases 3.41W during s2idle, while it
consumes much less idle if forbidding put WDC NVMe to D3 and before
entering S2Idle.

Windows doesn't put NVMe to D3 in Modern Standby, and uses its own APST
feature to do the power management. To leverage its APST feature during
s2idle, we can't disable nvme device while suspending, too.

So, here is what we do to the driver:
- Prevent nvme from entering D3,
- Prevent nvme from being disabled when suspending.

Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
---
 drivers/nvme/host/pci.c | 2 ++
 drivers/pci/quirks.c    | 1 +
 2 files changed, 3 insertions(+)

Comments

Stefan Bader Jan. 7, 2019, 3:20 p.m. UTC | #1
On 29.11.18 09:13, AceLan Kao wrote:
> BugLink: https://bugs.launchpad.net/bugs/1805775
> 
> It leads to the power consumption increases 3.41W during s2idle, while it
> consumes much less idle if forbidding put WDC NVMe to D3 and before
> entering S2Idle.
> 
> Windows doesn't put NVMe to D3 in Modern Standby, and uses its own APST
> feature to do the power management. To leverage its APST feature during
> s2idle, we can't disable nvme device while suspending, too.
> 
> So, here is what we do to the driver:
> - Prevent nvme from entering D3,
> - Prevent nvme from being disabled when suspending.
> 
> Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---

Limited in scope, same note as from Seth to remind us to add a "UBUNTU: " prefix
before SAUCE when applying.

>  drivers/nvme/host/pci.c | 2 ++
>  drivers/pci/quirks.c    | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 63e8d3010d1c..eea4c99f3411 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2717,6 +2717,8 @@ static const struct pci_device_id nvme_id_table[] = {
>  		.driver_data = NVME_QUIRK_LIGHTNVM, },
>  	{ PCI_VDEVICE(SK_HYNIX, 0x1527),	/* Sk Hynix */
>  		.driver_data = NVME_QUIRK_NO_DISABLE, },
> +	{ PCI_DEVICE(0x15b7, 0x5002),   /* Sandisk */
> +		.driver_data = NVME_QUIRK_NO_DISABLE, },
>  	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index f81dea5bff71..54f68bb5e993 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -1188,6 +1188,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID,
>  				PCI_CLASS_STORAGE_IDE, 8, quirk_no_ata_d3);
>  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SK_HYNIX, 0x1527, quirk_no_ata_d3);
>  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0xf1a6, quirk_no_ata_d3);
> +DECLARE_PCI_FIXUP_EARLY(0x15b7, 0x5002, quirk_no_ata_d3);
>  
>  /* This was originally an Alpha specific thing, but it really fits here.
>   * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
>
diff mbox series

Patch

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 63e8d3010d1c..eea4c99f3411 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2717,6 +2717,8 @@  static const struct pci_device_id nvme_id_table[] = {
 		.driver_data = NVME_QUIRK_LIGHTNVM, },
 	{ PCI_VDEVICE(SK_HYNIX, 0x1527),	/* Sk Hynix */
 		.driver_data = NVME_QUIRK_NO_DISABLE, },
+	{ PCI_DEVICE(0x15b7, 0x5002),   /* Sandisk */
+		.driver_data = NVME_QUIRK_NO_DISABLE, },
 	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index f81dea5bff71..54f68bb5e993 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1188,6 +1188,7 @@  DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID,
 				PCI_CLASS_STORAGE_IDE, 8, quirk_no_ata_d3);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SK_HYNIX, 0x1527, quirk_no_ata_d3);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0xf1a6, quirk_no_ata_d3);
+DECLARE_PCI_FIXUP_EARLY(0x15b7, 0x5002, quirk_no_ata_d3);
 
 /* This was originally an Alpha specific thing, but it really fits here.
  * The i82375 PCI/EISA bridge appears as non-classified. Fix that.