linux/drivers/net/ethernet
Bruce Allan a90b412cb8 e1000e: locking bug introduced by commit 67fd4fcb
Commit 67fd4fcb (e1000e: convert to stats64) added the ability to update
statistics more accurately and on-demand through the net_device_ops
.ndo_get_stats64 hook, but introduced a locking bug on 82577/8/9 when
linked at half-duplex (seen on kernels with CONFIG_DEBUG_ATOMIC_SLEEP=y and
CONFIG_PROVE_LOCKING=y).  The commit introduced code paths that caused a
mutex to be locked in atomic contexts, e.g. an rcu_read_lock is held when
irqbalance reads the stats from /sys/class/net/ethX/statistics causing the
mutex to be locked to read the Phy half-duplex statistics registers.

The mutex was originally introduced to prevent concurrent accesses of
resources (the NVM and Phy) shared by the driver, firmware and hardware
a few years back when there was an issue with the NVM getting corrupted.
It was later split into two mutexes - one for the NVM and one for the Phy
when it was determined the NVM, unlike the Phy, should not be protected by
the software/firmware/hardware semaphore (arbitration of which is done in
part with the SWFLAG bit in the EXTCNF_CTRL register).  This latter
semaphore should be sufficient to prevent resource contention of the Phy in
the driver (i.e. the mutex for Phy accesses is not needed), but to be sure
the mutex is replaced with an atomic bit flag which will warn if any
contention is possible.

Also add additional debug output to help determine when the sw/fw/hw
semaphore is owned by the firmware or hardware.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Reported-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
2011-10-16 07:13:17 -07:00
..
3com net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
8390
adaptec
adi
aeroflex
alteon
amd
apple
atheros net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
broadcom bnx2: fix skb truesize underestimation 2011-10-13 16:05:07 -04:00
brocade net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
cadence
chelsio net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
cirrus
cisco
davicom
dec
dlink
emulex be2net: fix truesize errors 2011-10-13 16:05:07 -04:00
faraday ftmac100: fix skb truesize underestimation 2011-10-13 22:28:29 -04:00
freescale
fujitsu
hp
i825xx
ibm emac: convert to SKB paged frag API. 2011-10-10 15:19:13 -04:00
icplus
intel e1000e: locking bug introduced by commit 67fd4fcb 2011-10-16 07:13:17 -07:00
marvell sky2: fix skb truesize underestimation 2011-10-13 17:12:46 -04:00
mellanox mlx4_en: Adding 40gb speed report for ethtool 2011-10-09 23:42:58 -04:00
micrel
microchip
myricom
natsemi
neterion net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
nuvoton
nvidia net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
octeon
oki-semi net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
packetengines
pasemi
qlogic net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
racal
rdc r6040: bump version to 0.28 and date to 07Oct2011. 2011-10-09 23:50:59 -04:00
realtek Add ethtool -g support to 8139cp 2011-10-07 16:22:44 -04:00
renesas
seeq
sfc net: Remove unnecessary driver assignments of ethtool_ringparam fields to zero 2011-10-07 19:13:28 -04:00
sgi
sis
smsc
stmicro
sun niu: fix skb truesize underestimation 2011-10-13 22:25:21 -04:00
tehuti
ti
tile
toshiba
tundra
via
xilinx ll_temac: convert to SKB paged frag API. 2011-10-10 15:19:13 -04:00
xircom
xscale
dnet.c
dnet.h
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig
korina.c
lantiq_etop.c
Makefile
mipsnet.c
netx-eth.c
s6gmac.c