From patchwork Sat Nov 6 12:10:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 1551663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=gMMgnOjw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hmbnk49dsz9sWJ for ; Sat, 6 Nov 2021 23:11:21 +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 1mjKXN-0005bf-01; Sat, 06 Nov 2021 12:11:08 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mjKXI-0005bC-C4 for kernel-team@lists.ubuntu.com; Sat, 06 Nov 2021 12:11:04 +0000 Received: from HP-EliteBook-840-G7.. (1-171-213-210.dynamic-ip.hinet.net [1.171.213.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 596053F1B4 for ; Sat, 6 Nov 2021 12:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1636200664; bh=dGiyFM0eVJI6kNu0qR1mHNd2qCKpELQI/JwjZhcp0UQ=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=gMMgnOjw//4p4/CD5xuWPSqlJAhSX53VPE9pOPbt513JHgH7nJFU42skdcgoPnEqZ AihaAEQuey7X/OJqi9Hp/MXKtkwc8zbR+cq/iAmegsHjJTYEpNmcJP0o6AUPthmIXz QSFlsGUvORCZPsc6jUocVZvWZTVEXXJMmzLhK4iHIPjhbImF5F/Qtk3w1FLrBuOlwV rNMD2bCZv7DYfbCOKhjXIAfEUaxePf+39RptousNsrdNze1903nNALjFeH2cCzF4tg D1pMP4DVfZHuTvJCM27HgEjvfI4k9ij4WG8wU6GFca2wx++Dj0SupChLO4yML4mP18 gJvs2qw3rrAJA== From: Kai-Heng Feng To: kernel-team@lists.ubuntu.com Subject: [SRU] [H/I/OEM-5.10/OEM-5.13/OEM-5.14] [PATCH 0/4] Let NVMe with HMB use native power control again Date: Sat, 6 Nov 2021 20:10:54 +0800 Message-Id: <20211106121058.1843173-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1950042 [Impact] NVMe with HMB may still do DMA during suspend, so there was a commit that put the NVMe to PCI D3 during suspend to prevent DMA activities. However, this makes them consumes much more power because modern NVMe requires to stay at PCI D0 to make its natve power control work. [Fix] Instead of put the NVMe to PCI D3 and reset it afterward, simply disable HMB and re-enable HMB, for suspend and resume respectively. [Test] On affected system, Intel SoC can only reach PC3 during suspend. With the SRU applied, the Intel SoC can reach PC10 and SLP_S0 and use significant less power. [Where problems could occur] The original approach, i.e. disable NVMe and put it to PCI D3 to prevent DMA activies, was just a precaution. There wasn't any case that indicates it happens in practice. This is a different approach to the same problem, which is a theoretical problem. Keith Busch (4): nvme-pci: use attribute group for cmb sysfs nvme-pci: cmb sysfs: one file, one value nvme-pci: disable hmb on idle suspend nvme: allow user toggling hmb usage drivers/nvme/host/pci.c | 165 +++++++++++++++++++++++++++++++--------- 1 file changed, 131 insertions(+), 34 deletions(-) Acked-by: Tim Gardner Acked-by: Stefan Bader Acked-by: Tim Gardner