From patchwork Thu Nov 29 07:44:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1005184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KfsHAq8T"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4358gG4r6Vz9s47; Thu, 29 Nov 2018 18:44:42 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1gSH02-0000yT-6n; Thu, 29 Nov 2018 07:44:38 +0000 Received: from mail-pl1-f194.google.com ([209.85.214.194]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1gSH00-0000w7-Q9 for kernel-team@lists.ubuntu.com; Thu, 29 Nov 2018 07:44:36 +0000 Received: by mail-pl1-f194.google.com with SMTP id e5so611263plb.5 for ; Wed, 28 Nov 2018 23:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=yl0O7pxMJas5TVGCfzPVDlYT39LjPvRcnCsOJXT2P5M=; b=KfsHAq8TLI5dJN1PYYV/Gyo81beOtfX/dMagD7m4qxGDqJl4mbJ6McKzIg8SDveUtd ACSQ+vUK9+9Wfk6zfDMnOTIvMTq5JB802sYFChIIvaoCuFXbdTe2MAuSXlGQNZB74UAQ g7mfmpqocETZ1DjEeupt4tmct7+IvuWqxxSrMrnREdQTgOj/IH6drxIWOGAblhPIdfFN hA0QNKQF/wIna+ExN1eSdXtizYww0bTP6vstTxmbWzftBU60k8pVH6l3jqiU/uRwH2pH 2dCP1M4MFyo2A9aYv6P4BAmYorTi+ZIwkjYDPsC6e/ymxbYJm+u5JCPb/5r73sRvpf4H ocmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=yl0O7pxMJas5TVGCfzPVDlYT39LjPvRcnCsOJXT2P5M=; b=YCASv4hHEydTNhDc2XnrnUmThX8k5vJyLSu+J8fxis+mSYmePj7722uqxccey1Vwof 5OnNWut1H2iN5L01IJQYkEjQkmvapgyD2tRwwh8fAPsIYWOtoCDLAgBVwXsUNibxiW9i pL4PMBjK2Hpn6RdYVWI5L/aaltDzhW+nlVxyZbDb13tOYnX+xbOI/KwgS7UNpzaqqtec gfEA7QQhLDaTcCjE7g4/4GZAD3JKpAi7u19VZ743ESt0v6WSBcYmH/XoJ89uC345BEjT iVU9jJ72+eQRabRCqhuiwjDDp4zJwXz3ulvE3Aj16iqifSDjPT5ayTXpG4zDjCA40kJp 31Jg== X-Gm-Message-State: AA+aEWY9lJZd7LJAtFbLDoWQrkI4v8mAyg0EI6qIIbWO/9avFZ2cd0dF eDOE/EQ46ssrFkc2LbbASdSkkELP X-Google-Smtp-Source: AFSGD/X7bCsfJyZepjfCGJWP6OnVbLIZYVhDmIeE89Wj6gczN8sAtGvP8TKX4DtFGKj19Vgryp4ZMA== X-Received: by 2002:a17:902:24d:: with SMTP id 71mr409798plc.225.1543477474882; Wed, 28 Nov 2018 23:44:34 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id n73sm1862112pfj.148.2018.11.28.23.44.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 23:44:34 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][C][D] SAUCE: pci/nvme: prevent WDC PC SN720 NVMe from entering D3 and being disabled Date: Thu, 29 Nov 2018 15:44:25 +0800 Message-Id: <20181129074425.1963-3-acelan.kao@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181129074425.1963-1-acelan.kao@canonical.com> References: <20181129074425.1963-1-acelan.kao@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" 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 --- 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 8c72ced501d7..fa320741f457 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2775,6 +2775,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 232ed8ad2432..0a990b5b1264 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -1340,6 +1340,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.