Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp107737pxb; Tue, 10 Nov 2020 21:50:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvtKjtlYnV+meCOLXYuhrQH+aH/Rhr3cn8prbhHFv2A0kg/1G2p1kI5ivrzOziirYqFBpo X-Received: by 2002:a17:906:3644:: with SMTP id r4mr23252266ejb.517.1605073823651; Tue, 10 Nov 2020 21:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605073823; cv=none; d=google.com; s=arc-20160816; b=NYsxnM6l+jkx8OLIvKdeDxf9OE3KI/OwVophOQdfAy65IBVStp275XH4Fx62g5sgZE BRSS6MnGP3Yhf1mdPUaU0vfg5SbO9I9w6S7PsPdIMn/BDXKm5f2FuJDHzyknq9g8ATiY 758eKrWL2UD8FDiPdaNKm2pY3tXvAOllJfIk/Q/0pjPMqhkWfXxyxSmsbwBj+yzZVvUV IKKCG15Q6wbgif1zxEVsg4Gf8GnBP4xN/8nN4X7LlsDOuszvaRdgy82MzWjco8Bmju9e r0OHUdzKGZvR2zdhqpvzHHibUBGAEE5Ch3x8vPw+Zg0owikBQdlnGQNo6qyhdd1M6z9g HscQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=Xho+oQgjRuvG38jvTAa0Sw+qKYEtt+GvSKCT6txAaFY=; b=AbG2GePC+A1iSithW9yRImH9SqFdysAglAPpF5QGttwfFlsKpcE1zSrgz3systztwa OTGiWau9ak9Qj8q56mgJDxGXH6DnJ05XNF3PfXW0nZiDQ35tn/y9vKSpbrJeREuxYsSq Uqujab488cs6GkHogReVqqEV+XwCe+TfZtKpsjMFJ3eUT+uIlKD/fNuXbODJFhEhMtfy TOzi77syZ/20ULb9MQAYW6uqw5QrqtyddVwDLU5lxn7ZxrP9XRivFdb2r82YkEKq+F4C /dUxcNTgxouUV40r+Mq2WisUxq+vYp7R3EJYRxejrw11g56jXxZ0RWmp+gAl8g8ut4dZ xatQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u24si591352ejg.738.2020.11.10.21.50.00; Tue, 10 Nov 2020 21:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725945AbgKKFsk (ORCPT + 99 others); Wed, 11 Nov 2020 00:48:40 -0500 Received: from mga04.intel.com ([192.55.52.120]:33742 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbgKKFsj (ORCPT ); Wed, 11 Nov 2020 00:48:39 -0500 IronPort-SDR: 6q+AaG+BqArPIXNpYq1LzMHghdA3cuVWdFUM5RjPvsz2WjRvKjJYLG5QKH1MKLvQY8J8iel6Sg LCSFSkS9gi3g== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="167514658" X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="167514658" 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: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 Cc: "Neftin, Sasha" , Len Brown , "Rafael J. Wysocki" , "Brandt, Todd E" , Zhang Rui , Tony Nguyen , Jesse Brandeburg , linux-kernel@vger.kernel.org, Chen Yu Subject: [PATCH 1/4][RFC] e1000e: save the return value of e1000e_reset() 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } /** -- 2.17.1