linux/include
Neil Horman bd7c4b604a netpoll: convert mutex into a semaphore
Bart Van Assche recently reported a warning to me:

<IRQ>  [<ffffffff8103d79f>] warn_slowpath_common+0x7f/0xc0
[<ffffffff8103d7fa>] warn_slowpath_null+0x1a/0x20
[<ffffffff814761dd>] mutex_trylock+0x16d/0x180
[<ffffffff813968c9>] netpoll_poll_dev+0x49/0xc30
[<ffffffff8136a2d2>] ? __alloc_skb+0x82/0x2a0
[<ffffffff81397715>] netpoll_send_skb_on_dev+0x265/0x410
[<ffffffff81397c5a>] netpoll_send_udp+0x28a/0x3a0
[<ffffffffa0541843>] ? write_msg+0x53/0x110 [netconsole]
[<ffffffffa05418bf>] write_msg+0xcf/0x110 [netconsole]
[<ffffffff8103eba1>] call_console_drivers.constprop.17+0xa1/0x1c0
[<ffffffff8103fb76>] console_unlock+0x2d6/0x450
[<ffffffff8104011e>] vprintk_emit+0x1ee/0x510
[<ffffffff8146f9f6>] printk+0x4d/0x4f
[<ffffffffa0004f1d>] scsi_print_command+0x7d/0xe0 [scsi_mod]

This resulted from my commit ca99ca14c which introduced a mutex_trylock
operation in a path that could execute in interrupt context.  When mutex
debugging is enabled, the above warns the user when we are in fact
exectuting in interrupt context
interrupt context.

After some discussion, It seems that a semaphore is the proper mechanism to use
here.  While mutexes are defined to be unusable in interrupt context, no such
condition exists for semaphores (save for the fact that the non blocking api
calls, like up and down_trylock must be used when in irq context).

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Bart Van Assche <bvanassche@acm.org>
CC: Bart Van Assche <bvanassche@acm.org>
CC: David Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01 15:00:24 -04:00
..
acpi Fixes: 2013-03-12 20:25:53 -07:00
asm-generic x86-32: Fix possible incomplete TLB invalidate with PAE pagetables 2013-04-12 16:56:47 -07:00
clocksource ImgTec Meta architecture changes for v3.9-rc1 2013-03-03 12:06:09 -08:00
crypto
drm drm/radeon: add Richland pci ids 2013-03-15 18:47:19 -04:00
keys
linux netpoll: convert mutex into a semaphore 2013-05-01 15:00:24 -04:00
math-emu
media
memory
misc
net Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2013-04-29 15:31:57 -04:00
pcmcia
ras
rdma
rxrpc
scsi libfc, fcoe, bnx2fc: Split fc_disc_init into fc_disc_{init, config} 2013-03-25 16:03:03 -07:00
sound Merge remote-tracking branch 'asoc/fix/max98090' into asoc-next 2013-03-26 14:08:03 +00:00
target
trace Revert "block: add missing block_bio_complete() tracepoint" 2013-04-18 09:00:26 -07:00
uapi net: Add MIB counters for checksum errors 2013-04-29 15:14:03 -04:00
video ARM: at91: fix LCD-wiring mode 2013-03-13 11:05:04 +01:00
xen xen-netback: coalesce slots in TX path and fix regressions 2013-04-22 15:37:01 -04:00
Kbuild