diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2014-11-12 00:12:22 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-20 03:11:20 -0500 |
commit | ab93afaceb9623d5ad27b6022366b8f3d27d20e4 (patch) | |
tree | 0b216fad66ce4fdf50d8972bbf325659bc511da6 /drivers/scsi/atari_NCR5380.c | |
parent | a53a21e4662fd2ed27863f511715898459312393 (diff) |
atari_NCR5380: Remove RESET_RUN_DONE macro
There's no need to run the cmd->done callback for aborted commands. Remove
the old EH code and the RESET_RUN_DONE macro.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/atari_NCR5380.c')
-rw-r--r-- | drivers/scsi/atari_NCR5380.c | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index f1f9f4794527..bdaaa86a77b9 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c | |||
@@ -2876,9 +2876,6 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) | |||
2876 | struct NCR5380_hostdata *hostdata = shost_priv(instance); | 2876 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
2877 | int i; | 2877 | int i; |
2878 | unsigned long flags; | 2878 | unsigned long flags; |
2879 | #if defined(RESET_RUN_DONE) | ||
2880 | struct scsi_cmnd *connected, *disconnected_queue; | ||
2881 | #endif | ||
2882 | 2879 | ||
2883 | NCR5380_print_status(instance); | 2880 | NCR5380_print_status(instance); |
2884 | 2881 | ||
@@ -2897,89 +2894,6 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) | |||
2897 | * through anymore ... */ | 2894 | * through anymore ... */ |
2898 | (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 2895 | (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
2899 | 2896 | ||
2900 | /* MSch 20140115 - looking at the generic NCR5380 driver, all of this | ||
2901 | * should go. | ||
2902 | * Catch-22: if we don't clear all queues, the SCSI driver lock will | ||
2903 | * not be reset by atari_scsi_reset()! | ||
2904 | */ | ||
2905 | |||
2906 | #if defined(RESET_RUN_DONE) | ||
2907 | /* XXX Should now be done by midlevel code, but it's broken XXX */ | ||
2908 | /* XXX see below XXX */ | ||
2909 | |||
2910 | /* MSch: old-style reset: actually abort all command processing here */ | ||
2911 | |||
2912 | /* After the reset, there are no more connected or disconnected commands | ||
2913 | * and no busy units; to avoid problems with re-inserting the commands | ||
2914 | * into the issue_queue (via scsi_done()), the aborted commands are | ||
2915 | * remembered in local variables first. | ||
2916 | */ | ||
2917 | local_irq_save(flags); | ||
2918 | connected = (struct scsi_cmnd *)hostdata->connected; | ||
2919 | hostdata->connected = NULL; | ||
2920 | disconnected_queue = (struct scsi_cmnd *)hostdata->disconnected_queue; | ||
2921 | hostdata->disconnected_queue = NULL; | ||
2922 | #ifdef SUPPORT_TAGS | ||
2923 | free_all_tags(); | ||
2924 | #endif | ||
2925 | for (i = 0; i < 8; ++i) | ||
2926 | hostdata->busy[i] = 0; | ||
2927 | #ifdef REAL_DMA | ||
2928 | hostdata->dma_len = 0; | ||
2929 | #endif | ||
2930 | local_irq_restore(flags); | ||
2931 | |||
2932 | /* In order to tell the mid-level code which commands were aborted, | ||
2933 | * set the command status to DID_RESET and call scsi_done() !!! | ||
2934 | * This ultimately aborts processing of these commands in the mid-level. | ||
2935 | */ | ||
2936 | |||
2937 | if ((cmd = connected)) { | ||
2938 | dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd)); | ||
2939 | cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); | ||
2940 | cmd->scsi_done(cmd); | ||
2941 | } | ||
2942 | |||
2943 | for (i = 0; (cmd = disconnected_queue); ++i) { | ||
2944 | disconnected_queue = NEXT(cmd); | ||
2945 | SET_NEXT(cmd, NULL); | ||
2946 | cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); | ||
2947 | cmd->scsi_done(cmd); | ||
2948 | } | ||
2949 | if (i > 0) | ||
2950 | dprintk(NDEBUG_ABORT, "scsi: reset aborted %d disconnected command(s)\n", i); | ||
2951 | |||
2952 | /* The Falcon lock should be released after a reset... | ||
2953 | */ | ||
2954 | /* ++guenther: moved to atari_scsi_reset(), to prevent a race between | ||
2955 | * unlocking and enabling dma interrupt. | ||
2956 | */ | ||
2957 | /* falcon_release_lock_if_possible( hostdata );*/ | ||
2958 | |||
2959 | /* since all commands have been explicitly terminated, we need to tell | ||
2960 | * the midlevel code that the reset was SUCCESSFUL, and there is no | ||
2961 | * need to 'wake up' the commands by a request_sense | ||
2962 | */ | ||
2963 | return SUCCESS; | ||
2964 | #else /* 1 */ | ||
2965 | |||
2966 | /* MSch: new-style reset handling: let the mid-level do what it can */ | ||
2967 | |||
2968 | /* ++guenther: MID-LEVEL IS STILL BROKEN. | ||
2969 | * Mid-level is supposed to requeue all commands that were active on the | ||
2970 | * various low-level queues. In fact it does this, but that's not enough | ||
2971 | * because all these commands are subject to timeout. And if a timeout | ||
2972 | * happens for any removed command, *_abort() is called but all queues | ||
2973 | * are now empty. Abort then gives up the falcon lock, which is fatal, | ||
2974 | * since the mid-level will queue more commands and must have the lock | ||
2975 | * (it's all happening inside timer interrupt handler!!). | ||
2976 | * Even worse, abort will return NOT_RUNNING for all those commands not | ||
2977 | * on any queue, so they won't be retried ... | ||
2978 | * | ||
2979 | * Conclusion: either scsi.c disables timeout for all resetted commands | ||
2980 | * immediately, or we lose! As of linux-2.0.20 it doesn't. | ||
2981 | */ | ||
2982 | |||
2983 | /* After the reset, there are no more connected or disconnected commands | 2897 | /* After the reset, there are no more connected or disconnected commands |
2984 | * and no busy units; so clear the low-level status here to avoid | 2898 | * and no busy units; so clear the low-level status here to avoid |
2985 | * conflicts when the mid-level code tries to wake up the affected | 2899 | * conflicts when the mid-level code tries to wake up the affected |
@@ -3009,7 +2923,5 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) | |||
3009 | maybe_release_dma_irq(instance); | 2923 | maybe_release_dma_irq(instance); |
3010 | local_irq_restore(flags); | 2924 | local_irq_restore(flags); |
3011 | 2925 | ||
3012 | /* we did no complete reset of all commands, so a wakeup is required */ | ||
3013 | return SUCCESS; | 2926 | return SUCCESS; |
3014 | #endif /* 1 */ | ||
3015 | } | 2927 | } |