Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25819
b: refs/heads/master
c: d637c45
h: refs/heads/master
i:
  25817: 4274938
  25815: ba30076
v: v3
  • Loading branch information
Matthew Wilcox authored and James Bottomley committed Apr 13, 2006
1 parent 456f6aa commit e7b64a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: 80286d478c2b0e07959e79cf34591a4061ff1797
refs/heads/master: d637c4543fdc86cbef5805c679d24bb665172a7d
20 changes: 12 additions & 8 deletions trunk/drivers/scsi/sym53c8xx_2/sym_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ static struct scsi_transport_template *sym2_transport_template = NULL;
* Driver private area in the SCSI command structure.
*/
struct sym_ucmd { /* Override the SCSI pointer structure */
struct completion done;
void (*old_done)(struct scsi_cmnd *);
dma_addr_t data_mapping;
int to_do;
u_char data_mapped; /* corresponds to data_mapping above */
dma_addr_t data_mapping;
unsigned char data_mapped;
unsigned char to_do; /* For error handling */
void (*old_done)(struct scsi_cmnd *); /* For error handling */
struct completion *eh_done; /* For error handling */
};

#define SYM_UCMD_PTR(cmd) ((struct sym_ucmd *)(&(cmd)->SCp))
Expand Down Expand Up @@ -713,7 +713,7 @@ static void sym_eh_done(struct scsi_cmnd *cmd)
cmd->scsi_done = ucmd->old_done;

if (ucmd->to_do == SYM_EH_DO_WAIT)
complete(&ucmd->done);
complete(ucmd->eh_done);
}

/*
Expand All @@ -728,6 +728,7 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
SYM_QUEHEAD *qp;
int to_do = SYM_EH_DO_IGNORE;
int sts = -1;
struct completion eh_done;

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

Expand All @@ -742,8 +743,10 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
}

if (to_do == SYM_EH_DO_WAIT) {
init_completion(&ucmd->done);
init_completion(&eh_done);
ucmd->old_done = cmd->scsi_done;
ucmd->eh_done = &eh_done;
wmb();
cmd->scsi_done = sym_eh_done;
}

Expand Down Expand Up @@ -779,8 +782,9 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
spin_unlock_irq(host->host_lock);

if (to_do == SYM_EH_DO_WAIT) {
if (!wait_for_completion_timeout(&ucmd->done, 5*HZ)) {
if (!wait_for_completion_timeout(&eh_done, 5*HZ)) {
ucmd->to_do = SYM_EH_DO_IGNORE;
wmb();
sts = -2;
}
}
Expand Down

0 comments on commit e7b64a4

Please sign in to comment.