[PATCH 1/3] m68k/atari - atari_scsi: fix wait_event completion conditions

Michael Schmitz
2014-01-28T23:55:22Z

Fix patch by ArndB changing falcon_get_lock to use wait_event.
Some of the completion conditions had been missed when converting
from while() {} to do {} until() logic.

Signed-off-by: Michael Schmitz <schmitz@debian.org>
---
drivers/scsi/atari_scsi.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index 1986ecb..cc1b013 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -550,10 +550,10 @@ static void falcon_get_lock(void)

local_irq_save(flags);

- wait_event_cmd(falcon_fairness_wait,
- !in_irq() && falcon_got_lock && stdma_others_waiting(),
- local_irq_restore(flags),
- local_irq_save(flags));
+ wait_event_cmd(falcon_fairness_wait,
+ in_irq() || !falcon_got_lock || !stdma_others_waiting(),
+ local_irq_restore(flags),
+ local_irq_save(flags));

while (!falcon_got_lock) {
if (in_irq())
@@ -566,9 +566,9 @@ static void falcon_get_lock(void)
wake_up(&falcon_try_wait);
} else {
wait_event_cmd(falcon_try_wait,
- !falcon_got_lock && !falcon_trying_lock,
- local_irq_restore(flags),
- local_irq_save(flags));
+ falcon_got_lock && !falcon_trying_lock,
+ local_irq_restore(flags),
+ local_irq_save(flags));
}
}

--
1.7.0.4