mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
spi/pl022: fix stop queue procedure
This fix prevents queue being marked as "stopped", if data exists in the queue list. Signed-off-by: Grzegorz Sygieda <[email protected]> Signed-off-by: Lukasz Baj <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Grant Likely <[email protected]>
This commit is contained in:
parent
781c7b129b
commit
4a12404dda
1 changed files with 1 additions and 1 deletions
|
|
@ -1211,7 +1211,6 @@ static int stop_queue(struct pl022 *pl022)
|
|||
* A wait_queue on the pl022->busy could be used, but then the common
|
||||
* execution path (pump_messages) would be required to call wake_up or
|
||||
* friends on every SPI message. Do this instead */
|
||||
pl022->run = QUEUE_STOPPED;
|
||||
while (!list_empty(&pl022->queue) && pl022->busy && limit--) {
|
||||
spin_unlock_irqrestore(&pl022->queue_lock, flags);
|
||||
msleep(10);
|
||||
|
|
@ -1220,6 +1219,7 @@ static int stop_queue(struct pl022 *pl022)
|
|||
|
||||
if (!list_empty(&pl022->queue) || pl022->busy)
|
||||
status = -EBUSY;
|
||||
else pl022->run = QUEUE_STOPPED;
|
||||
|
||||
spin_unlock_irqrestore(&pl022->queue_lock, flags);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue