Skip to content

Commit

Permalink
[SCSI] qla4xxx: Complete the cmd if sense_len is zero
Browse files Browse the repository at this point in the history
Complete the cmd if sense length is zero. For cases where sense
data spans across multiple iocb's by FW, we need to hold on to the
I/O (ha->status_srb != NULL) till we have processed them all and
copied the sense data from internal buffer to scsi_cmd sense buffer.

Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
  • Loading branch information
Prasanna Mumbai authored and James Bottomley committed May 24, 2011
1 parent 68d92eb commit 6d78bd5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/scsi/qla4xxx/ql4_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ static void qla4xxx_copy_sense(struct scsi_qla_host *ha,

memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
sense_len = le16_to_cpu(sts_entry->senseDataByteCnt);
if (sense_len == 0)
if (sense_len == 0) {
DEBUG2(ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%d:%d: %s:"
" sense len 0\n", ha->host_no,
cmd->device->channel, cmd->device->id,
cmd->device->lun, __func__));
ha->status_srb = NULL;
return;

}
/* Save total available sense length,
* not to exceed cmd's sense buffer size */
sense_len = min_t(uint16_t, sense_len, SCSI_SENSE_BUFFERSIZE);
Expand Down

0 comments on commit 6d78bd5

Please sign in to comment.