aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h10
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c6
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c15
3 files changed, 19 insertions, 12 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index ce0d88bbaa06..79d8a914f9d0 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2498,17 +2498,9 @@ typedef struct scsi_qla_host {
2498 */ 2498 */
2499#define LOOP_TRANSITION(ha) \ 2499#define LOOP_TRANSITION(ha) \
2500 (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ 2500 (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \
2501 test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) 2501 test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \
2502
2503#define LOOP_NOT_READY(ha) \
2504 ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \
2505 test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) || \
2506 test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \
2507 test_bit(LOOP_RESYNC_ACTIVE, &ha->dpc_flags)) || \
2508 atomic_read(&ha->loop_state) == LOOP_DOWN) 2502 atomic_read(&ha->loop_state) == LOOP_DOWN)
2509 2503
2510#define LOOP_RDY(ha) (!LOOP_NOT_READY(ha))
2511
2512#define TGT_Q(ha, t) (ha->otgt[t]) 2504#define TGT_Q(ha, t) (ha->otgt[t])
2513 2505
2514#define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata) 2506#define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index dadc91bd0ea9..7d973bd9022b 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1258,7 +1258,7 @@ qla2x00_configure_hba(scsi_qla_host_t *ha)
1258 rval = qla2x00_get_adapter_id(ha, 1258 rval = qla2x00_get_adapter_id(ha,
1259 &loop_id, &al_pa, &area, &domain, &topo); 1259 &loop_id, &al_pa, &area, &domain, &topo);
1260 if (rval != QLA_SUCCESS) { 1260 if (rval != QLA_SUCCESS) {
1261 if (LOOP_NOT_READY(ha) || atomic_read(&ha->loop_down_timer) || 1261 if (LOOP_TRANSITION(ha) || atomic_read(&ha->loop_down_timer) ||
1262 (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) { 1262 (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) {
1263 DEBUG2(printk("%s(%ld) Loop is in a transition state\n", 1263 DEBUG2(printk("%s(%ld) Loop is in a transition state\n",
1264 __func__, ha->host_no)); 1264 __func__, ha->host_no));
@@ -1795,7 +1795,7 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
1795 } 1795 }
1796 1796
1797 if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) { 1797 if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) {
1798 if (LOOP_NOT_READY(ha)) { 1798 if (LOOP_TRANSITION(ha)) {
1799 rval = QLA_FUNCTION_FAILED; 1799 rval = QLA_FUNCTION_FAILED;
1800 } else { 1800 } else {
1801 rval = qla2x00_configure_fabric(ha); 1801 rval = qla2x00_configure_fabric(ha);
@@ -2368,7 +2368,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
2368 if (qla2x00_is_reserved_id(ha, loop_id)) 2368 if (qla2x00_is_reserved_id(ha, loop_id))
2369 continue; 2369 continue;
2370 2370
2371 if (atomic_read(&ha->loop_down_timer) || LOOP_NOT_READY(ha)) 2371 if (atomic_read(&ha->loop_down_timer) || LOOP_TRANSITION(ha))
2372 break; 2372 break;
2373 2373
2374 if (swl != NULL) { 2374 if (swl != NULL) {
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 09afc0f06bd4..5181d966fecb 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -909,6 +909,21 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
909 resid = resid_len; 909 resid = resid_len;
910 cp->resid = resid; 910 cp->resid = resid;
911 CMD_RESID_LEN(cp) = resid; 911 CMD_RESID_LEN(cp) = resid;
912
913 if (!lscsi_status &&
914 ((unsigned)(cp->request_bufflen - resid) <
915 cp->underflow)) {
916 qla_printk(KERN_INFO, ha,
917 "scsi(%ld:%d:%d:%d): Mid-layer underflow "
918 "detected (%x of %x bytes)...returning "
919 "error status.\n", ha->host_no,
920 cp->device->channel, cp->device->id,
921 cp->device->lun, resid,
922 cp->request_bufflen);
923
924 cp->result = DID_ERROR << 16;
925 break;
926 }
912 } 927 }
913 cp->result = DID_OK << 16 | lscsi_status; 928 cp->result = DID_OK << 16 | lscsi_status;
914 929