From patchwork Mon Jul 12 13:34:57 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: 1504019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: 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=XAUDQllq; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GNlM92r3Cz9sWX for ; Mon, 12 Jul 2021 23:42:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9F62C605A0; Mon, 12 Jul 2021 13:42:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kJvdW3bhe-23; Mon, 12 Jul 2021 13:42:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 72594605E8; Mon, 12 Jul 2021 13:42:41 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2B2731BF36D for ; Mon, 12 Jul 2021 13:42:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 261044047B for ; Mon, 12 Jul 2021 13:42:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=canonical.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wo5dkzk_uclx for ; Mon, 12 Jul 2021 13:42:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2A92240413 for ; Mon, 12 Jul 2021 13:42:32 +0000 (UTC) Received: from localhost (1.general.khfeng.us.vpn [10.172.68.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id F408D40325; Mon, 12 Jul 2021 13:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1626096906; bh=wPRu7NWwQMf97Gb7KzQ3v7mTH8FGJGWMqE4KG+HRscU=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=XAUDQllqtT1gHhlA5AA5BuokS6u5KXIfbqPUePiJ1t1LkPdfuGXAUBcc9EvuLSHUw ln05CWNoQJurvJLtXz0vU/JcJiZR7S1is/a56bqfj8+HNvYoB+EKvAq507lAUofU5c AqXuvMeS53Rek83L3KL5z+zjqQAVslQTSM8K/6IET2awfb7Z6tfcbtVWTOd/1+r7ot EgcgvuMwlu1gX45QP1upLVV7oPaj7D4yGAuvoR3Q5gpuDUDm11r3hLvlSaavnF0J4b kVYPJmESb3kz34S0OEctMJkf7tK1ORnKTNvMx5ChjjpF8NPa+zqltwSoA/Th6TfSIG XVcK2etrEsVWg== From: Kai-Heng Feng To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com Date: Mon, 12 Jul 2021 21:34:57 +0800 Message-Id: <20210712133500.1126371-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH 1/3] e1000e: Separate TGP from SPT X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:NETWORKING DRIVERS" , open list , Kai-Heng Feng , acelan.kao@canonical.com, Jakub Kicinski , "moderated list:INTEL ETHERNET DRIVERS" , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Separate TGP from SPT so we can apply specific quirks to TGP. Signed-off-by: Kai-Heng Feng --- drivers/net/ethernet/intel/e1000e/e1000.h | 4 +++- drivers/net/ethernet/intel/e1000e/ich8lan.c | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/e1000e/netdev.c | 13 +++++++------ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index 5b2143f4b1f8..3178efd98006 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h @@ -113,7 +113,8 @@ enum e1000_boards { board_pch2lan, board_pch_lpt, board_pch_spt, - board_pch_cnp + board_pch_cnp, + board_pch_tgp }; struct e1000_ps_page { @@ -499,6 +500,7 @@ extern const struct e1000_info e1000_pch2_info; extern const struct e1000_info e1000_pch_lpt_info; extern const struct e1000_info e1000_pch_spt_info; extern const struct e1000_info e1000_pch_cnp_info; +extern const struct e1000_info e1000_pch_tgp_info; extern const struct e1000_info e1000_es2_info; void e1000e_ptp_init(struct e1000_adapter *adapter); diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index cf7b3887da1d..654dbe798e55 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -5967,3 +5967,23 @@ const struct e1000_info e1000_pch_cnp_info = { .phy_ops = &ich8_phy_ops, .nvm_ops = &spt_nvm_ops, }; + +const struct e1000_info e1000_pch_tgp_info = { + .mac = e1000_pch_tgp, + .flags = FLAG_IS_ICH + | FLAG_HAS_WOL + | FLAG_HAS_HW_TIMESTAMP + | FLAG_HAS_CTRLEXT_ON_LOAD + | FLAG_HAS_AMT + | FLAG_HAS_FLASH + | FLAG_HAS_JUMBO_FRAMES + | FLAG_APME_IN_WUC, + .flags2 = FLAG2_HAS_PHY_STATS + | FLAG2_HAS_EEE, + .pba = 26, + .max_hw_frame_size = 9022, + .get_variants = e1000_get_variants_ich8lan, + .mac_ops = &ich8_mac_ops, + .phy_ops = &ich8_phy_ops, + .nvm_ops = &spt_nvm_ops, +}; diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index d150dade06cf..5835d6cf2f51 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -51,6 +51,7 @@ static const struct e1000_info *e1000_info_tbl[] = { [board_pch_lpt] = &e1000_pch_lpt_info, [board_pch_spt] = &e1000_pch_spt_info, [board_pch_cnp] = &e1000_pch_cnp_info, + [board_pch_tgp] = &e1000_pch_tgp_info, }; struct e1000_reg_info { @@ -7843,12 +7844,12 @@ static const struct pci_device_id e1000_pci_tbl[] = { { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V11), board_pch_cnp }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM12), board_pch_spt }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V12), board_pch_spt }, - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM13), board_pch_cnp }, - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V13), board_pch_cnp }, - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM14), board_pch_cnp }, - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V14), board_pch_cnp }, - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM15), board_pch_cnp }, - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V15), board_pch_cnp }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM13), board_pch_tgp }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V13), board_pch_tgp }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM14), board_pch_tgp }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V14), board_pch_tgp }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM15), board_pch_tgp }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V15), board_pch_tgp }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM16), board_pch_cnp }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16), board_pch_cnp }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17), board_pch_cnp }, From patchwork Mon Jul 12 13:34:58 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: 1504017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: 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=Tvc/UmPq; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GNlM16sGKz9sWX for ; Mon, 12 Jul 2021 23:42:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 47F80404E8; Mon, 12 Jul 2021 13:42:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gFJ16HcJpkcO; Mon, 12 Jul 2021 13:42:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 2126D4047B; Mon, 12 Jul 2021 13:42:34 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id CF3BE1BF36D for ; Mon, 12 Jul 2021 13:42:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BD38E6059F for ; Mon, 12 Jul 2021 13:42:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=canonical.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ub6Q5GSJI1ND for ; Mon, 12 Jul 2021 13:42:31 +0000 (UTC) X-Greylist: delayed 00:07:22 by SQLgrey-1.8.0 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by smtp3.osuosl.org (Postfix) with ESMTPS id BAE9D60594 for ; Mon, 12 Jul 2021 13:42:31 +0000 (UTC) Received: from localhost (1.general.khfeng.us.vpn [10.172.68.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 0411140614; Mon, 12 Jul 2021 13:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1626096911; bh=49WXuAcOzcp5cSXPqRiLBbw9uyRJ6eCwLsokni9lmRk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Tvc/UmPqt5CWG5jFhrvJSV+6zZ/Luh7HCdUbfSp5TZWLROM32Eg7YQ3AyKdRq8M2l wemflU+UdYRmGgC2LsvbpJvc/HYLa1ZBRXDzAiKlD9X9UjiH/eZHVfMot7mbY4phYC g/4bk4LN4UqLlKoJL+BuBdpMmtM1FQXNjrqSduQZYPhpYZ0qv7ZHY0/0zmqsCaDK32 giXqcQboy2E4kzxJE04ryOF9o6ErjluwhFP10NL97ridQFGmkj6dS2pt8yWuyx6CM5 ucS4Xvqqzr4KKL3fnEdut4ZbCZLFXkaMmcnU/4DJtxCRDeBceQmGXZXgo4deRetsNc 8bWB4l21fqxew== From: Kai-Heng Feng To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com Date: Mon, 12 Jul 2021 21:34:58 +0800 Message-Id: <20210712133500.1126371-2-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712133500.1126371-1-kai.heng.feng@canonical.com> References: <20210712133500.1126371-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH 2/3] e1000e: Make mei_me active when e1000e is in use X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:NETWORKING DRIVERS" , open list , Kai-Heng Feng , acelan.kao@canonical.com, Jakub Kicinski , "moderated list:INTEL ETHERNET DRIVERS" , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Many users report rather sluggish RX speed on TGP I219. Since "intel_idle.max_cstate=1" doesn't help, so it's not caused by deeper package C-state. A workaround that always works is to make sure mei_me is runtime active when e1000e is in use. The root cause is still unknown, but since many users are affected by the issue, implment the quirk in the driver as a temporary workaround. Also adds mei_me as soft dependency to ensure the device link can be created if e1000e is in initramfs. BugLink: https://bugs.launchpad.net/bugs/1927925 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213377 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=213651 Signed-off-by: Kai-Heng Feng --- drivers/net/ethernet/intel/e1000e/netdev.c | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 5835d6cf2f51..e63445a8ce12 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -7317,6 +7317,27 @@ static const struct net_device_ops e1000e_netdev_ops = { .ndo_features_check = passthru_features_check, }; +static void e1000e_create_device_links(struct pci_dev *pdev) +{ + struct pci_dev *tgp_mei_me; + + /* Find TGP mei_me devices and make e1000e power depend on mei_me */ + tgp_mei_me = pci_get_device(PCI_VENDOR_ID_INTEL, 0xa0e0, NULL); + if (!tgp_mei_me) { + tgp_mei_me = pci_get_device(PCI_VENDOR_ID_INTEL, 0x43e0, NULL); + if (!tgp_mei_me) + return; + } + + if (device_link_add(&pdev->dev, &tgp_mei_me->dev, + DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE | + DL_FLAG_AUTOREMOVE_CONSUMER)) + pci_info(pdev, "System and runtime PM depends on %s\n", + pci_name(tgp_mei_me)); + + pci_dev_put(tgp_mei_me); +} + /** * e1000_probe - Device Initialization Routine * @pdev: PCI device information struct @@ -7645,6 +7666,9 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_dev_run_wake(pdev) && hw->mac.type != e1000_pch_cnp) pm_runtime_put_noidle(&pdev->dev); + if (hw->mac.type == e1000_pch_tgp) + e1000e_create_device_links(pdev); + return 0; err_register: @@ -7917,6 +7941,8 @@ static void __exit e1000_exit_module(void) } module_exit(e1000_exit_module); +/* Ensure device link can be created if e1000e is in the initramfs. */ +MODULE_SOFTDEP("pre: mei_me"); MODULE_AUTHOR("Intel Corporation, "); MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver"); MODULE_LICENSE("GPL v2"); From patchwork Mon Jul 12 13:34:59 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: 1504018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: 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=WfL2fbky; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GNlM52r8Pz9sWX for ; Mon, 12 Jul 2021 23:42:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D051E60594; Mon, 12 Jul 2021 13:42:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hU2k9OVnLho3; Mon, 12 Jul 2021 13:42:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id C6C826059F; Mon, 12 Jul 2021 13:42:37 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id DB8601BF97A for ; Mon, 12 Jul 2021 13:42:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D50A1823A0 for ; Mon, 12 Jul 2021 13:42:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=canonical.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id av9E9iegS9iP for ; Mon, 12 Jul 2021 13:42:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by smtp1.osuosl.org (Postfix) with ESMTPS id F3159825BF for ; Mon, 12 Jul 2021 13:42:31 +0000 (UTC) Received: from localhost (1.general.khfeng.us.vpn [10.172.68.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 537044061A; Mon, 12 Jul 2021 13:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1626096917; bh=LGxqAkOoOm8w+lN//0OhPBiSVWFP77FniFSghw2+jBI=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=WfL2fbkya76HeKTJFQj5gPuZN/mcJPgwf6A8Gi6FcwKhiP6snnQcuSs5NVfQGn4JD DWUaFe53uuwHYTsaDZsUI+ttrmNFtqTO5PNWx7tM3bh2P/VJdaGG8feKh05cO5dQT4 YZXGHD9ItRJRRzsngbZOhdJfFQF3vlgmB6VOqpfh0ZttxBUaXW6o0JPfBWeRGczP3M v4TgPMO+OsUfs8CHiar8j3KXcH+D0w90GsFzVrIdBW8GirCjzxBV2IP6zJ2CMywJwl O2/7JFTrijYirOw4yDzkdqD6yMiAS8IXBQGMulCkB0UBSY/vDFNv9qrBXzr3FxXQQj YHJF8qAgijL4Q== From: Kai-Heng Feng To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com Date: Mon, 12 Jul 2021 21:34:59 +0800 Message-Id: <20210712133500.1126371-3-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712133500.1126371-1-kai.heng.feng@canonical.com> References: <20210712133500.1126371-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH 3/3] e1000e: Serialize TGP e1000e PM ops X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:NETWORKING DRIVERS" , open list , Kai-Heng Feng , acelan.kao@canonical.com, Jakub Kicinski , "moderated list:INTEL ETHERNET DRIVERS" , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On TGL systems, PCI_COMMAND may randomly flip to 0 on system resume. This is devastating to drivers that use pci_set_master(), like NVMe and xHCI, to enable DMA in their resume routine, as pci_set_master() can inadvertently disable PCI_COMMAND_IO and PCI_COMMAND_MEMORY, making resources inaccessible. The issue is reproducible on all kernel releases, but the situation is exacerbated by commit 6cecf02e77ab ("Revert "e1000e: disable s0ix entry and exit flows for ME systems""). Seems like ME can do many things to other PCI devices until it's finally out of ULP polling. So ensure e1000e PM ops are serialized by enforcing suspend/resume order to workaround the issue. Of course this will make system suspend and resume a bit slower, but we probably need to settle on this workaround until ME is fully supported. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212039 Signed-off-by: Kai-Heng Feng --- drivers/net/ethernet/intel/e1000e/netdev.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index e63445a8ce12..0244d3dd90a3 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -7319,7 +7319,8 @@ static const struct net_device_ops e1000e_netdev_ops = { static void e1000e_create_device_links(struct pci_dev *pdev) { - struct pci_dev *tgp_mei_me; + struct pci_bus *bus = pdev->bus; + struct pci_dev *tgp_mei_me, *p; /* Find TGP mei_me devices and make e1000e power depend on mei_me */ tgp_mei_me = pci_get_device(PCI_VENDOR_ID_INTEL, 0xa0e0, NULL); @@ -7335,6 +7336,17 @@ static void e1000e_create_device_links(struct pci_dev *pdev) pci_info(pdev, "System and runtime PM depends on %s\n", pci_name(tgp_mei_me)); + /* Find other devices in the SoC and make them depend on e1000e */ + list_for_each_entry(p, &bus->devices, bus_list) { + if (&p->dev == &pdev->dev || &p->dev == &tgp_mei_me->dev) + continue; + + if (device_link_add(&p->dev, &pdev->dev, + DL_FLAG_AUTOREMOVE_SUPPLIER)) + pci_info(p, "System PM depends on %s\n", + pci_name(pdev)); + } + pci_dev_put(tgp_mei_me); }