cw1200: Prevent a lock-related hang in the cw1200_spi driver
authorSolomon Peachy <pizza@shaftnet.org>
Wed, 28 Aug 2013 00:29:47 +0000 (20:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2013 16:41:02 +0000 (09:41 -0700)
commit524a992af32af99a4fa8521640ba5bb38fde41d1
tree49756746b8f271dbba429aad153417f175b94cdb
parent4179ebecdc904aef8625afc1c227a2b591c5ed44
cw1200: Prevent a lock-related hang in the cw1200_spi driver

commit 85ba8f529c57ac6e2fca9be0d9e17920a1afb2e8 upstream.

The cw1200_spi driver tries to mirror the cw1200_sdio driver's lock
API, which relies on sdio_claim_host/sdio_release_host to serialize
hardware operations across multiple threads.

Unfortunately the implementation was flawed, as it lacked a way to wake
up the lock requestor when there was contention, often resulting in a
hang.

This problem was uncovered while trying to fix the
spi-transfers-in-interrupt-context BUG() corrected in the previous
patch.  Many thanks to Dave Sizeburns for his assistance in fixing this.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/cw1200/cw1200_spi.c