From patchwork Mon Jan 11 08:01:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmPr4y2hz9sj5; Mon, 11 Jan 2021 19:01:52 +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 1kys97-0005QU-0s; Mon, 11 Jan 2021 08:01:49 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys95-0005Q5-15 for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:47 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys93-0007e8-50 for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:46 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/9][G/H/U/OEM-5.10] Revert "UBUNTU: SAUCE: e1000e: bump up timeout to wait when ME un-configure ULP mode" Date: Mon, 11 Jan 2021 16:01:24 +0800 Message-Id: <20210111080132.622317-2-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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/1910541 This reverts commit b97a9ad57d72cd17b36f7bf819b532e2a1a4be5e. Revert the sauce patch to use upstream patch instead. Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index b094c069aee1..682f6a7bd5c1 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1248,9 +1248,9 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) ew32(H2ME, mac_reg); } - /* Poll up to 2.5sec for ME to clear ULP_CFG_DONE. */ + /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */ while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) { - if (i++ == 250) { + if (i++ == 30) { ret_val = -E1000_ERR_PHY; goto out; } From patchwork Mon Jan 11 08:01:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424447 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmPw3t9Dz9sjD; Mon, 11 Jan 2021 19:01:56 +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 1kys9B-0005Ru-7j; Mon, 11 Jan 2021 08:01:53 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys97-0005Qr-CI for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:49 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys96-0007e8-B5 for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:49 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/9][OEM-5.10] Revert "UBUNTU: SAUCE: e1000e: Add more Dell AIO systems into s0ix heuristics" Date: Mon, 11 Jan 2021 16:01:25 +0800 Message-Id: <20210111080132.622317-3-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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/1910541 This reverts commit 00acdc20617df32e3dd50b95d3b8e1feeb198e50. Formally enable s0ix for all platform, then we can remove quirks that enable s0ix on the specific platform. Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/e1000e/param.c | 28 ----------------------- 1 file changed, 28 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c index 882cad09d978..fe3157c8aa4a 100644 --- a/drivers/net/ethernet/intel/e1000e/param.c +++ b/drivers/net/ethernet/intel/e1000e/param.c @@ -294,34 +294,6 @@ static const struct dmi_system_id s0ix_supported_systems[] = { DMI_MATCH(DMI_PRODUCT_SKU, "0A42"), }, }, - { - /* Dell AIO 0x0A46 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "0A46"), - }, - }, - { - /* Dell AIO 0x0A47 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "0A47"), - }, - }, - { - /* Dell AIO 0x0A48 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "0A48"), - }, - }, - { - /* Dell AIO 0x0A49 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "0A49"), - }, - }, { } }; From patchwork Mon Jan 11 08:01:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424448 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmPw42XLz9srZ; Mon, 11 Jan 2021 19:01:56 +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 1kys9B-0005SB-Fk; Mon, 11 Jan 2021 08:01:53 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys99-0005RL-Nj for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:51 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys98-0007e8-Fy for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:51 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/9][U/OEM-5.10] Revert "UBUNTU: SAUCE: e1000e: Add more Dell CML systems into s0ix heuristics" Date: Mon, 11 Jan 2021 16:01:26 +0800 Message-Id: <20210111080132.622317-4-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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/1910541 This reverts commit 366c6a19f2b3d5327c2e332da4bc0e7d36cf3ab0. Formally enable s0ix for all platform, then we can remove quirks that enable s0ix on the specific platform. Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/e1000e/param.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c index fe3157c8aa4a..58e6718c4f75 100644 --- a/drivers/net/ethernet/intel/e1000e/param.c +++ b/drivers/net/ethernet/intel/e1000e/param.c @@ -273,27 +273,6 @@ static const struct dmi_system_id s0ix_supported_systems[] = { DMI_MATCH(DMI_PRODUCT_SKU, "09C4"), }, }, - { - /* Dell Notebook 0x0A40 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "0A40"), - }, - }, - { - /* Dell Notebook 0x0A41 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "0A41"), - }, - }, - { - /* Dell Notebook 0x0A42 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "0A42"), - }, - }, { } }; From patchwork Mon Jan 11 08:01:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmPz15G2z9sW8; Mon, 11 Jan 2021 19:01:59 +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 1kys9D-0005Ta-TB; Mon, 11 Jan 2021 08:01:55 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9C-0005Sc-2v for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:54 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9A-0007e8-Ui for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:01:53 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/9][U/OEM-5.10] Revert "UBUNTU: SAUCE: e1000e: Add Dell's Comet Lake systems into s0ix heuristics" Date: Mon, 11 Jan 2021 16:01:27 +0800 Message-Id: <20210111080132.622317-5-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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/1910541 This reverts commit 5fa550a99a4e2c9c894a64da4dbc8510ee7c9c5c. Formally enable s0ix for all platform, then we can remove quirks that enable s0ix on the specific platform. Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/Kconfig | 1 - drivers/net/ethernet/intel/e1000e/param.c | 80 +---------------------- 2 files changed, 1 insertion(+), 80 deletions(-) diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig index 280af47d74d2..5aa86318ed3e 100644 --- a/drivers/net/ethernet/intel/Kconfig +++ b/drivers/net/ethernet/intel/Kconfig @@ -58,7 +58,6 @@ config E1000 config E1000E tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support" depends on PCI && (!SPARC32 || BROKEN) - depends on DMI select CRC32 imply PTP_1588_CLOCK help diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c index 58e6718c4f75..e66b222c824b 100644 --- a/drivers/net/ethernet/intel/e1000e/param.c +++ b/drivers/net/ethernet/intel/e1000e/param.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 1999 - 2018 Intel Corporation. */ -#include #include #include #include @@ -202,80 +201,6 @@ static const struct e1000e_me_supported me_supported[] = { {0} }; -static const struct dmi_system_id s0ix_supported_systems[] = { - { - /* Dell Latitude 5310 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "099F"), - }, - }, - { - /* Dell Latitude 5410 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09A0"), - }, - }, - { - /* Dell Latitude 5410 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09C9"), - }, - }, - { - /* Dell Latitude 5510 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09A1"), - }, - }, - { - /* Dell Precision 3550 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09A2"), - }, - }, - { - /* Dell Latitude 5411 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09C0"), - }, - }, - { - /* Dell Latitude 5511 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09C1"), - }, - }, - { - /* Dell Precision 3551 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09C2"), - }, - }, - { - /* Dell Precision 7550 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09C3"), - }, - }, - { - /* Dell Precision 7750 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_SKU, "09C4"), - }, - }, - { } -}; - static bool e1000e_check_me(u16 device_id) { struct e1000e_me_supported *id; @@ -674,11 +599,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) } if (enabled == S0IX_HEURISTICS) { - /* check for allowlist of systems */ - if (dmi_check_system(s0ix_supported_systems)) - enabled = S0IX_FORCE_ON; /* default to off for ME configurations */ - else if (e1000e_check_me(hw->adapter->pdev->device)) + if (e1000e_check_me(hw->adapter->pdev->device)) enabled = S0IX_FORCE_OFF; } From patchwork Mon Jan 11 08:01:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424450 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmQ72YTqz9sWC; Mon, 11 Jan 2021 19:02:07 +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 1kys9L-0005ZN-VO; Mon, 11 Jan 2021 08:02:03 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9J-0005Xf-8i for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:01 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9D-0007e8-6c for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:01 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/9][U/OEM-5.10] Revert "UBUNTU: SAUCE: e1000e: allow turning s0ix flows on for systems with ME" Date: Mon, 11 Jan 2021 16:01:28 +0800 Message-Id: <20210111080132.622317-6-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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/1910541 This reverts commit a5a0565aa79efc1e86346c55c3dabaf8f1516a0a. Formally enable s0ix for all platform, then we can remove quirks that enable s0ix on the specific platform. Signed-off-by: Aaron Ma --- .../device_drivers/ethernet/intel/e1000e.rst | 23 ---- drivers/net/ethernet/intel/e1000e/e1000.h | 7 -- drivers/net/ethernet/intel/e1000e/netdev.c | 64 +++++----- drivers/net/ethernet/intel/e1000e/param.c | 110 ------------------ 4 files changed, 38 insertions(+), 166 deletions(-) diff --git a/Documentation/networking/device_drivers/ethernet/intel/e1000e.rst b/Documentation/networking/device_drivers/ethernet/intel/e1000e.rst index da029b703573..f49cd370e7bf 100644 --- a/Documentation/networking/device_drivers/ethernet/intel/e1000e.rst +++ b/Documentation/networking/device_drivers/ethernet/intel/e1000e.rst @@ -249,29 +249,6 @@ Debug This parameter adjusts the level of debug messages displayed in the system logs. -EnableS0ix ----------- -:Valid Range: 0, 1, 2 -:Default Value: 1 (Use Heuristics) - - +-------+----------------+ - | Value | EnableS0ix | - +=======+================+ - | 0 | Disabled | - +-------+----------------+ - | 1 | Use Heuristics | - +-------+----------------+ - | 2 | Enabled | - +-------+----------------+ - -Controls whether the e1000e driver will attempt s0ix flows. S0ix flows require -correct platform configuration. By default the e1000e driver will use some heuristics -to decide whether to enable s0ix. This parameter can be used to override heuristics. - -Additionally a sysfs file "enable_s0ix" will be present that can change the value at -runtime. - -Note: This option is only effective on Cannon Point or later hardware. Additional Features and Configurations ====================================== diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index 32262fa7e085..ba7a0f8f6937 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h @@ -436,7 +436,6 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca); #define FLAG2_DFLT_CRC_STRIPPING BIT(12) #define FLAG2_CHECK_RX_HWTSTAMP BIT(13) #define FLAG2_CHECK_SYSTIM_OVERFLOW BIT(14) -#define FLAG2_ENABLE_S0IX_FLOWS BIT(15) #define E1000_RX_DESC_PS(R, i) \ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) @@ -463,12 +462,6 @@ enum latency_range { extern char e1000e_driver_name[]; void e1000e_check_options(struct e1000_adapter *adapter); -ssize_t enable_s0ix_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count); -ssize_t enable_s0ix_show(struct device *dev, - struct device_attribute *attr, - char *buf); void e1000e_set_ethtool_ops(struct net_device *netdev); int e1000e_open(struct net_device *netdev); diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 8beeb3e8780a..128ab6898070 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -103,17 +103,45 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = { {0, NULL} }; -static DEVICE_ATTR_RW(enable_s0ix); - -static struct attribute *e1000e_attrs[] = { - &dev_attr_enable_s0ix.attr, - NULL, +struct e1000e_me_supported { + u16 device_id; /* supported device ID */ }; -static struct attribute_group e1000e_group = { - .attrs = e1000e_attrs, +static const struct e1000e_me_supported me_supported[] = { + {E1000_DEV_ID_PCH_LPT_I217_LM}, + {E1000_DEV_ID_PCH_LPTLP_I218_LM}, + {E1000_DEV_ID_PCH_I218_LM2}, + {E1000_DEV_ID_PCH_I218_LM3}, + {E1000_DEV_ID_PCH_SPT_I219_LM}, + {E1000_DEV_ID_PCH_SPT_I219_LM2}, + {E1000_DEV_ID_PCH_LBG_I219_LM3}, + {E1000_DEV_ID_PCH_SPT_I219_LM4}, + {E1000_DEV_ID_PCH_SPT_I219_LM5}, + {E1000_DEV_ID_PCH_CNP_I219_LM6}, + {E1000_DEV_ID_PCH_CNP_I219_LM7}, + {E1000_DEV_ID_PCH_ICP_I219_LM8}, + {E1000_DEV_ID_PCH_ICP_I219_LM9}, + {E1000_DEV_ID_PCH_CMP_I219_LM10}, + {E1000_DEV_ID_PCH_CMP_I219_LM11}, + {E1000_DEV_ID_PCH_CMP_I219_LM12}, + {E1000_DEV_ID_PCH_TGP_I219_LM13}, + {E1000_DEV_ID_PCH_TGP_I219_LM14}, + {E1000_DEV_ID_PCH_TGP_I219_LM15}, + {0} }; +static bool e1000e_check_me(u16 device_id) +{ + struct e1000e_me_supported *id; + + for (id = (struct e1000e_me_supported *)me_supported; + id->device_id; id++) + if (device_id == id->device_id) + return true; + + return false; +} + /** * __ew32_prepare - prepare to write to MAC CSR register on certain parts * @hw: pointer to the HW structure @@ -4215,7 +4243,7 @@ void e1000e_reset(struct e1000_adapter *adapter) /** * e1000e_trigger_lsc - trigger an LSC interrupt - * @adapter: + * @adapter: * * Fire a link status change interrupt to start the watchdog. **/ @@ -6947,7 +6975,7 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev) /* Introduce S0ix implementation */ if (hw->mac.type >= e1000_pch_cnp && - adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS) + !e1000e_check_me(hw->adapter->pdev->device)) e1000e_s0ix_entry_flow(adapter); return rc; @@ -6963,7 +6991,7 @@ static __maybe_unused int e1000e_pm_resume(struct device *dev) /* Introduce S0ix implementation */ if (hw->mac.type >= e1000_pch_cnp && - adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS) + !e1000e_check_me(hw->adapter->pdev->device)) e1000e_s0ix_exit_flow(adapter); rc = __e1000_resume(pdev); @@ -7627,13 +7655,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (!(adapter->flags & FLAG_HAS_AMT)) e1000e_get_hw_control(adapter); - /* offer to turn on/off s0ix flows */ - if (hw->mac.type >= e1000_pch_cnp) { - ret_val = sysfs_create_group(&pdev->dev.kobj, &e1000e_group); - if (ret_val) - goto err_sysfs; - } - strlcpy(netdev->name, "eth%d", sizeof(netdev->name)); err = register_netdev(netdev); if (err) @@ -7652,10 +7673,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return 0; err_register: - if (hw->mac.type >= e1000_pch_cnp) - sysfs_remove_group(&pdev->dev.kobj, &e1000e_group); - -err_sysfs: if (!(adapter->flags & FLAG_HAS_AMT)) e1000e_release_hw_control(adapter); err_eeprom: @@ -7693,7 +7710,6 @@ static void e1000_remove(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); struct e1000_adapter *adapter = netdev_priv(netdev); - struct e1000_hw *hw = &adapter->hw; e1000e_ptp_remove(adapter); @@ -7718,10 +7734,6 @@ static void e1000_remove(struct pci_dev *pdev) } } - /* only allow turning on/off s0ix for cannon point and later */ - if (hw->mac.type >= e1000_pch_cnp) - sysfs_remove_group(&pdev->dev.kobj, &e1000e_group); - unregister_netdev(netdev); if (pci_dev_run_wake(pdev)) diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c index e66b222c824b..ebe121db4307 100644 --- a/drivers/net/ethernet/intel/e1000e/param.c +++ b/drivers/net/ethernet/intel/e1000e/param.c @@ -138,20 +138,6 @@ E1000_PARAM(WriteProtectNVM, E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs the CRC"); -/* Enable s0ix flows - * - * Valid Range: varies depending on hardware support - * - * disabled=0, heuristics=1, enabled=2 - * - * Default Value: 1 (heuristics) - */ -E1000_PARAM(EnableS0ix, - "Enable S0ix flows for the system"); -#define S0IX_FORCE_ON 2 -#define S0IX_HEURISTICS 1 -#define S0IX_FORCE_OFF 0 - struct e1000_option { enum { enable_option, range_option, list_option } type; const char *name; @@ -174,45 +160,6 @@ struct e1000_option { } arg; }; -struct e1000e_me_supported { - u16 device_id; /* supported device ID */ -}; - -static const struct e1000e_me_supported me_supported[] = { - {E1000_DEV_ID_PCH_LPT_I217_LM}, - {E1000_DEV_ID_PCH_LPTLP_I218_LM}, - {E1000_DEV_ID_PCH_I218_LM2}, - {E1000_DEV_ID_PCH_I218_LM3}, - {E1000_DEV_ID_PCH_SPT_I219_LM}, - {E1000_DEV_ID_PCH_SPT_I219_LM2}, - {E1000_DEV_ID_PCH_LBG_I219_LM3}, - {E1000_DEV_ID_PCH_SPT_I219_LM4}, - {E1000_DEV_ID_PCH_SPT_I219_LM5}, - {E1000_DEV_ID_PCH_CNP_I219_LM6}, - {E1000_DEV_ID_PCH_CNP_I219_LM7}, - {E1000_DEV_ID_PCH_ICP_I219_LM8}, - {E1000_DEV_ID_PCH_ICP_I219_LM9}, - {E1000_DEV_ID_PCH_CMP_I219_LM10}, - {E1000_DEV_ID_PCH_CMP_I219_LM11}, - {E1000_DEV_ID_PCH_CMP_I219_LM12}, - {E1000_DEV_ID_PCH_TGP_I219_LM13}, - {E1000_DEV_ID_PCH_TGP_I219_LM14}, - {E1000_DEV_ID_PCH_TGP_I219_LM15}, - {0} -}; - -static bool e1000e_check_me(u16 device_id) -{ - struct e1000e_me_supported *id; - - for (id = (struct e1000e_me_supported *)me_supported; - id->device_id; id++) - if (device_id == id->device_id) - return true; - - return false; -} - static int e1000_validate_option(unsigned int *value, const struct e1000_option *opt, struct e1000_adapter *adapter) @@ -579,61 +526,4 @@ void e1000e_check_options(struct e1000_adapter *adapter) } } } - /* Enable S0ix flows */ - { - static const struct e1000_option opt = { - .type = range_option, - .name = "S0ix flows (Cannon point or later)", - .err = "defaulting to heuristics", - .def = S0IX_HEURISTICS, - .arg = { .r = { .min = S0IX_FORCE_OFF, - .max = S0IX_FORCE_ON } } - }; - unsigned int enabled = opt.def; - - if (num_EnableS0ix > bd) { - unsigned int s0ix = EnableS0ix[bd]; - - e1000_validate_option(&s0ix, &opt, adapter); - enabled = s0ix; - } - - if (enabled == S0IX_HEURISTICS) { - /* default to off for ME configurations */ - if (e1000e_check_me(hw->adapter->pdev->device)) - enabled = S0IX_FORCE_OFF; - } - - if (enabled > S0IX_FORCE_OFF) - adapter->flags2 |= FLAG2_ENABLE_S0IX_FLOWS; - } -} - -ssize_t enable_s0ix_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev)); - struct e1000_adapter *adapter = netdev_priv(netdev); - ssize_t ret; - bool enable_s0ix; - - ret = kstrtobool(buf, &enable_s0ix); - e_info("s0ix flow set to %d\n", enable_s0ix); - if (enable_s0ix) - adapter->flags2 |= FLAG2_ENABLE_S0IX_FLOWS; - else - adapter->flags2 &= ~FLAG2_ENABLE_S0IX_FLOWS; - - return ret ? ret : count; -} - -ssize_t enable_s0ix_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev)); - struct e1000_adapter *adapter = netdev_priv(netdev); - - return sprintf(buf, "%d\n", (adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS) > 0); } From patchwork Mon Jan 11 08:01:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmQ95RnPz9sWC; Mon, 11 Jan 2021 19:02:09 +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 1kys9O-0005bd-CA; Mon, 11 Jan 2021 08:02:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9N-0005aa-41 for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:05 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9L-0007e8-6O for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:04 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/9][G/H/U/OEM-5.10] e1000e: Only run S0ix flows if shutdown succeeded Date: Mon, 11 Jan 2021 16:01:29 +0800 Message-Id: <20210111080132.622317-7-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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" From: Mario Limonciello BugLink: https://bugs.launchpad.net/bugs/1910541 If the shutdown failed, the part will be thawed and running S0ix flows will put it into an undefined state. Reported-by: Alexander Duyck Reviewed-by: Alexander Duyck Signed-off-by: Mario Limonciello Tested-by: Yijun Shen Signed-off-by: Tony Nguyen (cherry picked from commit 808e0d8832cc81738f3e8df12dff0688352baf50) Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/e1000e/netdev.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 128ab6898070..6588f5d4a2be 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -6970,13 +6970,14 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev) e1000e_pm_freeze(dev); rc = __e1000_shutdown(pdev, false); - if (rc) + if (rc) { e1000e_pm_thaw(dev); - - /* Introduce S0ix implementation */ - if (hw->mac.type >= e1000_pch_cnp && - !e1000e_check_me(hw->adapter->pdev->device)) - e1000e_s0ix_entry_flow(adapter); + } else { + /* Introduce S0ix implementation */ + if (hw->mac.type >= e1000_pch_cnp && + !e1000e_check_me(hw->adapter->pdev->device)) + e1000e_s0ix_entry_flow(adapter); + } return rc; } From patchwork Mon Jan 11 08:01:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424452 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmQF3Vtpz9sWC; Mon, 11 Jan 2021 19:02:13 +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 1kys9R-0005eK-HP; Mon, 11 Jan 2021 08:02:09 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9P-0005cV-BH for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:07 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9O-0007e8-8X for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:07 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 7/9][G/H/U/OEM-5.10] e1000e: bump up timeout to wait when ME un-configures ULP mode Date: Mon, 11 Jan 2021 16:01:30 +0800 Message-Id: <20210111080132.622317-8-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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" From: Mario Limonciello BugLink: https://bugs.launchpad.net/bugs/1910541 Per guidance from Intel ethernet architecture team, it may take up to 1 second for unconfiguring ULP mode. However in practice this seems to be taking up to 2 seconds on some Lenovo machines. Detect scenarios that take more than 1 second but less than 2.5 seconds and emit a warning on resume for those scenarios. Suggested-by: Aaron Ma Suggested-by: Sasha Netfin Suggested-by: Hans de Goede CC: Mark Pearson Fixes: f15bb6dde738cc8fa0 ("e1000e: Add support for S0ix") BugLink: https://bugs.launchpad.net/bugs/1865570 Link: https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200323191639.48826-1-aaron.ma@canonical.com/ Link: https://lkml.org/lkml/2020/12/13/15 Link: https://lkml.org/lkml/2020/12/14/708 Signed-off-by: Mario Limonciello Reviewed-by: Hans de Goede Tested-by: Yijun Shen Signed-off-by: Tony Nguyen (cherry picked from commit 3cf31b1a9effd859bb3d6ff9f8b5b0d5e6cac952) Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 682f6a7bd5c1..16cd6c7cd8cc 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1240,6 +1240,9 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) return 0; if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) { + struct e1000_adapter *adapter = hw->adapter; + bool firmware_bug = false; + if (force) { /* Request ME un-configure ULP mode in the PHY */ mac_reg = er32(H2ME); @@ -1248,16 +1251,24 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) ew32(H2ME, mac_reg); } - /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */ + /* Poll up to 2.5 seconds for ME to clear ULP_CFG_DONE. + * If this takes more than 1 second, show a warning indicating a + * firmware bug + */ while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) { - if (i++ == 30) { + if (i++ == 250) { ret_val = -E1000_ERR_PHY; goto out; } + if (i > 100 && !firmware_bug) + firmware_bug = true; usleep_range(10000, 11000); } - e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10); + if (firmware_bug) + e_warn("ULP_CONFIG_DONE took %dmsec. This is a firmware bug\n", i * 10); + else + e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10); if (force) { mac_reg = er32(H2ME); From patchwork Mon Jan 11 08:01:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424453 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmQJ649xz9sWC; Mon, 11 Jan 2021 19:02:16 +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 1kys9V-0005hP-3q; Mon, 11 Jan 2021 08:02:13 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9S-0005eY-0B for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:10 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9Q-0007e8-Gg for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:09 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 8/9][G/H/U/OEM-5.10] Revert "e1000e: disable s0ix entry and exit flows for ME systems" Date: Mon, 11 Jan 2021 16:01:31 +0800 Message-Id: <20210111080132.622317-9-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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" From: Mario Limonciello BugLink: https://bugs.launchpad.net/bugs/1910541 commit e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME systems") disabled s0ix flows for systems that have various incarnations of the i219-LM ethernet controller. This changed caused power consumption regressions on the following shipping Dell Comet Lake based laptops: * Latitude 5310 * Latitude 5410 * Latitude 5410 * Latitude 5510 * Precision 3550 * Latitude 5411 * Latitude 5511 * Precision 3551 * Precision 7550 * Precision 7750 This commit was introduced because of some regressions on certain Thinkpad laptops. This comment was potentially caused by an earlier commit 632fbd5eb5b0e ("e1000e: fix S0ix flows for cable connected case"). or it was possibly caused by a system not meeting platform architectural requirements for low power consumption. Other changes made in the driver with extended timeouts are expected to make the driver more impervious to platform firmware behavior. Fixes: e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME systems") Reviewed-by: Alexander Duyck Signed-off-by: Mario Limonciello Reviewed-by: Hans de Goede Tested-by: Yijun Shen Signed-off-by: Tony Nguyen (cherry picked from commit 6cecf02e77ab9bf97e9252f9fcb8f0738a6de12c) Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/e1000e/netdev.c | 45 +--------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 6588f5d4a2be..b9800ba2006c 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -103,45 +103,6 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = { {0, NULL} }; -struct e1000e_me_supported { - u16 device_id; /* supported device ID */ -}; - -static const struct e1000e_me_supported me_supported[] = { - {E1000_DEV_ID_PCH_LPT_I217_LM}, - {E1000_DEV_ID_PCH_LPTLP_I218_LM}, - {E1000_DEV_ID_PCH_I218_LM2}, - {E1000_DEV_ID_PCH_I218_LM3}, - {E1000_DEV_ID_PCH_SPT_I219_LM}, - {E1000_DEV_ID_PCH_SPT_I219_LM2}, - {E1000_DEV_ID_PCH_LBG_I219_LM3}, - {E1000_DEV_ID_PCH_SPT_I219_LM4}, - {E1000_DEV_ID_PCH_SPT_I219_LM5}, - {E1000_DEV_ID_PCH_CNP_I219_LM6}, - {E1000_DEV_ID_PCH_CNP_I219_LM7}, - {E1000_DEV_ID_PCH_ICP_I219_LM8}, - {E1000_DEV_ID_PCH_ICP_I219_LM9}, - {E1000_DEV_ID_PCH_CMP_I219_LM10}, - {E1000_DEV_ID_PCH_CMP_I219_LM11}, - {E1000_DEV_ID_PCH_CMP_I219_LM12}, - {E1000_DEV_ID_PCH_TGP_I219_LM13}, - {E1000_DEV_ID_PCH_TGP_I219_LM14}, - {E1000_DEV_ID_PCH_TGP_I219_LM15}, - {0} -}; - -static bool e1000e_check_me(u16 device_id) -{ - struct e1000e_me_supported *id; - - for (id = (struct e1000e_me_supported *)me_supported; - id->device_id; id++) - if (device_id == id->device_id) - return true; - - return false; -} - /** * __ew32_prepare - prepare to write to MAC CSR register on certain parts * @hw: pointer to the HW structure @@ -6974,8 +6935,7 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev) e1000e_pm_thaw(dev); } else { /* Introduce S0ix implementation */ - if (hw->mac.type >= e1000_pch_cnp && - !e1000e_check_me(hw->adapter->pdev->device)) + if (hw->mac.type >= e1000_pch_cnp) e1000e_s0ix_entry_flow(adapter); } @@ -6991,8 +6951,7 @@ static __maybe_unused int e1000e_pm_resume(struct device *dev) int rc; /* Introduce S0ix implementation */ - if (hw->mac.type >= e1000_pch_cnp && - !e1000e_check_me(hw->adapter->pdev->device)) + if (hw->mac.type >= e1000_pch_cnp) e1000e_s0ix_exit_flow(adapter); rc = __e1000_resume(pdev); From patchwork Mon Jan 11 08:01:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1424454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4DDmQM0hycz9sWC; Mon, 11 Jan 2021 19:02:19 +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 1kys9X-0005jW-HO; Mon, 11 Jan 2021 08:02:15 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9U-0005gh-BK for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:12 +0000 Received: from [222.129.36.158] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kys9S-0007e8-S9 for kernel-team@lists.ubuntu.com; Mon, 11 Jan 2021 08:02:11 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 9/9][G/H/U/OEM-5.10] e1000e: Export S0ix flags to ethtool Date: Mon, 11 Jan 2021 16:01:32 +0800 Message-Id: <20210111080132.622317-10-aaron.ma@canonical.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210111080132.622317-1-aaron.ma@canonical.com> References: <20210111080132.622317-1-aaron.ma@canonical.com> 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" From: Mario Limonciello BugLink: https://bugs.launchpad.net/bugs/1910541 This flag can be used by an end user to disable S0ix flows on a buggy system or by an OEM for development purposes. If you need this flag to be persisted across reboots, it's suggested to use a udev rule to call adjust it until the kernel could have your configuration in a disallow list. Signed-off-by: Mario Limonciello Reviewed-by: Hans de Goede Tested-by: Yijun Shen Signed-off-by: Tony Nguyen (cherry picked from commit 3c98cbf22a96c1b12f48c1b2a4680dfe5cb280f9) Signed-off-by: Aaron Ma --- drivers/net/ethernet/intel/e1000e/e1000.h | 1 + drivers/net/ethernet/intel/e1000e/ethtool.c | 46 +++++++++++++++++++++ drivers/net/ethernet/intel/e1000e/netdev.c | 9 ++-- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index ba7a0f8f6937..5b2143f4b1f8 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h @@ -436,6 +436,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca); #define FLAG2_DFLT_CRC_STRIPPING BIT(12) #define FLAG2_CHECK_RX_HWTSTAMP BIT(13) #define FLAG2_CHECK_SYSTIM_OVERFLOW BIT(14) +#define FLAG2_ENABLE_S0IX_FLOWS BIT(15) #define E1000_RX_DESC_PS(R, i) \ (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index 03215b0aee4b..06442e6bef73 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c @@ -23,6 +23,13 @@ struct e1000_stats { int stat_offset; }; +static const char e1000e_priv_flags_strings[][ETH_GSTRING_LEN] = { +#define E1000E_PRIV_FLAGS_S0IX_ENABLED BIT(0) + "s0ix-enabled", +}; + +#define E1000E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(e1000e_priv_flags_strings) + #define E1000_STAT(str, m) { \ .stat_string = str, \ .type = E1000_STATS, \ @@ -1776,6 +1783,8 @@ static int e1000e_get_sset_count(struct net_device __always_unused *netdev, return E1000_TEST_LEN; case ETH_SS_STATS: return E1000_STATS_LEN; + case ETH_SS_PRIV_FLAGS: + return E1000E_PRIV_FLAGS_STR_LEN; default: return -EOPNOTSUPP; } @@ -2097,6 +2106,10 @@ static void e1000_get_strings(struct net_device __always_unused *netdev, p += ETH_GSTRING_LEN; } break; + case ETH_SS_PRIV_FLAGS: + memcpy(data, e1000e_priv_flags_strings, + E1000E_PRIV_FLAGS_STR_LEN * ETH_GSTRING_LEN); + break; } } @@ -2305,6 +2318,37 @@ static int e1000e_get_ts_info(struct net_device *netdev, return 0; } +static u32 e1000e_get_priv_flags(struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev_priv(netdev); + u32 priv_flags = 0; + + if (adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS) + priv_flags |= E1000E_PRIV_FLAGS_S0IX_ENABLED; + + return priv_flags; +} + +static int e1000e_set_priv_flags(struct net_device *netdev, u32 priv_flags) +{ + struct e1000_adapter *adapter = netdev_priv(netdev); + unsigned int flags2 = adapter->flags2; + + flags2 &= ~FLAG2_ENABLE_S0IX_FLOWS; + if (priv_flags & E1000E_PRIV_FLAGS_S0IX_ENABLED) { + struct e1000_hw *hw = &adapter->hw; + + if (hw->mac.type < e1000_pch_cnp) + return -EINVAL; + flags2 |= FLAG2_ENABLE_S0IX_FLOWS; + } + + if (flags2 != adapter->flags2) + adapter->flags2 = flags2; + + return 0; +} + static const struct ethtool_ops e1000_ethtool_ops = { .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS, .get_drvinfo = e1000_get_drvinfo, @@ -2336,6 +2380,8 @@ static const struct ethtool_ops e1000_ethtool_ops = { .set_eee = e1000e_set_eee, .get_link_ksettings = e1000_get_link_ksettings, .set_link_ksettings = e1000_set_link_ksettings, + .get_priv_flags = e1000e_get_priv_flags, + .set_priv_flags = e1000e_set_priv_flags, }; void e1000e_set_ethtool_ops(struct net_device *netdev) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index b9800ba2006c..e9b82c209c2d 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -6923,7 +6923,6 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev) struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev)); struct e1000_adapter *adapter = netdev_priv(netdev); struct pci_dev *pdev = to_pci_dev(dev); - struct e1000_hw *hw = &adapter->hw; int rc; e1000e_flush_lpic(pdev); @@ -6935,7 +6934,7 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev) e1000e_pm_thaw(dev); } else { /* Introduce S0ix implementation */ - if (hw->mac.type >= e1000_pch_cnp) + if (adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS) e1000e_s0ix_entry_flow(adapter); } @@ -6947,11 +6946,10 @@ static __maybe_unused int e1000e_pm_resume(struct device *dev) struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev)); struct e1000_adapter *adapter = netdev_priv(netdev); struct pci_dev *pdev = to_pci_dev(dev); - struct e1000_hw *hw = &adapter->hw; int rc; /* Introduce S0ix implementation */ - if (hw->mac.type >= e1000_pch_cnp) + if (adapter->flags2 & FLAG2_ENABLE_S0IX_FLOWS) e1000e_s0ix_exit_flow(adapter); rc = __e1000_resume(pdev); @@ -7615,6 +7613,9 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (!(adapter->flags & FLAG_HAS_AMT)) e1000e_get_hw_control(adapter); + if (hw->mac.type >= e1000_pch_cnp) + adapter->flags2 |= FLAG2_ENABLE_S0IX_FLOWS; + strlcpy(netdev->name, "eth%d", sizeof(netdev->name)); err = register_netdev(netdev); if (err)