1
0
Fork 0
alistair23-linux/drivers/net
Thomas Falcon 6c5c748908 ibmvnic: Convert reset work item mutex to spin lock
ibmvnic_reset can create and schedule a reset work item from
an IRQ context, so do not use a mutex, which can sleep. Convert
the reset work item mutex to a spin lock. Locking debugger generated
the trace output below.

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908
in_atomic(): 1, irqs_disabled(): 1, pid: 120, name: kworker/8:1
4 locks held by kworker/8:1/120:
 #0: 0000000017c05720 ((wq_completion)"events"){+.+.}, at: process_one_work+0x188/0x710
 #1: 00000000ace90706 ((linkwatch_work).work){+.+.}, at: process_one_work+0x188/0x710
 #2: 000000007632871f (rtnl_mutex){+.+.}, at: rtnl_lock+0x30/0x50
 #3: 00000000fc36813a (&(&crq->lock)->rlock){..-.}, at: ibmvnic_tasklet+0x88/0x2010 [ibmvnic]
irq event stamp: 26293
hardirqs last  enabled at (26292): [<c000000000122468>] tasklet_action_common.isra.12+0x78/0x1c0
hardirqs last disabled at (26293): [<c000000000befce8>] _raw_spin_lock_irqsave+0x48/0xf0
softirqs last  enabled at (26288): [<c000000000a8ac78>] dev_deactivate_queue.constprop.28+0xc8/0x160
softirqs last disabled at (26289): [<c0000000000306e0>] call_do_softirq+0x14/0x24
CPU: 8 PID: 120 Comm: kworker/8:1 Kdump: loaded Not tainted 4.20.0-rc6 #6
Workqueue: events linkwatch_event
Call Trace:
[c0000003fffa7a50] [c000000000bc83e4] dump_stack+0xe8/0x164 (unreliable)
[c0000003fffa7aa0] [c00000000015ba0c] ___might_sleep+0x2dc/0x320
[c0000003fffa7b20] [c000000000be960c] __mutex_lock+0x8c/0xb40
[c0000003fffa7c30] [d000000006202ac8] ibmvnic_reset+0x78/0x330 [ibmvnic]
[c0000003fffa7cc0] [d0000000062097f4] ibmvnic_tasklet+0x1054/0x2010 [ibmvnic]
[c0000003fffa7e00] [c0000000001224c8] tasklet_action_common.isra.12+0xd8/0x1c0
[c0000003fffa7e60] [c000000000bf1238] __do_softirq+0x1a8/0x64c
[c0000003fffa7f90] [c0000000000306e0] call_do_softirq+0x14/0x24
[c0000003f3f87980] [c00000000001ba50] do_softirq_own_stack+0x60/0xb0
[c0000003f3f879c0] [c0000000001218a8] do_softirq+0xa8/0x100
[c0000003f3f879f0] [c000000000121a74] __local_bh_enable_ip+0x174/0x180
[c0000003f3f87a60] [c000000000bf003c] _raw_spin_unlock_bh+0x5c/0x80
[c0000003f3f87a90] [c000000000a8ac78] dev_deactivate_queue.constprop.28+0xc8/0x160
[c0000003f3f87ad0] [c000000000a8c8b0] dev_deactivate_many+0xd0/0x520
[c0000003f3f87b70] [c000000000a8cd40] dev_deactivate+0x40/0x60
[c0000003f3f87ba0] [c000000000a5e0c4] linkwatch_do_dev+0x74/0xd0
[c0000003f3f87bd0] [c000000000a5e694] __linkwatch_run_queue+0x1a4/0x1f0
[c0000003f3f87c30] [c000000000a5e728] linkwatch_event+0x48/0x60
[c0000003f3f87c50] [c0000000001444e8] process_one_work+0x238/0x710
[c0000003f3f87d20] [c000000000144a48] worker_thread+0x88/0x4e0
[c0000003f3f87db0] [c00000000014e3a8] kthread+0x178/0x1c0
[c0000003f3f87e20] [c00000000000bfd0] ret_from_kernel_thread+0x5c/0x6c

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-12-10 17:34:25 -08:00
..
appletalk
arcnet mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
bonding bonding: fix 802.3ad state sent to partner when unbinding slave 2018-11-30 13:21:04 -08:00
caif
can can: flexcan: use can_rx_offload_queue_sorted() for flexcan_irq_bus_*() 2018-11-09 17:33:33 +01:00
dsa mv88e6060: disable hardware level MAC learning 2018-12-03 16:04:21 -08:00
ethernet ibmvnic: Convert reset work item mutex to spin lock 2018-12-10 17:34:25 -08:00
fddi FDDI: defza: Make the driver version string constant 2018-11-07 21:53:31 -08:00
fjes
hamradio Merge branch 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-10-24 14:43:41 +01:00
hippi
hyperv hv_netvsc: fix vf serial matching with pci slot info 2018-10-15 22:58:11 -07:00
ieee802154 Merge branch 'ieee802154-for-davem-2018-10-04' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next 2018-10-04 09:32:48 -07:00
ipvlan
netdevsim bpf: add verifier callback to get stack usage info for offloaded progs 2018-10-08 10:24:12 +02:00
phy phy: Revert toggling reset changes. 2018-12-04 08:47:44 -08:00
plip
ppp Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-10-25 16:43:35 -07:00
slip change semantics of ldisc ->compat_ioctl() 2018-10-13 00:50:53 -04:00
team team: no need to do team_notify_peers or team_mcast_rejoin when disabling port 2018-11-23 17:18:15 -08:00
usb usbnet: ipheth: fix potential recvmsg bug and recvmsg bug 2 2018-11-27 14:57:16 -08:00
vmxnet3
wan Merge branch 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-10-24 14:43:41 +01:00
wimax
wireless As it's been a while, we have various fixes for 2018-12-05 11:46:06 -08:00
xen-netback Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-10-03 21:00:17 -07:00
Kconfig
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-10-19 11:03:06 -07:00
gtp.c
ifb.c
loopback.c net: loopback: clear skb->tstamp before netif_rx() 2018-10-20 01:01:28 -07:00
macsec.c macsec: let the administrator set UP state even if lowerdev is down 2018-10-28 19:26:42 -07:00
macvlan.c macvlan: return correct error value 2018-12-03 16:02:43 -08:00
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Simplify remove with client device drvdata 2018-10-31 21:20:05 -04:00
rionet.c rapidio/rionet: do not free skb before reading its length 2018-11-28 10:38:48 -08:00
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: remove skb access after netif_receive_skb 2018-12-03 14:10:27 -08:00
veth.c veth: Add ethtool statistics support for XDP 2018-10-15 21:58:46 -07:00
virtio_net.c virtio-net: keep vnet header zeroed after processing XDP 2018-11-30 17:25:03 -08:00
vrf.c ipv6: add vrf table handling code for ipv6 mcast 2018-10-02 22:29:08 -07:00
vsockmon.c
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-10-19 11:03:06 -07:00
xen-netfront.c