From patchwork Wed Nov 11 05:51:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yu X-Patchwork-Id: 1397947 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=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CWDLM4jWTz9sS8 for ; Wed, 11 Nov 2020 16:48:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4BB0986362; Wed, 11 Nov 2020 05:48:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id in0r6HAkozlJ; Wed, 11 Nov 2020 05:48:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2424F86388; Wed, 11 Nov 2020 05:48:41 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 997591BF863 for ; Wed, 11 Nov 2020 05:48:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 942DE8747F for ; Wed, 11 Nov 2020 05:48:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jmYxRijrOLjf for ; Wed, 11 Nov 2020 05:48:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by hemlock.osuosl.org (Postfix) with ESMTPS id 019568747A for ; Wed, 11 Nov 2020 05:48:38 +0000 (UTC) IronPort-SDR: Ftu+MS54Ihz78TZ36lbWwIAxec83xX/OqLiGavpPaltkRJO4EKkSBbhNlcRxPrBOypPZsgKtQ4 sq5ox2niSYIw== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="149947752" X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="149947752" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:48:37 -0800 IronPort-SDR: GQAn2AxdTbUNCmGj5XIbdbjeNUiJ+V1YnGDXRmBndF6GCSgxDLp4gIKWrZXO9h2G5Bw3LUXsoP FNlzG0sMSO0A== X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="308336271" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:48:34 -0800 From: Chen Yu To: intel-wired-lan@lists.osuosl.org Date: Wed, 11 Nov 2020 13:51:00 +0800 Message-Id: <7e68b2f6a9b0a6e03f6eeba8433bc532a3256830.1605073208.git.yu.c.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Subject: [Intel-wired-lan] [PATCH 1/4][RFC] e1000e: save the return value of e1000e_reset() 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: Len Brown , Chen Yu , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, "Brandt, Todd E" , Zhang Rui MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Sometimes e1000e_reset() might fail during reume from S3 due to hardware/firmware issues. Actually the return value from e1000e_reset() can be used by the caller to verify if the NIC succeed to initialize or not. Introduce a static function _e1000e_reset() which is derived from e1000e_reset(), except that the former returns the result of this reset. No functional change expected. Signed-off-by: Chen Yu --- drivers/net/ethernet/intel/e1000e/netdev.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index b30f00891c03..f7c08426c0d7 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -3998,7 +3998,7 @@ static void e1000e_systim_reset(struct e1000_adapter *adapter) * set/changed during runtime. After reset the device needs to be * properly configured for Rx, Tx etc. */ -void e1000e_reset(struct e1000_adapter *adapter) +static int _e1000e_reset(struct e1000_adapter *adapter) { struct e1000_mac_info *mac = &adapter->hw.mac; struct e1000_fc_info *fc = &adapter->hw.fc; @@ -4191,14 +4191,14 @@ void e1000e_reset(struct e1000_adapter *adapter) default: dev_err(&adapter->pdev->dev, "Invalid PHY type setting EEE advertisement\n"); - return; + return -EINVAL; } ret_val = hw->phy.ops.acquire(hw); if (ret_val) { dev_err(&adapter->pdev->dev, "EEE advertisement - unable to acquire PHY\n"); - return; + return -EBUSY; } e1000_write_emi_reg_locked(hw, adv_addr, @@ -4239,6 +4239,12 @@ void e1000e_reset(struct e1000_adapter *adapter) ew32(FEXTNVM9, reg); } + return 0; +} + +void e1000e_reset(struct e1000_adapter *adapter) +{ + _e1000e_reset(adapter); } /** From patchwork Wed Nov 11 05:51:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yu X-Patchwork-Id: 1397948 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=140.211.166.136; helo=silver.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CWDM33PBpz9sRK for ; Wed, 11 Nov 2020 16:49:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A24D2273B5; Wed, 11 Nov 2020 05:49:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UbedFJnSZ4ED; Wed, 11 Nov 2020 05:49:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8705F22FF0; Wed, 11 Nov 2020 05:49:12 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 7FCB61BF863 for ; Wed, 11 Nov 2020 05:49:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7B89286362 for ; Wed, 11 Nov 2020 05:49:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qne_WTiLZEol for ; Wed, 11 Nov 2020 05:49:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by fraxinus.osuosl.org (Postfix) with ESMTPS id AB918862FC for ; Wed, 11 Nov 2020 05:49:10 +0000 (UTC) IronPort-SDR: gcowrlJ7bW2X1zZfvp0kcRGPz8oR67sBWhGXdmlX+zpM1oL9kje85Gk808bp7xZYUyMifpguF/ nVZimjx8umww== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="157107017" X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="157107017" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:08 -0800 IronPort-SDR: OWzgtDSwc83Sx2x0TyK831KhNCjvBKLd8K/TSF5eg6lkvgJRfiFlD5SJWGjJ+XrmkWdCxdOF34 d1cJFueasE+g== X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="308336366" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:05 -0800 From: Chen Yu To: intel-wired-lan@lists.osuosl.org Date: Wed, 11 Nov 2020 13:51:33 +0800 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Subject: [Intel-wired-lan] [PATCH 2/4][RFC] PM: sleep: export device_pm_remove() for driver 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: Len Brown , Chen Yu , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, "Brandt, Todd E" , Zhang Rui MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Export device_pm_remove() and move the declaration of device_pm_remove() into generic power header file so that the drivers could use this interface to disable power management on that device. Signed-off-by: Chen Yu --- drivers/base/power/main.c | 1 + drivers/base/power/power.h | 8 -------- include/linux/pm.h | 12 ++++++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index c7ac49042cee..4693da9d7d80 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -164,6 +164,7 @@ void device_pm_remove(struct device *dev) pm_runtime_remove(dev); device_pm_check_callbacks(dev); } +EXPORT_SYMBOL_GPL(device_pm_remove); /** * device_pm_move_before - Move device in the PM core's list of active devices. diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index 54292cdd7808..8c2e45f3e5a9 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h @@ -20,7 +20,6 @@ static inline void pm_runtime_early_init(struct device *dev) extern void pm_runtime_init(struct device *dev); extern void pm_runtime_reinit(struct device *dev); -extern void pm_runtime_remove(struct device *dev); extern u64 pm_runtime_active_time(struct device *dev); #define WAKE_IRQ_DEDICATED_ALLOCATED BIT(0) @@ -85,7 +84,6 @@ static inline void pm_runtime_early_init(struct device *dev) static inline void pm_runtime_init(struct device *dev) {} static inline void pm_runtime_reinit(struct device *dev) {} -static inline void pm_runtime_remove(struct device *dev) {} static inline int dpm_sysfs_add(struct device *dev) { return 0; } static inline void dpm_sysfs_remove(struct device *dev) {} @@ -109,7 +107,6 @@ static inline struct device *to_device(struct list_head *entry) extern void device_pm_sleep_init(struct device *dev); extern void device_pm_add(struct device *); -extern void device_pm_remove(struct device *); extern void device_pm_move_before(struct device *, struct device *); extern void device_pm_move_after(struct device *, struct device *); extern void device_pm_move_last(struct device *); @@ -133,11 +130,6 @@ static inline void device_pm_sleep_init(struct device *dev) {} static inline void device_pm_add(struct device *dev) {} -static inline void device_pm_remove(struct device *dev) -{ - pm_runtime_remove(dev); -} - static inline void device_pm_move_before(struct device *deva, struct device *devb) {} static inline void device_pm_move_after(struct device *deva, diff --git a/include/linux/pm.h b/include/linux/pm.h index 47aca6bac1d6..f9ceca6ac7ff 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -701,6 +701,11 @@ struct dev_pm_domain { * be able to use wakeup events to exit from runtime low-power states, * or from system low-power states such as standby or suspend-to-RAM. */ +#ifdef CONFIG_PM +extern void pm_runtime_remove(struct device *dev); +#else +static inline void pm_runtime_remove(struct device *dev) {} +#endif #ifdef CONFIG_PM_SLEEP extern void device_pm_lock(void); @@ -753,6 +758,8 @@ extern void pm_generic_complete(struct device *dev); extern bool dev_pm_skip_resume(struct device *dev); extern bool dev_pm_skip_suspend(struct device *dev); +extern void device_pm_remove(struct device *dev); + #else /* !CONFIG_PM_SLEEP */ #define device_pm_lock() do {} while (0) @@ -774,6 +781,11 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void { } +static inline void device_pm_remove(struct device *dev) +{ + pm_runtime_remove(dev); +} + #define pm_generic_prepare NULL #define pm_generic_suspend_late NULL #define pm_generic_suspend_noirq NULL From patchwork Wed Nov 11 05:51:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yu X-Patchwork-Id: 1397949 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=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CWDMJ4qzpz9sRK for ; Wed, 11 Nov 2020 16:49:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E61968747A; Wed, 11 Nov 2020 05:49:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IaPvEE6xx++g; Wed, 11 Nov 2020 05:49:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5DDE08747F; Wed, 11 Nov 2020 05:49:30 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 057551BF863 for ; Wed, 11 Nov 2020 05:49:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 01D138747F for ; Wed, 11 Nov 2020 05:49:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wbvw28u6YL84 for ; Wed, 11 Nov 2020 05:49:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by hemlock.osuosl.org (Postfix) with ESMTPS id 458398747A for ; Wed, 11 Nov 2020 05:49:29 +0000 (UTC) IronPort-SDR: PaVgOOyIcl5MNVkQJw18fdFsLmYzcFevFUAX//eUss90gqqq2WrZGWA0luDSHqTCh/kKhC4uDF Iel2oxINF87Q== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="231723222" X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="231723222" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:23 -0800 IronPort-SDR: b5aaRZJ/SGcyw5exFfNK11WMFGIAkLM6s0Ja2PauYO8fy1JcvsvSLWerkWszD7xvEGqY25Uits N2PA8H9iN75w== X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="308336400" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:20 -0800 From: Chen Yu To: intel-wired-lan@lists.osuosl.org Date: Wed, 11 Nov 2020 13:51:49 +0800 Message-Id: <659e3a4977a7d9e1276d06882ea838d27d7c9ff1.1605073208.git.yu.c.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Subject: [Intel-wired-lan] [PATCH 3/4][RFC] e1000e: Introduce workqueue to disable the power management 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: Len Brown , Chen Yu , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, "Brandt, Todd E" , Zhang Rui MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Introduce a workqueue to disable the power management of this device. It is supposed to be triggered when e1000e hardware error is detected during resume from S3. Signed-off-by: Chen Yu --- drivers/net/ethernet/intel/e1000e/e1000.h | 1 + drivers/net/ethernet/intel/e1000e/netdev.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index ba7a0f8f6937..f50e5716d609 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h @@ -309,6 +309,7 @@ struct e1000_adapter { struct work_struct downshift_task; struct work_struct update_phy_task; struct work_struct print_hang_task; + struct work_struct pm_remove_task; int phy_hang_count; diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index f7c08426c0d7..45e0b1901440 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -6030,6 +6030,16 @@ static void e1000_reset_task(struct work_struct *work) e1000e_reinit_locked(adapter); } +static void e1000_pm_remove_task(struct work_struct *work) +{ + struct e1000_adapter *adapter; + struct device *dev; + + adapter = container_of(work, struct e1000_adapter, pm_remove_task); + dev = &adapter->pdev->dev; + device_pm_remove(dev); +} + /** * e1000_get_stats64 - Get System Network Statistics * @netdev: network interface device structure @@ -7589,6 +7599,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); + INIT_WORK(&adapter->pm_remove_task, e1000_pm_remove_task); /* Initialize link parameters. User can change them with ethtool */ adapter->hw.mac.autoneg = 1; @@ -7731,6 +7742,7 @@ static void e1000_remove(struct pci_dev *pdev) cancel_work_sync(&adapter->downshift_task); cancel_work_sync(&adapter->update_phy_task); cancel_work_sync(&adapter->print_hang_task); + cancel_work_sync(&adapter->pm_remove_task); if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) { cancel_work_sync(&adapter->tx_hwtstamp_work); From patchwork Wed Nov 11 05:52:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yu X-Patchwork-Id: 1397950 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=140.211.166.136; helo=silver.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CWDMb49k2z9sRR for ; Wed, 11 Nov 2020 16:49:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 26BDD275A5; Wed, 11 Nov 2020 05:49:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12Se4QiQx38g; Wed, 11 Nov 2020 05:49:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 05C7122FF0; Wed, 11 Nov 2020 05:49:45 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0D1C61BF863 for ; Wed, 11 Nov 2020 05:49:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 08DDD85C77 for ; Wed, 11 Nov 2020 05:49:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id obw3Lr6Hw5ou for ; Wed, 11 Nov 2020 05:49:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6E35285B58 for ; Wed, 11 Nov 2020 05:49:42 +0000 (UTC) IronPort-SDR: dN7ATapWpYivd7u8dgIddbMFJvr2X8C+5Nj5YIH88Cpz4VqQmmfKKqKxFohFZRoVlp6pJLU5fX 1evMfOFrYuNA== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="167514763" X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="167514763" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:42 -0800 IronPort-SDR: EFXgvL/vAHXVTKliiw1HruU9JpJ8S27UtCWTJV+oO6JxtDhNUxMZD+lgUSNc3L01R8rUrqUtvT dyKj0eSi6S+A== X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="308336506" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:39 -0800 From: Chen Yu To: intel-wired-lan@lists.osuosl.org Date: Wed, 11 Nov 2020 13:52:07 +0800 Message-Id: <7eb46aa2f49f6c7a2ff0d6cc65ad4195781ae960.1605073208.git.yu.c.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Subject: [Intel-wired-lan] [PATCH 4/4][RFC] e1000e: Disable the power management if hardware error detected during resume 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: Len Brown , Chen Yu , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, "Brandt, Todd E" , Zhang Rui MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" If the hardware error is detected during resume, the NIC might be in a unstable status and blocks the subsequent suspend afterwards. A broken device is not expected to impact the system wide suspend, and this patch disable the power management support of this NIC. So that the borken NIC will not be considered during suspend/resume, thus not to prevent the system from suspend/resume. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205015 Reported-by: "Brandt, Todd E" Reported-by: Len Brown Signed-off-by: Chen Yu --- drivers/net/ethernet/intel/e1000e/netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 45e0b1901440..08bc544e879a 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -6959,7 +6959,8 @@ static int __e1000_resume(struct pci_dev *pdev) ew32(WUS, ~0); } - e1000e_reset(adapter); + if (_e1000e_reset(adapter)) + schedule_work(&adapter->pm_remove_task); e1000_init_manageability_pt(adapter);