linux-stable/drivers/net/ethernet
Russell King 3aefe2b4a8 NET: mv643xx_eth: avoid lockdep dump on interface down
When the interface is shutdown, the mv643xx_eth driver hits the following
lockdep dump:

=================================
[ INFO: inconsistent lock state ]
3.8.0+ #303 Not tainted
---------------------------------
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
NetworkManager/3449 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (_xmit_ETHER#2){+.?...}, at: [<c02828e4>] txq_reclaim+0x60/0x230
{IN-SOFTIRQ-W} state was registered at:
  [<c007e93c>] mark_irqflags+0xf8/0x1c4
  [<c007ee60>] __lock_acquire+0x458/0x9a4
  [<c007f8b0>] lock_acquire+0x60/0x74
  [<c03ea914>] _raw_spin_lock+0x40/0x50
  [<c0334040>] sch_direct_xmit+0xa4/0x2e4
  [<c0320880>] dev_queue_xmit+0x174/0x508
  [<c03953b0>] ip6_finish_output2+0xd0/0x3c4
  [<c03b15bc>] mld_sendpack+0x190/0x368
  [<c03b3204>] mld_ifc_timer_expire+0xc/0x58
  [<c005133c>] call_timer_fn+0x6c/0xe0
  [<c0051588>] run_timer_softirq+0x1d8/0x210
  [<c004c004>] __do_softirq+0xe0/0x1b4
  [<c004c448>] irq_exit+0x64/0x6c
  [<c000f1e0>] handle_IRQ+0x34/0x84
  [<c000e0d0>] __irq_usr+0x30/0x80
irq event stamp: 160603
hardirqs last  enabled at (160603): [<c00c736c>] kfree+0xa8/0xe8
hardirqs last disabled at (160602): [<c00c72e0>] kfree+0x1c/0xe8
softirqs last  enabled at (160304): [<c028260c>] mib_counters_update+0x5ec/0x60c
softirqs last disabled at (160302): [<c03eab8c>] _raw_spin_lock_bh+0x14/0x54

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(_xmit_ETHER#2);
  <Interrupt>
    lock(_xmit_ETHER#2);

 *** DEADLOCK ***

1 lock held by NetworkManager/3449:
 #0:  (rtnl_mutex){+.+.+.}, at: [<c032e664>] rtnetlink_rcv+0xc/0x24

stack backtrace:
[<c0013e34>] (unwind_backtrace+0x0/0xf8) from [<c007e12c>] (print_usage_bug+0x150/0x1d4)
[<c007e12c>] (print_usage_bug+0x150/0x1d4) from [<c007e3f8>] (mark_lock_irq+0x248/0x290)
[<c007e3f8>] (mark_lock_irq+0x248/0x290) from [<c007e598>] (mark_lock+0x158/0x404)
[<c007e598>] (mark_lock+0x158/0x404) from [<c007e97c>] (mark_irqflags+0x138/0x1c4)
[<c007e97c>] (mark_irqflags+0x138/0x1c4) from [<c007ee60>] (__lock_acquire+0x458/0x9a4)
[<c007ee60>] (__lock_acquire+0x458/0x9a4) from [<c007f8b0>] (lock_acquire+0x60/0x74)
[<c007f8b0>] (lock_acquire+0x60/0x74) from [<c03ea914>] (_raw_spin_lock+0x40/0x50)
[<c03ea914>] (_raw_spin_lock+0x40/0x50) from [<c02828e4>] (txq_reclaim+0x60/0x230)
[<c02828e4>] (txq_reclaim+0x60/0x230) from [<c0282ad8>] (txq_deinit+0x24/0xcc)
[<c0282ad8>] (txq_deinit+0x24/0xcc) from [<c0282d28>] (mv643xx_eth_stop+0x1a8/0x1bc)
[<c0282d28>] (mv643xx_eth_stop+0x1a8/0x1bc) from [<c031e314>] (__dev_close_many+0x88/0xcc)
[<c031e314>] (__dev_close_many+0x88/0xcc) from [<c031e380>] (__dev_close+0x28/0x3c)
[<c031e380>] (__dev_close+0x28/0x3c) from [<c0320fa0>] (__dev_change_flags+0x7c/0x134)
[<c0320fa0>] (__dev_change_flags+0x7c/0x134) from [<c03210e0>] (dev_change_flags+0x10/0x48)
[<c03210e0>] (dev_change_flags+0x10/0x48) from [<c032da1c>] (do_setlink+0x1a0/0x730)
[<c032da1c>] (do_setlink+0x1a0/0x730) from [<c032f524>] (rtnl_newlink+0x304/0x4b0)
[<c032f524>] (rtnl_newlink+0x304/0x4b0) from [<c032ef8c>] (rtnetlink_rcv_msg+0x25c/0x2a0)
[<c032ef8c>] (rtnetlink_rcv_msg+0x25c/0x2a0) from [<c03383a0>] (netlink_rcv_skb+0xbc/0xd8)
[<c03383a0>] (netlink_rcv_skb+0xbc/0xd8) from [<c032e674>] (rtnetlink_rcv+0x1c/0x24)
[<c032e674>] (rtnetlink_rcv+0x1c/0x24) from [<c03361d8>] (netlink_unicast_kernel+0x88/0xd4)
[<c03361d8>] (netlink_unicast_kernel+0x88/0xd4) from [<c0337dd0>] (netlink_unicast+0x138/0x180)
[<c0337dd0>] (netlink_unicast+0x138/0x180) from [<c0338020>] (netlink_sendmsg+0x208/0x32c)
[<c0338020>] (netlink_sendmsg+0x208/0x32c) from [<c030ab48>] (sock_sendmsg+0x84/0xa4)
[<c030ab48>] (sock_sendmsg+0x84/0xa4) from [<c030aef4>] (__sys_sendmsg+0x2ac/0x2c4)
[<c030aef4>] (__sys_sendmsg+0x2ac/0x2c4) from [<c030c8ec>] (sys_sendmsg+0x3c/0x68)
[<c030c8ec>] (sys_sendmsg+0x3c/0x68) from [<c000e2e0>] (ret_fast_syscall+0x0/0x3c)

It seems that txq_reclaim() takes the netif tx lock:

        __netif_tx_lock(nq, smp_processor_id());

in a context outside of softirq context, and thus is susceptible to
deadlock should an interrupt occur.

Use __netif_tx_lock_bh()/__netif_tx_unlock_bh() instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-16 14:56:21 -07:00
..
3com 3c59x: fix PCI resource management 2013-05-11 17:40:14 -07:00
8390 Char / Misc driver update for 3.10-rc1 2013-04-29 11:18:34 -07:00
adaptec net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
adi bfin_mac: fix error return code in bfin_mac_probe() 2013-05-08 13:13:30 -07:00
aeroflex drivers:net: dma_alloc_coherent: use __GFP_ZERO instead of memset(, 0) 2013-03-17 12:50:24 -04:00
alteon net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
apple drivers:net: Remove dma_alloc_coherent OOM messages 2013-03-15 08:56:58 -04:00
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
broadcom tg3: Fix data corruption on 5725 with TSO 2013-05-14 11:32:04 -07:00
brocade bna: add missing iounmap() on error in bnad_init() 2013-05-13 12:54:38 -07:00
cadence net/macb: fix ISR clear-on-write behavior only for some SoC 2013-05-14 13:04:02 -07:00
calxeda net/ethernet: NET_CALXEDA_XGMAC should depend on HAS_DMA 2013-05-11 16:28:23 -07:00
chelsio cxgb4: fix error recovery when t4_fw_hello returns a positive value 2013-05-03 16:10:34 -04:00
cirrus cirrus: cs89x0: remove two obsolete Kconfig macros 2013-03-29 15:40:24 -04:00
cisco net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
davicom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-04-01 13:36:50 -04:00
dec Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-03-20 12:46:26 -04:00
dlink drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb 2013-03-09 16:09:19 -05:00
emulex be2net: Avoid double insertion of vlan tags. 2013-05-14 11:32:04 -07:00
faraday net: ftgmac100: Use module_platform_driver() 2013-03-18 13:02:37 -04:00
freescale fec: Invert the order of function calls in fec_restart() 2013-05-15 14:42:15 -07:00
fujitsu Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
hp
i825xx drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb 2013-03-09 16:09:19 -05:00
ibm emac: Fix EMAC soft reset on 460EX/GT 2013-05-11 17:40:14 -07:00
icplus ipg: fix an unsigned widening cast of '~' truncation issue 2013-05-15 14:42:14 -07:00
intel e1000e: fix scheduling while atomic bug 2013-05-07 07:51:37 -07:00
marvell NET: mv643xx_eth: avoid lockdep dump on interface down 2013-05-16 14:56:21 -07:00
mellanox net/mlx4: Strengthen VLAN tags/priorities enforcement in VST mode 2013-05-11 16:12:44 -07:00
micrel ks8851: Remove unneeded PM_OPS definitions 2013-04-16 16:30:51 -04:00
microchip net: ethernet: enc28j60: use spi_get_drvdata() and spi_set_drvdata() 2013-04-07 16:48:19 -04:00
myricom net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
natsemi net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
neterion net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
nuvoton drivers:net: Remove dma_alloc_coherent OOM messages 2013-03-15 08:56:58 -04:00
nvidia net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
nxp net/nxp/lpc_eth: Drop ifdef CONFIG_OF_NET 2013-04-02 16:43:56 -04:00
octeon
oki-semi pch_gbe: minor: report the actual error on MTU change 2013-04-16 16:43:35 -04:00
packetengines
pasemi drivers:net: dma_alloc_coherent: use __GFP_ZERO instead of memset(, 0) 2013-03-17 12:50:24 -04:00
qlogic qlge: fix dma map leak when the last chunk is not allocated 2013-05-13 12:54:38 -07:00
rdc drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb 2013-03-09 16:09:19 -05:00
realtek Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-04-30 03:55:20 -04:00
renesas sh_eth: use random MAC address if no valid one supplied 2013-04-30 15:37:08 -04:00
seeq drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb 2013-03-09 16:09:19 -05:00
sfc sfc: Reduce RX scatter buffer size, and reduce alignment if appropriate 2013-05-14 11:32:04 -07:00
sgi drivers:net: dma_alloc_coherent: use __GFP_ZERO instead of memset(, 0) 2013-03-17 12:50:24 -04:00
silan
sis sis900: check for DMA map errors 2013-04-15 14:11:37 -04:00
smsc ARM: arm-soc non-critical fixes for 3.10 2013-05-02 08:56:55 -07:00
stmicro net/ethernet: STMMAC_ETH should depend on HAS_DMA 2013-05-11 16:28:23 -07:00
sun net: add ETH_P_802_3_MIN 2013-03-28 01:20:42 -04:00
tehuti net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
ti drivers: net: cpsw: irq not disabled in cpsw isr in particular sequence 2013-05-02 16:52:04 -04:00
tile tile: support new Tilera hypervisor 2013-05-02 16:20:31 -04:00
toshiba net/spider_net: fix error return code in spider_net_open() 2013-05-08 13:13:29 -07:00
tundra drivers:net: dma_alloc_coherent: use __GFP_ZERO instead of memset(, 0) 2013-03-17 12:50:24 -04:00
via net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
wiznet net: ethernet: wiznet: add CONFIG_PM_SLEEP to suspend/resume functions 2013-03-26 12:47:17 -04:00
xilinx net: vlan: rename NETIF_F_HW_VLAN_* feature flags to NETIF_F_HW_VLAN_CTAG_* 2013-04-19 14:45:26 -04:00
xircom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
xscale
Kconfig
Makefile
dnet.c
dnet.h
ethoc.c
fealnx.c
jme.c net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
jme.h
korina.c
lantiq_etop.c lantiq_etop: use free_netdev(netdev) instead of kfree() 2013-03-21 11:50:10 -04:00
netx-eth.c drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb 2013-03-09 16:09:19 -05:00
s6gmac.c s6gmac: fix error return code in s6gmac_probe() 2013-03-22 10:23:42 -04:00