Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25802
b: refs/heads/master
c: ab19d52
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Wilcox authored and James Bottomley committed Apr 13, 2006
1 parent 6952b0c commit 279cb32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 43 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b6d105d7ee188040a6e5eb86101e7476d94b3076
refs/heads/master: ab19d52bec6c1b266228417b58ae6f36f3ea097c
50 changes: 8 additions & 42 deletions trunk/drivers/scsi/sym53c8xx_2/sym_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ static void sym53c8xx_timer(unsigned long npref)
* What we will do regarding the involved SCSI command.
*/
#define SYM_EH_DO_IGNORE 0
#define SYM_EH_DO_COMPLETE 1
#define SYM_EH_DO_WAIT 2

/*
Expand Down Expand Up @@ -764,25 +763,18 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)

dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname);

spin_lock_irq(cmd->device->host->host_lock);
/* This one is queued in some place -> to wait for completion */
FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
if (cp->cmd == cmd) {
to_do = SYM_EH_DO_WAIT;
goto prepare;
break;
}
}

prepare:
/* Prepare stuff to either ignore, complete or wait for completion */
switch(to_do) {
default:
case SYM_EH_DO_IGNORE:
break;
case SYM_EH_DO_WAIT:
if (to_do == SYM_EH_DO_WAIT) {
init_completion(&ep->done);
/* fall through */
case SYM_EH_DO_COMPLETE:
ep->old_done = cmd->scsi_done;
cmd->scsi_done = sym_eh_done;
SYM_UCMD_PTR(cmd)->eh_wait = ep;
Expand Down Expand Up @@ -818,9 +810,6 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
}

ep->to_do = to_do;
/* Complete the command with locks held as required by the driver */
if (to_do == SYM_EH_DO_COMPLETE)
sym_xpt_done2(np, cmd, DID_ABORT);

/* Wait for completion with locks released, as required by kernel */
if (to_do == SYM_EH_DO_WAIT) {
Expand All @@ -836,6 +825,7 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
if (ep->timed_out)
sts = -2;
}
spin_unlock_irq(cmd->device->host->host_lock);
dev_warn(&cmd->device->sdev_gendev, "%s operation %s.\n", opname,
sts==0 ? "complete" :sts==-2 ? "timed-out" : "failed");
return sts ? SCSI_FAILED : SCSI_SUCCESS;
Expand All @@ -847,46 +837,22 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
*/
static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd)
{
int rc;

spin_lock_irq(cmd->device->host->host_lock);
rc = sym_eh_handler(SYM_EH_ABORT, "ABORT", cmd);
spin_unlock_irq(cmd->device->host->host_lock);

return rc;
return sym_eh_handler(SYM_EH_ABORT, "ABORT", cmd);
}

static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd)
{
int rc;

spin_lock_irq(cmd->device->host->host_lock);
rc = sym_eh_handler(SYM_EH_DEVICE_RESET, "DEVICE RESET", cmd);
spin_unlock_irq(cmd->device->host->host_lock);

return rc;
return sym_eh_handler(SYM_EH_DEVICE_RESET, "DEVICE RESET", cmd);
}

static int sym53c8xx_eh_bus_reset_handler(struct scsi_cmnd *cmd)
{
int rc;

spin_lock_irq(cmd->device->host->host_lock);
rc = sym_eh_handler(SYM_EH_BUS_RESET, "BUS RESET", cmd);
spin_unlock_irq(cmd->device->host->host_lock);

return rc;
return sym_eh_handler(SYM_EH_BUS_RESET, "BUS RESET", cmd);
}

static int sym53c8xx_eh_host_reset_handler(struct scsi_cmnd *cmd)
{
int rc;

spin_lock_irq(cmd->device->host->host_lock);
rc = sym_eh_handler(SYM_EH_HOST_RESET, "HOST RESET", cmd);
spin_unlock_irq(cmd->device->host->host_lock);

return rc;
return sym_eh_handler(SYM_EH_HOST_RESET, "HOST RESET", cmd);
}

/*
Expand Down

0 comments on commit 279cb32

Please sign in to comment.