Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173623
b: refs/heads/master
c: 42a6a91
h: refs/heads/master
i:
  173621: ddc7064
  173619: f469b89
  173615: 45dad5a
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Dec 4, 2009
1 parent 5524216 commit e262551
Show file tree
Hide file tree
Showing 2 changed files with 27 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: e881a172dac4d9ea3b2a1540041d872963c269bd
refs/heads/master: 42a6a91833f1e0f5ee5b5ef98e9f00167b615f46
27 changes: 26 additions & 1 deletion trunk/drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,28 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
}
}

static void scsi_handle_queue_full(struct scsi_device *sdev)
{
struct scsi_host_template *sht = sdev->host->hostt;
struct scsi_device *tmp_sdev;

if (!sht->change_queue_depth)
return;

shost_for_each_device(tmp_sdev, sdev->host) {
if (tmp_sdev->channel != sdev->channel ||
tmp_sdev->id != sdev->id)
continue;
/*
* We do not know the number of commands that were at
* the device when we got the queue full so we start
* from the highest possible value and work our way down.
*/
sht->change_queue_depth(tmp_sdev, tmp_sdev->queue_depth - 1,
SCSI_QDEPTH_QFULL);
}
}

/**
* scsi_eh_completed_normally - Disposition a eh cmd on return from LLD.
* @scmd: SCSI cmd to examine.
Expand Down Expand Up @@ -387,8 +409,10 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd)
* let issuer deal with this, it could be just fine
*/
return SUCCESS;
case BUSY:
case QUEUE_FULL:
scsi_handle_queue_full(scmd->device);
/* fall through */
case BUSY:
default:
return FAILED;
}
Expand Down Expand Up @@ -1387,6 +1411,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
*/
switch (status_byte(scmd->result)) {
case QUEUE_FULL:
scsi_handle_queue_full(scmd->device);
/*
* the case of trying to send too many commands to a
* tagged queueing device.
Expand Down

0 comments on commit e262551

Please sign in to comment.