diff options
-rw-r--r-- | drivers/scsi/atari_NCR5380.c | 31 | ||||
-rw-r--r-- | drivers/scsi/atari_scsi.c | 2 | ||||
-rw-r--r-- | drivers/scsi/atari_scsi.h | 26 | ||||
-rw-r--r-- | drivers/scsi/sun3_NCR5380.c | 33 | ||||
-rw-r--r-- | drivers/scsi/sun3_scsi.c | 3 |
5 files changed, 42 insertions, 53 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 | } |
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index 296c936cc03c..4ae0c1a29598 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c | |||
@@ -827,7 +827,7 @@ static int atari_scsi_bus_reset(Scsi_Cmnd *cmd) | |||
827 | } else { | 827 | } else { |
828 | atari_turnon_irq(IRQ_MFP_FSCSI); | 828 | atari_turnon_irq(IRQ_MFP_FSCSI); |
829 | } | 829 | } |
830 | if ((rv & SCSI_RESET_ACTION) == SCSI_RESET_SUCCESS) | 830 | if (rv == SUCCESS) |
831 | falcon_release_lock_if_possible(hostdata); | 831 | falcon_release_lock_if_possible(hostdata); |
832 | 832 | ||
833 | return rv; | 833 | return rv; |
diff --git a/drivers/scsi/atari_scsi.h b/drivers/scsi/atari_scsi.h index 11c624bb122d..ae559f4ea0b4 100644 --- a/drivers/scsi/atari_scsi.h +++ b/drivers/scsi/atari_scsi.h | |||
@@ -54,32 +54,6 @@ | |||
54 | #define NCR5380_dma_xfer_len(i,cmd,phase) \ | 54 | #define NCR5380_dma_xfer_len(i,cmd,phase) \ |
55 | atari_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1) | 55 | atari_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1) |
56 | 56 | ||
57 | /* former generic SCSI error handling stuff */ | ||
58 | |||
59 | #define SCSI_ABORT_SNOOZE 0 | ||
60 | #define SCSI_ABORT_SUCCESS 1 | ||
61 | #define SCSI_ABORT_PENDING 2 | ||
62 | #define SCSI_ABORT_BUSY 3 | ||
63 | #define SCSI_ABORT_NOT_RUNNING 4 | ||
64 | #define SCSI_ABORT_ERROR 5 | ||
65 | |||
66 | #define SCSI_RESET_SNOOZE 0 | ||
67 | #define SCSI_RESET_PUNT 1 | ||
68 | #define SCSI_RESET_SUCCESS 2 | ||
69 | #define SCSI_RESET_PENDING 3 | ||
70 | #define SCSI_RESET_WAKEUP 4 | ||
71 | #define SCSI_RESET_NOT_RUNNING 5 | ||
72 | #define SCSI_RESET_ERROR 6 | ||
73 | |||
74 | #define SCSI_RESET_SYNCHRONOUS 0x01 | ||
75 | #define SCSI_RESET_ASYNCHRONOUS 0x02 | ||
76 | #define SCSI_RESET_SUGGEST_BUS_RESET 0x04 | ||
77 | #define SCSI_RESET_SUGGEST_HOST_RESET 0x08 | ||
78 | |||
79 | #define SCSI_RESET_BUS_RESET 0x100 | ||
80 | #define SCSI_RESET_HOST_RESET 0x200 | ||
81 | #define SCSI_RESET_ACTION 0xff | ||
82 | |||
83 | /* Debugging printk definitions: | 57 | /* Debugging printk definitions: |
84 | * | 58 | * |
85 | * ARB -> arbitration | 59 | * ARB -> arbitration |
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 636bbe0ea84c..72550bd38efd 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
@@ -2664,11 +2664,11 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
2664 | #endif | 2664 | #endif |
2665 | local_irq_restore(flags); | 2665 | local_irq_restore(flags); |
2666 | cmd->scsi_done(cmd); | 2666 | cmd->scsi_done(cmd); |
2667 | return SCSI_ABORT_SUCCESS; | 2667 | return SUCCESS; |
2668 | } else { | 2668 | } else { |
2669 | /* local_irq_restore(flags); */ | 2669 | /* local_irq_restore(flags); */ |
2670 | printk("scsi%d: abort of connected command failed!\n", HOSTNO); | 2670 | printk("scsi%d: abort of connected command failed!\n", HOSTNO); |
2671 | return SCSI_ABORT_ERROR; | 2671 | return FAILED; |
2672 | } | 2672 | } |
2673 | } | 2673 | } |
2674 | #endif | 2674 | #endif |
@@ -2691,7 +2691,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
2691 | /* Tagged queuing note: no tag to free here, hasn't been assigned | 2691 | /* Tagged queuing note: no tag to free here, hasn't been assigned |
2692 | * yet... */ | 2692 | * yet... */ |
2693 | tmp->scsi_done(tmp); | 2693 | tmp->scsi_done(tmp); |
2694 | return SCSI_ABORT_SUCCESS; | 2694 | return SUCCESS; |
2695 | } | 2695 | } |
2696 | 2696 | ||
2697 | /* | 2697 | /* |
@@ -2708,7 +2708,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
2708 | if (hostdata->connected) { | 2708 | if (hostdata->connected) { |
2709 | local_irq_restore(flags); | 2709 | local_irq_restore(flags); |
2710 | ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO); | 2710 | ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO); |
2711 | return SCSI_ABORT_SNOOZE; | 2711 | return FAILED; |
2712 | } | 2712 | } |
2713 | 2713 | ||
2714 | /* | 2714 | /* |
@@ -2743,7 +2743,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
2743 | ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO); | 2743 | ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO); |
2744 | 2744 | ||
2745 | if (NCR5380_select (instance, cmd, (int) cmd->tag)) | 2745 | if (NCR5380_select (instance, cmd, (int) cmd->tag)) |
2746 | return SCSI_ABORT_BUSY; | 2746 | return FAILED; |
2747 | 2747 | ||
2748 | ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO); | 2748 | ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO); |
2749 | 2749 | ||
@@ -2769,7 +2769,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
2769 | #endif | 2769 | #endif |
2770 | local_irq_restore(flags); | 2770 | local_irq_restore(flags); |
2771 | tmp->scsi_done(tmp); | 2771 | tmp->scsi_done(tmp); |
2772 | return SCSI_ABORT_SUCCESS; | 2772 | return SUCCESS; |
2773 | } | 2773 | } |
2774 | } | 2774 | } |
2775 | 2775 | ||
@@ -2786,7 +2786,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
2786 | local_irq_restore(flags); | 2786 | local_irq_restore(flags); |
2787 | printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO); | 2787 | printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO); |
2788 | 2788 | ||
2789 | return SCSI_ABORT_NOT_RUNNING; | 2789 | return FAILED; |
2790 | } | 2790 | } |
2791 | 2791 | ||
2792 | 2792 | ||
@@ -2795,7 +2795,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
2795 | * | 2795 | * |
2796 | * Purpose : reset the SCSI bus. | 2796 | * Purpose : reset the SCSI bus. |
2797 | * | 2797 | * |
2798 | * Returns : SCSI_RESET_WAKEUP | 2798 | * Returns : SUCCESS or FAILURE |
2799 | * | 2799 | * |
2800 | */ | 2800 | */ |
2801 | 2801 | ||
@@ -2804,7 +2804,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) | |||
2804 | SETUP_HOSTDATA(cmd->device->host); | 2804 | SETUP_HOSTDATA(cmd->device->host); |
2805 | int i; | 2805 | int i; |
2806 | unsigned long flags; | 2806 | unsigned long flags; |
2807 | #if 1 | 2807 | #if defined(RESET_RUN_DONE) |
2808 | struct scsi_cmnd *connected, *disconnected_queue; | 2808 | struct scsi_cmnd *connected, *disconnected_queue; |
2809 | #endif | 2809 | #endif |
2810 | 2810 | ||
@@ -2826,8 +2826,15 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) | |||
2826 | * through anymore ... */ | 2826 | * through anymore ... */ |
2827 | (void)NCR5380_read( RESET_PARITY_INTERRUPT_REG ); | 2827 | (void)NCR5380_read( RESET_PARITY_INTERRUPT_REG ); |
2828 | 2828 | ||
2829 | #if 1 /* XXX Should now be done by midlevel code, but it's broken XXX */ | 2829 | /* MSch 20140115 - looking at the generic NCR5380 driver, all of this |
2830 | /* XXX see below XXX */ | 2830 | * should go. |
2831 | * Catch-22: if we don't clear all queues, the SCSI driver lock will | ||
2832 | * not be released by atari_scsi_reset()! | ||
2833 | */ | ||
2834 | |||
2835 | #if defined(RESET_RUN_DONE) | ||
2836 | /* XXX Should now be done by midlevel code, but it's broken XXX */ | ||
2837 | /* XXX see below XXX */ | ||
2831 | 2838 | ||
2832 | /* MSch: old-style reset: actually abort all command processing here */ | 2839 | /* MSch: old-style reset: actually abort all command processing here */ |
2833 | 2840 | ||
@@ -2876,7 +2883,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) | |||
2876 | * the midlevel code that the reset was SUCCESSFUL, and there is no | 2883 | * the midlevel code that the reset was SUCCESSFUL, and there is no |
2877 | * need to 'wake up' the commands by a request_sense | 2884 | * need to 'wake up' the commands by a request_sense |
2878 | */ | 2885 | */ |
2879 | return SCSI_RESET_SUCCESS | SCSI_RESET_BUS_RESET; | 2886 | return SUCCESS; |
2880 | #else /* 1 */ | 2887 | #else /* 1 */ |
2881 | 2888 | ||
2882 | /* MSch: new-style reset handling: let the mid-level do what it can */ | 2889 | /* MSch: new-style reset handling: let the mid-level do what it can */ |
@@ -2924,7 +2931,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) | |||
2924 | local_irq_restore(flags); | 2931 | local_irq_restore(flags); |
2925 | 2932 | ||
2926 | /* we did no complete reset of all commands, so a wakeup is required */ | 2933 | /* we did no complete reset of all commands, so a wakeup is required */ |
2927 | return SCSI_RESET_WAKEUP | SCSI_RESET_BUS_RESET; | 2934 | return SUCCESS; |
2928 | #endif /* 1 */ | 2935 | #endif /* 1 */ |
2929 | } | 2936 | } |
2930 | 2937 | ||
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c index e2c009b033ce..243c228a6d8c 100644 --- a/drivers/scsi/sun3_scsi.c +++ b/drivers/scsi/sun3_scsi.c | |||
@@ -79,7 +79,6 @@ | |||
79 | #define REAL_DMA | 79 | #define REAL_DMA |
80 | 80 | ||
81 | #include "scsi.h" | 81 | #include "scsi.h" |
82 | #include "initio.h" | ||
83 | #include <scsi/scsi_host.h> | 82 | #include <scsi/scsi_host.h> |
84 | #include "sun3_scsi.h" | 83 | #include "sun3_scsi.h" |
85 | 84 | ||
@@ -123,6 +122,8 @@ module_param(setup_hostid, int, 0); | |||
123 | 122 | ||
124 | static struct scsi_cmnd *sun3_dma_setup_done = NULL; | 123 | static struct scsi_cmnd *sun3_dma_setup_done = NULL; |
125 | 124 | ||
125 | #define RESET_RUN_DONE | ||
126 | |||
126 | #define AFTER_RESET_DELAY (HZ/2) | 127 | #define AFTER_RESET_DELAY (HZ/2) |
127 | 128 | ||
128 | /* ms to wait after hitting dma regs */ | 129 | /* ms to wait after hitting dma regs */ |