From 716ca530e1c4515d8683c9d5be3d56b301758b66 Mon Sep 17 00:00:00 2001 From: James <> Date: Wed, 4 Nov 2015 11:49:21 +0000 Subject: trunk-47381 --- ...o-see-if-the-device-is-processing-a-messa.patch | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 target/linux/generic/patches-3.18/092-01-spi-Check-to-see-if-the-device-is-processing-a-messa.patch (limited to 'target/linux/generic/patches-3.18/092-01-spi-Check-to-see-if-the-device-is-processing-a-messa.patch') diff --git a/target/linux/generic/patches-3.18/092-01-spi-Check-to-see-if-the-device-is-processing-a-messa.patch b/target/linux/generic/patches-3.18/092-01-spi-Check-to-see-if-the-device-is-processing-a-messa.patch new file mode 100644 index 0000000..fa3ab6a --- /dev/null +++ b/target/linux/generic/patches-3.18/092-01-spi-Check-to-see-if-the-device-is-processing-a-messa.patch @@ -0,0 +1,47 @@ +From: Mark Brown +Date: Tue, 9 Dec 2014 19:46:56 +0000 +Subject: [PATCH] spi: Check to see if the device is processing a message + before we idle + +cur_msg is updated under the queue lock and holds the message we are +currently processing. Since currently we only ever do removals in the +pump kthread it doesn't matter in what order we do things but we want +to be able to push things out from the submitting thread so pull the +check to see if we're currently handling a message before we check to +see if the queue is idle. + +Signed-off-by: Mark Brown +--- + +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -891,8 +891,16 @@ static void spi_pump_messages(struct kth + bool was_busy = false; + int ret; + +- /* Lock queue and check for queue work */ ++ /* Lock queue */ + spin_lock_irqsave(&master->queue_lock, flags); ++ ++ /* Make sure we are not already running a message */ ++ if (master->cur_msg) { ++ spin_unlock_irqrestore(&master->queue_lock, flags); ++ return; ++ } ++ ++ /* Check if the queue is idle */ + if (list_empty(&master->queue) || !master->running) { + if (!master->busy) { + spin_unlock_irqrestore(&master->queue_lock, flags); +@@ -916,11 +924,6 @@ static void spi_pump_messages(struct kth + return; + } + +- /* Make sure we are not already running a message */ +- if (master->cur_msg) { +- spin_unlock_irqrestore(&master->queue_lock, flags); +- return; +- } + /* Extract head of queue */ + master->cur_msg = + list_first_entry(&master->queue, struct spi_message, queue); -- cgit v1.2.3