OpenCloudOS-Kernel/drivers/net/ethernet/intel/e1000e
Benjamin Poirier e2710dbf0d e1000e: Fix link check race condition
Alex reported the following race condition:

/* link goes up... interrupt... schedule watchdog */
\ e1000_watchdog_task
	\ e1000e_has_link
		\ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link
			\ e1000e_phy_has_link_generic(..., &link)
				link = true

					 /* link goes down... interrupt */
					 \ e1000_msix_other
						 hw->mac.get_link_status = true

			/* link is up */
			mac->get_link_status = false

		link_active = true
		/* link_active is true, wrongly, and stays so because
		 * get_link_status is false */

Avoid this problem by making sure that we don't set get_link_status = false
after having checked the link.

It seems this problem has been present since the introduction of e1000e.

Link: https://lkml.org/lkml/2018/1/29/338
Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-03-12 12:05:39 -07:00
..
80003es2lan.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
80003es2lan.h
82571.c e1000e: factor out systim sanitization 2016-08-16 10:46:19 -07:00
82571.h
Makefile
defines.h e1000e: Avoid missed interrupts following ICR read 2018-03-05 10:08:20 -08:00
e1000.h e1000e: apply burst mode settings only on default 2017-10-10 09:00:48 -07:00
ethtool.c e1000e: Don't return uninitialized stats 2017-06-06 01:05:13 -07:00
hw.h e1000e: Initial Support for IceLake 2017-08-08 17:54:21 -07:00
ich8lan.c e1000e: Fix link check race condition 2018-03-12 12:05:39 -07:00
ich8lan.h e1000e: fix the use of magic numbers for buffer overrun issue 2017-11-27 13:57:10 -08:00
mac.c e1000e: Fix link check race condition 2018-03-12 12:05:39 -07:00
mac.h
manage.c
manage.h
netdev.c Revert "e1000e: Separate signaling for link check/link up" 2018-03-12 11:34:05 -07:00
nvm.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
nvm.h
param.c e1000e: apply burst mode settings only on default 2017-10-10 09:00:48 -07:00
phy.c e1000e: Fix error path in link detection 2017-10-10 08:17:00 -07:00
phy.h e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
ptp.c e1000e: Add Support for CannonLake 2017-04-30 05:18:30 -07:00
regs.h