From: Chen Yu <yu.c.chen@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: "Neftin, Sasha" <sasha.neftin@intel.com>,
Len Brown <len.brown@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"Brandt, Todd E" <todd.e.brandt@intel.com>,
Zhang Rui <rui.zhang@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
linux-kernel@vger.kernel.org, Chen Yu <yu.c.chen@intel.com>
Subject: [PATCH 1/4][RFC] e1000e: save the return value of e1000e_reset()
Date: Wed, 11 Nov 2020 13:51:00 +0800 [thread overview]
Message-ID: <7e68b2f6a9b0a6e03f6eeba8433bc532a3256830.1605073208.git.yu.c.chen@intel.com> (raw)
In-Reply-To: <cover.1605073208.git.yu.c.chen@intel.com>
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 <yu.c.chen@intel.com>
---
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
next prev parent reply other threads:[~2020-11-11 5:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-11 5:50 [PATCH 0/4][RFC] Disable e1000e power management if hardware error is detected Chen Yu
2020-11-11 5:51 ` Chen Yu [this message]
2020-11-11 5:51 ` [PATCH 2/4][RFC] PM: sleep: export device_pm_remove() for driver use Chen Yu
2020-11-11 5:51 ` [PATCH 3/4][RFC] e1000e: Introduce workqueue to disable the power management Chen Yu
2020-11-11 5:52 ` [PATCH 4/4][RFC] e1000e: Disable the power management if hardware error detected during resume Chen Yu
2024-07-14 19:36 ` [PATCH 0/4][RFC] Disable e1000e power management if hardware error is detected Oleksandr Natalenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e68b2f6a9b0a6e03f6eeba8433bc532a3256830.1605073208.git.yu.c.chen@intel.com \
--to=yu.c.chen@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=sasha.neftin@intel.com \
--cc=todd.e.brandt@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®