Commit ab93afac authored by Finn Thain's avatar Finn Thain Committed by Christoph Hellwig

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: default avatarFinn Thain <[email protected]>
Reviewed-by: Hannes Reinecke's avatarHannes Reinecke <[email protected]>
Tested-by: default avatarMichael Schmitz <[email protected]>
Signed-off-by: default avatarChristoph Hellwig <[email protected]>
parent a53a21e4
......@@ -2876,9 +2876,6 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
struct NCR5380_hostdata *hostdata = shost_priv(instance);
int i;
unsigned long flags;
#if defined(RESET_RUN_DONE)
struct scsi_cmnd *connected, *disconnected_queue;
......@@ -2897,89 +2894,6 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
* through anymore ... */
/* MSch 20140115 - looking at the generic NCR5380 driver, all of this
* should go.
* Catch-22: if we don't clear all queues, the SCSI driver lock will
* not be reset by atari_scsi_reset()!
#if defined(RESET_RUN_DONE)
/* XXX Should now be done by midlevel code, but it's broken XXX */
/* XXX see below XXX */
/* MSch: old-style reset: actually abort all command processing here */
/* After the reset, there are no more connected or disconnected commands
* and no busy units; to avoid problems with re-inserting the commands
* into the issue_queue (via scsi_done()), the aborted commands are
* remembered in local variables first.
connected = (struct scsi_cmnd *)hostdata->connected;
hostdata->connected = NULL;
disconnected_queue = (struct scsi_cmnd *)hostdata->disconnected_queue;
hostdata->disconnected_queue = NULL;
for (i = 0; i < 8; ++i)
hostdata->busy[i] = 0;
#ifdef REAL_DMA
hostdata->dma_len = 0;
/* In order to tell the mid-level code which commands were aborted,
* set the command status to DID_RESET and call scsi_done() !!!
* This ultimately aborts processing of these commands in the mid-level.
if ((cmd = connected)) {
dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd));
cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
for (i = 0; (cmd = disconnected_queue); ++i) {
disconnected_queue = NEXT(cmd);
cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
if (i > 0)
dprintk(NDEBUG_ABORT, "scsi: reset aborted %d disconnected command(s)\n", i);
/* The Falcon lock should be released after a reset...
/* ++guenther: moved to atari_scsi_reset(), to prevent a race between
* unlocking and enabling dma interrupt.
/* falcon_release_lock_if_possible( hostdata );*/
/* since all commands have been explicitly terminated, we need to tell
* the midlevel code that the reset was SUCCESSFUL, and there is no
* need to 'wake up' the commands by a request_sense
return SUCCESS;
#else /* 1 */
/* MSch: new-style reset handling: let the mid-level do what it can */
* Mid-level is supposed to requeue all commands that were active on the
* various low-level queues. In fact it does this, but that's not enough
* because all these commands are subject to timeout. And if a timeout
* happens for any removed command, *_abort() is called but all queues
* are now empty. Abort then gives up the falcon lock, which is fatal,
* since the mid-level will queue more commands and must have the lock
* (it's all happening inside timer interrupt handler!!).
* Even worse, abort will return NOT_RUNNING for all those commands not
* on any queue, so they won't be retried ...
* Conclusion: either scsi.c disables timeout for all resetted commands
* immediately, or we lose! As of linux-2.0.20 it doesn't.
/* After the reset, there are no more connected or disconnected commands
* and no busy units; so clear the low-level status here to avoid
* 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)
/* we did no complete reset of all commands, so a wakeup is required */
return SUCCESS;
#endif /* 1 */
......@@ -39,7 +39,6 @@
/* Definitions for the core NCR5380 driver. */
#define REAL_DMA
/* #define SUPPORT_TAGS */
/* minimum number of bytes to do dma on */
#define DMA_MIN_SIZE 129
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment