spi: fix possible deadlock between internal bus locks and bus_lock_flag
From: Heiko Stuebner <heiko@...> Date: Fri, 18 Mar 2016 00:12:03 +0100
Commit-Message
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: 49023d2e4ead ("spi: core: Fix deadlock when sending messages") Signed-off-by: Heiko Stuebner <heiko@...>
Patch-Comment
changes in v2: - move the second check from __spi_pump_messages to its calling functions spi_pump_messages and __spi_sync as suggested by Vignesh drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Statistics
- 2 lines added
- 2 lines removed