summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_isr.c
diff options
context:
space:
mode:
authorDavid C Somayajulu2008-03-19 19:23:03 +0100
committerJames Bottomley2008-04-07 19:19:00 +0200
commit9d56291366cd6ab156be722e42cf487bef20f5fd (patch)
treed85fadb003a7ed4a3ac8380487423a2b6ce31bb2 /drivers/scsi/qla4xxx/ql4_isr.c
parent[SCSI] megaraid_sas: Add the new controller(1078DE) support to the driver (diff)
downloadkernel-qcow2-linux-9d56291366cd6ab156be722e42cf487bef20f5fd.tar.gz
kernel-qcow2-linux-9d56291366cd6ab156be722e42cf487bef20f5fd.tar.xz
kernel-qcow2-linux-9d56291366cd6ab156be722e42cf487bef20f5fd.zip
[SCSI] qla4xxx: fix scsi command completion, lun reset and target reset code
This patch contains the following: 1. when hba completion status is good, check for iscsi transport errors (underflow/overflow) prior to checking the scsi status 2. New firmware requires that one marker iocb be issued for each task management command. The patch issues marker iocb immediately following a LUN or Target reset. Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_isr.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_isr.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index fc84db4069f4..a91a57c57bff 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -11,28 +11,6 @@
#include "ql4_inline.h"
/**
- * qla2x00_process_completed_request() - Process a Fast Post response.
- * @ha: SCSI driver HA context
- * @index: SRB index
- **/
-static void qla4xxx_process_completed_request(struct scsi_qla_host *ha,
- uint32_t index)
-{
- struct srb *srb;
-
- srb = qla4xxx_del_from_active_array(ha, index);
- if (srb) {
- /* Save ISP completion status */
- srb->cmd->result = DID_OK << 16;
- qla4xxx_srb_compl(ha, srb);
- } else {
- DEBUG2(printk("scsi%ld: Invalid ISP SCSI completion handle = "
- "%d\n", ha->host_no, index));
- set_bit(DPC_RESET_HA, &ha->dpc_flags);
- }
-}
-
-/**
* qla4xxx_status_entry - processes status IOCBs
* @ha: Pointer to host adapter structure.
* @sts_entry: Pointer to status entry structure.
@@ -47,14 +25,6 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
uint32_t residual;
uint16_t sensebytecnt;
- if (sts_entry->completionStatus == SCS_COMPLETE &&
- sts_entry->scsiStatus == 0) {
- qla4xxx_process_completed_request(ha,
- le32_to_cpu(sts_entry->
- handle));
- return;
- }
-
srb = qla4xxx_del_from_active_array(ha, le32_to_cpu(sts_entry->handle));
if (!srb) {
/* FIXMEdg: Don't we need to reset ISP in this case??? */
@@ -62,6 +32,9 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
"handle 0x%x, sp=%p. This cmd may have already "
"been completed.\n", ha->host_no, __func__,
le32_to_cpu(sts_entry->handle), srb));
+ dev_warn(&ha->pdev->dev, "%s invalid status entry:"
+ " handle=0x%0x\n", __func__, sts_entry->handle);
+ set_bit(DPC_RESET_HA, &ha->dpc_flags);
return;
}
@@ -88,10 +61,6 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
scsi_status = sts_entry->scsiStatus;
switch (sts_entry->completionStatus) {
case SCS_COMPLETE:
- if (scsi_status == 0) {
- cmd->result = DID_OK << 16;
- break;
- }
if (sts_entry->iscsiFlags & ISCSI_FLAG_RESIDUAL_OVER) {
cmd->result = DID_ERROR << 16;
@@ -100,7 +69,8 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
if (sts_entry->iscsiFlags &ISCSI_FLAG_RESIDUAL_UNDER) {
scsi_set_resid(cmd, residual);
- if ((scsi_bufflen(cmd) - residual) < cmd->underflow) {
+ if (!scsi_status && ((scsi_bufflen(cmd) - residual) <
+ cmd->underflow)) {
cmd->result = DID_ERROR << 16;