ncr5380: Always retry arbitration and selection
authorFinn Thain <fthain@telegraphics.com.au>
Sun, 3 Jan 2016 05:05:24 +0000 (16:05 +1100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 7 Jan 2016 02:42:56 +0000 (21:42 -0500)
If NCR5380_select() returns -1, it means arbitration was lost or selection
failed and should be retried. If the main loop simply terminates when there
are still commands on the issue queue, they will remain queued until they
expire.

Fix this by clearing the 'done' flag after selection failure or lost
arbitration.

The "else break" clause in NCR5380_main() that gets removed here appears
to be a vestige of a long-gone loop that iterated over host instances.
See commit 491447e1fcff ("[PATCH] next NCR5380 updates") in
history/history.git.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/NCR5380.c
drivers/scsi/atari_NCR5380.c

index 3ea8809600cc4829f9476bd4a6c91fd8e1ed3be5..6a030139b41f7e1c887a41e70bd92db6d9b501a2 100644 (file)
@@ -1052,8 +1052,7 @@ static void NCR5380_main(struct work_struct *work)
                        NCR5380_information_transfer(instance);
                        dprintk(NDEBUG_MAIN, "scsi%d : main() : done set false\n", instance->host_no);
                        done = 0;
-               } else
-                       break;
+               }
        } while (!done);
        
        spin_unlock_irq(instance->host_lock);
index 34cf4d9385890fa3b59098ab7ff3e26fa1f35138..64ee92090de337c88d1267fe04d770f7fb6f30d1 100644 (file)
@@ -1181,6 +1181,7 @@ static void NCR5380_main(struct work_struct *work)
 #endif
                                                hostdata->retain_dma_intr--;
                                                local_irq_restore(flags);
+                                               done = 0;
                                                dprintk(NDEBUG_MAIN, "scsi%d: main(): select() failed, "
                                                            "returned to issue_queue\n", HOSTNO);
                                        }