]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Fix race condition in stop_queue()
authorVasily Khoruzhick <anarsoul@gmail.com>
Wed, 6 Apr 2011 14:49:15 +0000 (17:49 +0300)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 7 Apr 2011 18:17:45 +0000 (11:17 -0700)
commit901a218c859681ec4eb6c50a02c67eb282a0cd43
tree42a67f4ca8a624df752ad790fe0614fa584817d6
parenta09c20416f60f177b08713fc027d35edad18dbf4
spi: Fix race condition in stop_queue()

There's a race condition in stop_queue() in some drivers -
if drv_data->queue is empty, but drv_data->busy is still set
(or opposite situation) stop_queue will return -EBUSY.
So fix loop condition to check that both drv_data->queue is empty
and drv_data->busy is not set.

This patch affects following drivers:
pxa2xx_spi
spi_bfin5xx
amba-pl022
dw_spi

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/amba-pl022.c
drivers/spi/dw_spi.c
drivers/spi/pxa2xx_spi.c
drivers/spi/spi_bfin5xx.c