From: Mark Brown Date: Fri, 11 Mar 2016 07:28:35 +0000 (+0700) Subject: Merge remote-tracking branches 'spi/topic/doc', 'spi/topic/dw' and 'spi/topic/flash... X-Git-Tag: v4.6-rc1~148^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f91c75d6faefdded97d2ecbe8c4f9cf197f68110;p=karo-tx-linux.git Merge remote-tracking branches 'spi/topic/doc', 'spi/topic/dw' and 'spi/topic/flash' into spi-next --- f91c75d6faefdded97d2ecbe8c4f9cf197f68110 diff --cc drivers/spi/spi.c index e86148fd458b,47eff8012a77,47eff8012a77,f565cc8901a6..b30f03a99dfd --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@@@@ -1152,7 -1152,6 -1152,6 -1154,9 +1154,9 @@@@@ static void __spi_pump_messages(struct } } - mutex_lock(&master->bus_lock_mutex); +++ if (!bus_locked) +++ mutex_lock(&master->bus_lock_mutex); +++ trace_spi_message_start(master->cur_msg); if (master->prepare_message) { @@@@@ -1162,8 -1161,7 -1161,7 -1166,7 +1166,7 @@@@@ "failed to prepare message: %d\n", ret); master->cur_msg->status = ret; spi_finalize_current_message(master); - mutex_unlock(&master->bus_lock_mutex); --- return; +++ goto out; } master->cur_msg_prepared = true; } @@@@@ -1172,21 -1170,15 -1170,15 -1175,23 +1175,23 @@@@@ if (ret) { master->cur_msg->status = ret; spi_finalize_current_message(master); - mutex_unlock(&master->bus_lock_mutex); --- return; +++ goto out; } ret = master->transfer_one_message(master, master->cur_msg); if (ret) { dev_err(&master->dev, "failed to transfer one message from queue\n"); - mutex_unlock(&master->bus_lock_mutex); --- return; +++ goto out; } - mutex_unlock(&master->bus_lock_mutex); +++ +++ out: +++ if (!bus_locked) +++ mutex_unlock(&master->bus_lock_mutex); ++ ++ /* Prod the scheduler in case transfer_one() was busy waiting */ - cond_resched(); +++ if (!ret) +++ cond_resched(); } /**