Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
[firefly-linux-kernel-4.4.55.git] / drivers / spi / amba-pl022.c
index 5825370bad25bdba23823510fffc5293d05e1e59..08de58e7f59f7f6521ffb5122078103473c66117 100644 (file)
@@ -1555,7 +1555,7 @@ 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 */
-       while (!list_empty(&pl022->queue) && pl022->busy && limit--) {
+       while ((!list_empty(&pl022->queue) || pl022->busy) && limit--) {
                spin_unlock_irqrestore(&pl022->queue_lock, flags);
                msleep(10);
                spin_lock_irqsave(&pl022->queue_lock, flags);