aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/atari_NCR5380.c
diff options
context:
space:
mode:
authorMichael Schmitz <schmitzmic@gmail.com>2014-05-02 04:43:01 -0400
committerChristoph Hellwig <hch@lst.de>2014-05-19 13:12:24 -0400
commit2b0f834ca3c93e3d76ae335586b41ed921c5a293 (patch)
tree2c25651e4645deab6db707645528468105b4cc95 /drivers/scsi/atari_NCR5380.c
parentb413cf490682d39a95e80a4751022b858d21bc6b (diff)
m68k/atari - atari_scsi: change abort/reset return codes
[Resend of earlier patch - added equivalent changes to sun3 NCR5380 code] The abort/reset lowlevel return codes had changed with the new error SCSI handling - update Atari and Sun3 NCR5380 drivers to reflect this. Change reset handling for Atari to clear queues only, do not attempt to call done() on each command aborted by the reset. The EH code should do that for us. Queues _must_ be cleared, otherwise atari_scsi_bus_reset will not release the ST-DMA lock, deadlocking further error recovery. Update the Sun3 NCR5380 driver as well - the Sun3 driver was derived from the Atari one. Kudos to Finn Thain for the Sun3 part and cleaning up the header files. After the header cleanup, the initio.h include (!) can be dropped from sun3_scsi.h now. Signed-off-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: Sam Creasey <sammy@sammy.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: James E.J. Bottomley <JBottomley@parallels.com> Cc: linux-scsi@vger.kernel.org Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/atari_NCR5380.c')
-rw-r--r--drivers/scsi/atari_NCR5380.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 0f3cdbc80ba6..e4aaf9a51de3 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -2683,11 +2683,11 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2683 local_irq_restore(flags); 2683 local_irq_restore(flags);
2684 cmd->scsi_done(cmd); 2684 cmd->scsi_done(cmd);
2685 falcon_release_lock_if_possible(hostdata); 2685 falcon_release_lock_if_possible(hostdata);
2686 return SCSI_ABORT_SUCCESS; 2686 return SUCCESS;
2687 } else { 2687 } else {
2688/* local_irq_restore(flags); */ 2688/* local_irq_restore(flags); */
2689 printk("scsi%d: abort of connected command failed!\n", HOSTNO); 2689 printk("scsi%d: abort of connected command failed!\n", HOSTNO);
2690 return SCSI_ABORT_ERROR; 2690 return FAILED;
2691 } 2691 }
2692 } 2692 }
2693#endif 2693#endif
@@ -2711,7 +2711,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2711 * yet... */ 2711 * yet... */
2712 tmp->scsi_done(tmp); 2712 tmp->scsi_done(tmp);
2713 falcon_release_lock_if_possible(hostdata); 2713 falcon_release_lock_if_possible(hostdata);
2714 return SCSI_ABORT_SUCCESS; 2714 return SUCCESS;
2715 } 2715 }
2716 } 2716 }
2717 2717
@@ -2729,7 +2729,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2729 if (hostdata->connected) { 2729 if (hostdata->connected) {
2730 local_irq_restore(flags); 2730 local_irq_restore(flags);
2731 ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO); 2731 ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO);
2732 return SCSI_ABORT_SNOOZE; 2732 return FAILED;
2733 } 2733 }
2734 2734
2735 /* 2735 /*
@@ -2764,7 +2764,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2764 ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO); 2764 ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO);
2765 2765
2766 if (NCR5380_select(instance, cmd, (int)cmd->tag)) 2766 if (NCR5380_select(instance, cmd, (int)cmd->tag))
2767 return SCSI_ABORT_BUSY; 2767 return FAILED;
2768 2768
2769 ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO); 2769 ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO);
2770 2770
@@ -2791,7 +2791,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2791 local_irq_restore(flags); 2791 local_irq_restore(flags);
2792 tmp->scsi_done(tmp); 2792 tmp->scsi_done(tmp);
2793 falcon_release_lock_if_possible(hostdata); 2793 falcon_release_lock_if_possible(hostdata);
2794 return SCSI_ABORT_SUCCESS; 2794 return SUCCESS;
2795 } 2795 }
2796 } 2796 }
2797 } 2797 }
@@ -2816,7 +2816,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2816 */ 2816 */
2817 falcon_release_lock_if_possible(hostdata); 2817 falcon_release_lock_if_possible(hostdata);
2818 2818
2819 return SCSI_ABORT_NOT_RUNNING; 2819 return FAILED;
2820} 2820}
2821 2821
2822 2822
@@ -2825,7 +2825,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2825 * 2825 *
2826 * Purpose : reset the SCSI bus. 2826 * Purpose : reset the SCSI bus.
2827 * 2827 *
2828 * Returns : SCSI_RESET_WAKEUP 2828 * Returns : SUCCESS or FAILURE
2829 * 2829 *
2830 */ 2830 */
2831 2831
@@ -2834,7 +2834,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2834 SETUP_HOSTDATA(cmd->device->host); 2834 SETUP_HOSTDATA(cmd->device->host);
2835 int i; 2835 int i;
2836 unsigned long flags; 2836 unsigned long flags;
2837#if 1 2837#if defined(RESET_RUN_DONE)
2838 Scsi_Cmnd *connected, *disconnected_queue; 2838 Scsi_Cmnd *connected, *disconnected_queue;
2839#endif 2839#endif
2840 2840
@@ -2859,7 +2859,14 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2859 * through anymore ... */ 2859 * through anymore ... */
2860 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 2860 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG);
2861 2861
2862#if 1 /* XXX Should now be done by midlevel code, but it's broken XXX */ 2862 /* MSch 20140115 - looking at the generic NCR5380 driver, all of this
2863 * should go.
2864 * Catch-22: if we don't clear all queues, the SCSI driver lock will
2865 * not be reset by atari_scsi_reset()!
2866 */
2867
2868#if defined(RESET_RUN_DONE)
2869 /* XXX Should now be done by midlevel code, but it's broken XXX */
2863 /* XXX see below XXX */ 2870 /* XXX see below XXX */
2864 2871
2865 /* MSch: old-style reset: actually abort all command processing here */ 2872 /* MSch: old-style reset: actually abort all command processing here */
@@ -2915,7 +2922,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2915 * the midlevel code that the reset was SUCCESSFUL, and there is no 2922 * the midlevel code that the reset was SUCCESSFUL, and there is no
2916 * need to 'wake up' the commands by a request_sense 2923 * need to 'wake up' the commands by a request_sense
2917 */ 2924 */
2918 return SCSI_RESET_SUCCESS | SCSI_RESET_BUS_RESET; 2925 return SUCCESS;
2919#else /* 1 */ 2926#else /* 1 */
2920 2927
2921 /* MSch: new-style reset handling: let the mid-level do what it can */ 2928 /* MSch: new-style reset handling: let the mid-level do what it can */
@@ -2963,6 +2970,6 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2963 local_irq_restore(flags); 2970 local_irq_restore(flags);
2964 2971
2965 /* we did no complete reset of all commands, so a wakeup is required */ 2972 /* we did no complete reset of all commands, so a wakeup is required */
2966 return SCSI_RESET_WAKEUP | SCSI_RESET_BUS_RESET; 2973 return SUCCESS;
2967#endif /* 1 */ 2974#endif /* 1 */
2968} 2975}