]> git.baikalelectronics.ru Git - kernel.git/commit
spi: fix possible deadlock between internal bus locks and bus_lock_flag
authorHeiko Stübner <heiko@sntech.de>
Fri, 18 Mar 2016 10:15:11 +0000 (11:15 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 18 Mar 2016 10:37:09 +0000 (10:37 +0000)
commit7a9459b7842393aa5c25b75f8fac7243be3945f7
treeca4565ebd4913413129ba626bd5d823c767bc0ec
parente8f0cb9582f45889e977f4c913c1eae5e1323a5e
spi: fix possible deadlock between internal bus locks and bus_lock_flag

External users may use spi_bus_lock to get exclusive access. This will
also grab the bus_lock_mutex and may therefore result in a deadlock if
__spi_pump_messages also tries to get the mutex.

Therefore adapt spi_pump_messages as well as spi_sync to preset the
bus_locked parameter according to the master->bus_lock_flag.

Fixes: 2116ad26471e ("spi: core: Fix deadlock when sending messages")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c