Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31907
b: refs/heads/master
c: d7a1bb0
h: refs/heads/master
i:
  31905: cdc87da
  31903: 5dc2bc3
v: v3
  • Loading branch information
James Smart authored and James Bottomley committed Jun 27, 2006
1 parent 16dadd9 commit 68f5a6a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 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: 12e9b5fb96028aab26af65bb06d2dee56c428a6e
refs/heads/master: d7a1bb0a04ca835bffc0a91e64ab827dfba7d8f5
22 changes: 22 additions & 0 deletions trunk/drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,9 @@ int
scsi_reset_provider(struct scsi_device *dev, int flag)
{
struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL);
struct Scsi_Host *shost = dev->host;
struct request req;
unsigned long flags;
int rtn;

scmd->request = &req;
Expand All @@ -1699,6 +1701,10 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
*/
scmd->pid = 0;

spin_lock_irqsave(shost->host_lock, flags);
shost->tmf_in_progress = 1;
spin_unlock_irqrestore(shost->host_lock, flags);

switch (flag) {
case SCSI_TRY_RESET_DEVICE:
rtn = scsi_try_bus_device_reset(scmd);
Expand All @@ -1717,6 +1723,22 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
rtn = FAILED;
}

spin_lock_irqsave(shost->host_lock, flags);
shost->tmf_in_progress = 0;
spin_unlock_irqrestore(shost->host_lock, flags);

/*
* be sure to wake up anyone who was sleeping or had their queue
* suspended while we performed the TMF.
*/
SCSI_LOG_ERROR_RECOVERY(3,
printk("%s: waking up host to restart after TMF\n",
__FUNCTION__));

wake_up(&shost->host_wait);

scsi_run_host_queues(shost);

scsi_next_command(scmd);
return rtn;
}
Expand Down
6 changes: 5 additions & 1 deletion trunk/include/scsi/scsi_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,9 @@ struct Scsi_Host {
*/
unsigned ordered_tag:1;

/* task mgmt function in progress */
unsigned tmf_in_progress:1;

/*
* Optional work queue to be utilized by the transport
*/
Expand Down Expand Up @@ -619,7 +622,8 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
{
return shost->shost_state == SHOST_RECOVERY ||
shost->shost_state == SHOST_CANCEL_RECOVERY ||
shost->shost_state == SHOST_DEL_RECOVERY;
shost->shost_state == SHOST_DEL_RECOVERY ||
shost->tmf_in_progress;
}

extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
Expand Down

0 comments on commit 68f5a6a

Please sign in to comment.