f980bb080de0df17f37c8b187c406f4bab52bf39
[openwrt/openwrt.git] / target / linux / generic / pending-4.9 / 190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch
1 From patchwork Fri Jul 21 18:36:24 2017
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 Subject: [2/5] e1000e: Fix wrong comment related to link detection
6 From: Benjamin Poirier <bpoirier@suse.com>
7 X-Patchwork-Id: 9857489
8 Message-Id: <20170721183627.13373-2-bpoirier@suse.com>
9 To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 Cc: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>,
11 intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
12 linux-kernel@vger.kernel.org
13 Date: Fri, 21 Jul 2017 11:36:24 -0700
14
15 Reading e1000e_check_for_copper_link() shows that get_link_status is set to
16 false after link has been detected. Therefore, it stays TRUE until then.
17
18 Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
19 Tested-by: Aaron Brown <aaron.f.brown@intel.com>
20 ---
21 drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-)
23
24 --- a/drivers/net/ethernet/intel/e1000e/netdev.c
25 +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
26 @@ -5066,7 +5066,7 @@ static bool e1000e_has_link(struct e1000
27
28 /* get_link_status is set on LSC (link status) interrupt or
29 * Rx sequence error interrupt. get_link_status will stay
30 - * false until the check_for_link establishes link
31 + * true until the check_for_link establishes link
32 * for copper adapters ONLY
33 */
34 switch (hw->phy.media_type) {
35 @@ -5084,7 +5084,7 @@ static bool e1000e_has_link(struct e1000
36 break;
37 case e1000_media_type_internal_serdes:
38 ret_val = hw->mac.ops.check_for_link(hw);
39 - link_active = adapter->hw.mac.serdes_has_link;
40 + link_active = hw->mac.serdes_has_link;
41 break;
42 default:
43 case e1000_media_type_unknown: