From patchwork Thu Nov 29 08:13:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1005201 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="ESePh15K"; 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 4359JR4lszz9s3Z; Thu, 29 Nov 2018 19:13:27 +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 1gSHRp-00046M-H8; Thu, 29 Nov 2018 08:13:21 +0000 Received: from mail-pg1-f194.google.com ([209.85.215.194]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1gSHRn-00046A-IC for kernel-team@lists.ubuntu.com; Thu, 29 Nov 2018 08:13:19 +0000 Received: by mail-pg1-f194.google.com with SMTP id z11so589849pgu.0 for ; Thu, 29 Nov 2018 00:13:19 -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=aJm3HZ1RifzkralV14A6P5jOt/lTKY90+R4cv2ew1To=; b=ESePh15K1YlWJuYQUOgkUdGm7Z9BerDcjo5Xlxb9YKOwFR56RrL7s3k8caOzprgyH7 eD3ENfmuIGquW98PpixTMkdHFduEe4jl+3tMg80kKXPxU6/twfRNiy9QULcoJ7vhNDAF xiA9W+nNuMSAIjCiEQawMHnU9lswp9JIKHLLURl3oRproDMdwTvDryXwaonUbs+UIC1N /nIry8OTte6P6mZuv7RDAdYno5tRs4kLeSE0Jo0scqDYXwh/iEuXQ0n4DyCB17M3LNme uOtWVzLAOLcYLYtDEBRVwKQKAXjphxpc805ygGh8VCyGJ3Bb/gM4e2T8QHkfW78XyoMu HGHw== 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=aJm3HZ1RifzkralV14A6P5jOt/lTKY90+R4cv2ew1To=; b=DfA46h24iU3l2Ki4lJmJP2CsOth/bbsBU4jjl/oLxPCcXypgUH23zEP6BCo8uJsfGN gDBOmWpIUYVAfHD3S4K/hkx1p6vCZbHvBCHwL8P39AXoU0cM/NLtX3TPKPHGMkFfcRlI D0/pxbr2kfxZXJ/xQVI82nBEvHLlj5qxRMLLNma6Z1Uxh9g3hHZR5quys4HvQHDGf4a6 wLPTBlpWPTI2w98rWn4UrZLoUtmS/nXzs0R9gEgTdNKq97/COxwfAvrg1068oHbclZP5 LU6iNKiXCvj7/I9w1axnunc/yLNIgN+9EDRQzpdjpu2/D5v8SFTKkR5KFK5R78iwC7qy wpVQ== X-Gm-Message-State: AA+aEWbOvVIaG2GALkHI6DknePhQTt8zkgB9XwzRdYU7+z1JKhKI2ZmW 38Kf/Qd2D6StLjZZwE9EmZ+f3Bso X-Google-Smtp-Source: AFSGD/UDmMycocJ8lhOgB9Ni4lTLKLGoCz5L2WHztnvgBYzY2RZSiwYuL2WwI9gfuspFxsAjgDtdYQ== X-Received: by 2002:a63:5e43:: with SMTP id s64mr417251pgb.101.1543479197663; Thu, 29 Nov 2018 00:13:17 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id e188sm1923383pfg.130.2018.11.29.00.13.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Nov 2018 00:13:16 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [RESEND][PATCH 1/1][B][OEM-B] SAUCE: pci/nvme: prevent WDC PC SN720 NVMe from entering D3 and being disabled Date: Thu, 29 Nov 2018 16:13:14 +0800 Message-Id: <20181129081314.8673-1-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 Acked-by: Stefan Bader --- 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.