[linux-yocto] [PATCH 5/5] axxia: Command Completion Done Check in NCR Driver
Daniel Dragomir
daniel.dragomir at windriver.com
Mon Feb 9 09:42:27 PST 2015
From: John Jacques <john.jacques at lsi.com>
Correct the bits and locking used during a check for completion
done in drivers/misc/lsi-ncr.c.
Signed-off-by: John Jacques <john.jacques at lsi.com>
---
drivers/misc/lsi-ncr.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/misc/lsi-ncr.c b/drivers/misc/lsi-ncr.c
index 16b1907..276d72c 100644
--- a/drivers/misc/lsi-ncr.c
+++ b/drivers/misc/lsi-ncr.c
@@ -299,19 +299,23 @@ ncr_check_pio_status(char *str)
do {
cdr0.raw =
nca_register_read((unsigned *)(nca_address + 0xf0));
- } while ((0x1 == cdr0.bits.status) &&
- (time_before(jiffies, timeout)));
+ } while ((0x1 == cdr0.bits.start_done) &&
+ (time_before(jiffies, timeout)));
- if (!(time_before(jiffies, timeout))) {
- raw_spin_unlock_irqrestore(&ncr_spin_lock, ncr_spin_flags);
- pr_err("ncr_check_pio_status() PIO operation timeout!\n");
+ if (0x1 == cdr0.bits.start_done) {
+ /* timed out without completing */
+ pr_err("lsi-ncr: PIO operation timeout cdr0=0x%08lx!\n",
+ cdr0.raw);
+ ncr_pio_error_dump(str);
+ ncr_unlock(LOCK_DOMAIN);
BUG();
-
return -1;
}
+
if (0x3 != cdr0.bits.status) {
+ /* completed with non-success status */
ncr_pio_error_dump(str);
- /* clear CDR0 to allow subsequent commands to complete */
+ /* clear CDR0 to allow subsequent commands to complete */
nca_register_write(0, (unsigned *) (nca_address + 0xf0));
}
--
1.8.1.4
More information about the linux-yocto
mailing list