}
}
- 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) {
"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;
}
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();
}
/**