linux-stable/drivers/net
Claudiu Manoil 0851133bb5 gianfar: Fix device reset races (oops) for Tx
The device reset procedure, stop_gfar()/startup_gfar(), has
concurrency issues.
"Kernel access of bad area" oopses show up during Tx timeout
device reset or other reset cases (like changing MTU) that
happen while the interface still has traffic. The oopses
happen in start_xmit and clean_tx_ring when accessing tx_queue->
tx_skbuff which is NULL. The race comes from de-allocating the
tx_skbuff while transmission and napi processing are still
active. Though the Tx queues get temoprarily stopped when Tx
timeout occurs, they get re-enabled as a result of Tx congestion
handling inside the napi context (see clean_tx_ring()). Not
disabling the napi during reset is also a bug, because
clean_tx_ring() will try to access tx_skbuff while it is being
de-alloc'ed and re-alloc'ed.

To fix this, stop_gfar() needs to disable napi processing
after stopping the Tx queues. However, in order to prevent
clean_tx_ring() to re-enable the Tx queue before the napi
gets disabled, the device state DOWN has been introduced.
It prevents the Tx congestion management from re-enabling the
de-congested Tx queue while the device is brought down.
An additional locking state, RESETTING, has been introduced
to prevent simultaneous resets or to prevent configuring the
device while it is resetting.
The bogus 'rxlock's (for each Rx queue) have been removed since
their purpose is not justified, as they don't prevent nor are
suited to prevent device reset/reconfig races (such as this one).

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-24 19:38:20 -05:00
..
appletalk
arcnet drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
bonding bonding: remove no longer needed lock for bond_xxx_info_query() 2014-02-24 18:28:23 -05:00
caif caif: delete unnecessary field initialization 2014-02-17 00:29:23 -05:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-02-19 01:24:22 -05:00
cris
dsa
ethernet gianfar: Fix device reset races (oops) for Tx 2014-02-24 19:38:20 -05:00
fddi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
hamradio Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-06 17:37:45 -05:00
hippi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
hyperv hyperv: Add latest NetVSP versions to auto negotiation 2014-02-19 19:52:45 -05:00
ieee802154 ieee802154: enable smart transmitter features of RF212 2014-02-17 16:42:39 -05:00
irda irtty-sir.c: Do not set_termios() on irtty_close() 2014-02-17 16:27:51 -05:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-02-19 01:24:22 -05:00
plip net: plip: slight optimization of addr compare 2013-12-31 16:48:33 -05:00
ppp ppp: slight optimization of addr compare 2013-12-26 13:31:33 -05:00
slip
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-02-19 01:24:22 -05:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-02-19 01:24:22 -05:00
vmxnet3 vmxnet3: Use pci_enable_msix_range() instead of pci_enable_msix() 2014-02-18 15:33:34 -05:00
wan wan: dlci: Remove unused netdev_priv pointer 2014-02-09 18:40:56 -08:00
wimax
wireless Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2014-02-20 15:02:02 -05:00
xen-netback xen-netback: Fix Rx stall due to race condition 2014-02-05 16:24:08 -08:00
dummy.c net: introduce netdev_alloc_pcpu_stats() for drivers 2014-02-14 15:49:55 -05:00
eql.c eql: use __dev_get_by_name instead of dev_get_by_name to find interface 2014-01-14 18:50:46 -08:00
ifb.c
Kconfig net: fix macvtap type name in Kconfig 2014-02-13 15:48:31 -05:00
LICENSE.SRC
loopback.c loopback: sctp: add NETIF_F_SCTP_CSUM to device features 2014-02-24 19:00:08 -05:00
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-02-19 01:24:22 -05:00
macvtap.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
Makefile
mdio.c mdio: unused ethtool functions 2013-12-26 13:29:35 -05:00
mii.c
netconsole.c
nlmon.c net: introduce netdev_alloc_pcpu_stats() for drivers 2014-02-14 15:49:55 -05:00
ntb_netdev.c
rionet.c
sb1000.c
Space.c drivers: net: Include new header file in sbni.c 2013-12-19 18:51:20 -05:00
sungem_phy.c
tun.c netdevice: add queue selection fallback handler for ndo_select_queue 2014-02-17 00:36:34 -05:00
veth.c rtnl: make ifla_policy static 2014-02-18 18:15:42 -05:00
virtio_net.c virtio-net: initial rx sysfs support, export mergeable rx buffer size 2014-01-16 23:46:07 -08:00
vxlan.c net: introduce netdev_alloc_pcpu_stats() for drivers 2014-02-14 15:49:55 -05:00
xen-netfront.c net: introduce netdev_alloc_pcpu_stats() for drivers 2014-02-14 15:49:55 -05:00