diff options
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 10 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 28 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 15 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 10 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 5 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_version.h | 4 |
7 files changed, 46 insertions, 34 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 89793c1c06b1..5c5d2315cfab 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -970,7 +970,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) | |||
970 | int rval; | 970 | int rval; |
971 | uint32_t cnt, timer; | 971 | uint32_t cnt, timer; |
972 | uint32_t risc_address; | 972 | uint32_t risc_address; |
973 | uint16_t mb[4]; | 973 | uint16_t mb[4], wd; |
974 | 974 | ||
975 | uint32_t stat; | 975 | uint32_t stat; |
976 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; | 976 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; |
@@ -1514,10 +1514,10 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) | |||
1514 | 1514 | ||
1515 | WRT_REG_DWORD(®->ctrl_status, | 1515 | WRT_REG_DWORD(®->ctrl_status, |
1516 | CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); | 1516 | CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); |
1517 | RD_REG_DWORD(®->ctrl_status); | 1517 | pci_read_config_word(ha->pdev, PCI_COMMAND, &wd); |
1518 | 1518 | ||
1519 | udelay(100); | ||
1519 | /* Wait for firmware to complete NVRAM accesses. */ | 1520 | /* Wait for firmware to complete NVRAM accesses. */ |
1520 | udelay(5); | ||
1521 | mb[0] = (uint32_t) RD_REG_WORD(®->mailbox0); | 1521 | mb[0] = (uint32_t) RD_REG_WORD(®->mailbox0); |
1522 | for (cnt = 10000 ; cnt && mb[0]; cnt--) { | 1522 | for (cnt = 10000 ; cnt && mb[0]; cnt--) { |
1523 | udelay(5); | 1523 | udelay(5); |
@@ -1525,7 +1525,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) | |||
1525 | barrier(); | 1525 | barrier(); |
1526 | } | 1526 | } |
1527 | 1527 | ||
1528 | udelay(20); | 1528 | /* Wait for soft-reset to complete. */ |
1529 | for (cnt = 0; cnt < 30000; cnt++) { | 1529 | for (cnt = 0; cnt < 30000; cnt++) { |
1530 | if ((RD_REG_DWORD(®->ctrl_status) & | 1530 | if ((RD_REG_DWORD(®->ctrl_status) & |
1531 | CSRX_ISP_SOFT_RESET) == 0) | 1531 | CSRX_ISP_SOFT_RESET) == 0) |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 7096945ea234..7b3efd531297 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2476,17 +2476,9 @@ typedef struct scsi_qla_host { | |||
2476 | */ | 2476 | */ |
2477 | #define LOOP_TRANSITION(ha) \ | 2477 | #define LOOP_TRANSITION(ha) \ |
2478 | (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ | 2478 | (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ |
2479 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) | 2479 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ |
2480 | |||
2481 | #define LOOP_NOT_READY(ha) \ | ||
2482 | ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ | ||
2483 | test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) || \ | ||
2484 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ | ||
2485 | test_bit(LOOP_RESYNC_ACTIVE, &ha->dpc_flags)) || \ | ||
2486 | atomic_read(&ha->loop_state) == LOOP_DOWN) | 2480 | atomic_read(&ha->loop_state) == LOOP_DOWN) |
2487 | 2481 | ||
2488 | #define LOOP_RDY(ha) (!LOOP_NOT_READY(ha)) | ||
2489 | |||
2490 | #define TGT_Q(ha, t) (ha->otgt[t]) | 2482 | #define TGT_Q(ha, t) (ha->otgt[t]) |
2491 | 2483 | ||
2492 | #define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata) | 2484 | #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 72d9090df3df..c46d2469b85f 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -147,8 +147,8 @@ check_fw_ready_again: | |||
147 | * LIP to complete | 147 | * LIP to complete |
148 | */ | 148 | */ |
149 | 149 | ||
150 | if (atomic_read(&ha->loop_state) == | 150 | if (atomic_read(&ha->loop_state) != |
151 | LOOP_DOWN && retry--) { | 151 | LOOP_READY && retry--) { |
152 | goto check_fw_ready_again; | 152 | goto check_fw_ready_again; |
153 | } | 153 | } |
154 | wait_time--; | 154 | wait_time--; |
@@ -567,6 +567,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) | |||
567 | unsigned long flags = 0; | 567 | unsigned long flags = 0; |
568 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; | 568 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; |
569 | uint32_t cnt, d2; | 569 | uint32_t cnt, d2; |
570 | uint16_t wd; | ||
570 | 571 | ||
571 | spin_lock_irqsave(&ha->hardware_lock, flags); | 572 | spin_lock_irqsave(&ha->hardware_lock, flags); |
572 | 573 | ||
@@ -581,10 +582,10 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) | |||
581 | 582 | ||
582 | WRT_REG_DWORD(®->ctrl_status, | 583 | WRT_REG_DWORD(®->ctrl_status, |
583 | CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); | 584 | CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); |
584 | RD_REG_DWORD(®->ctrl_status); | 585 | pci_read_config_word(ha->pdev, PCI_COMMAND, &wd); |
585 | 586 | ||
587 | udelay(100); | ||
586 | /* Wait for firmware to complete NVRAM accesses. */ | 588 | /* Wait for firmware to complete NVRAM accesses. */ |
587 | udelay(5); | ||
588 | d2 = (uint32_t) RD_REG_WORD(®->mailbox0); | 589 | d2 = (uint32_t) RD_REG_WORD(®->mailbox0); |
589 | for (cnt = 10000 ; cnt && d2; cnt--) { | 590 | for (cnt = 10000 ; cnt && d2; cnt--) { |
590 | udelay(5); | 591 | udelay(5); |
@@ -592,7 +593,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) | |||
592 | barrier(); | 593 | barrier(); |
593 | } | 594 | } |
594 | 595 | ||
595 | udelay(20); | 596 | /* Wait for soft-reset to complete. */ |
596 | d2 = RD_REG_DWORD(®->ctrl_status); | 597 | d2 = RD_REG_DWORD(®->ctrl_status); |
597 | for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) { | 598 | for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) { |
598 | udelay(5); | 599 | udelay(5); |
@@ -1258,9 +1259,15 @@ qla2x00_configure_hba(scsi_qla_host_t *ha) | |||
1258 | rval = qla2x00_get_adapter_id(ha, | 1259 | rval = qla2x00_get_adapter_id(ha, |
1259 | &loop_id, &al_pa, &area, &domain, &topo); | 1260 | &loop_id, &al_pa, &area, &domain, &topo); |
1260 | if (rval != QLA_SUCCESS) { | 1261 | if (rval != QLA_SUCCESS) { |
1261 | qla_printk(KERN_WARNING, ha, | 1262 | if (LOOP_TRANSITION(ha) || atomic_read(&ha->loop_down_timer) || |
1262 | "ERROR -- Unable to get host loop ID.\n"); | 1263 | (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) { |
1263 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); | 1264 | DEBUG2(printk("%s(%ld) Loop is in a transition state\n", |
1265 | __func__, ha->host_no)); | ||
1266 | } else { | ||
1267 | qla_printk(KERN_WARNING, ha, | ||
1268 | "ERROR -- Unable to get host loop ID.\n"); | ||
1269 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); | ||
1270 | } | ||
1264 | return (rval); | 1271 | return (rval); |
1265 | } | 1272 | } |
1266 | 1273 | ||
@@ -1789,7 +1796,7 @@ qla2x00_configure_loop(scsi_qla_host_t *ha) | |||
1789 | } | 1796 | } |
1790 | 1797 | ||
1791 | if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) { | 1798 | if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) { |
1792 | if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) { | 1799 | if (LOOP_TRANSITION(ha)) { |
1793 | rval = QLA_FUNCTION_FAILED; | 1800 | rval = QLA_FUNCTION_FAILED; |
1794 | } else { | 1801 | } else { |
1795 | rval = qla2x00_configure_fabric(ha); | 1802 | rval = qla2x00_configure_fabric(ha); |
@@ -2362,8 +2369,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) | |||
2362 | if (qla2x00_is_reserved_id(ha, loop_id)) | 2369 | if (qla2x00_is_reserved_id(ha, loop_id)) |
2363 | continue; | 2370 | continue; |
2364 | 2371 | ||
2365 | if (atomic_read(&ha->loop_down_timer) || | 2372 | if (atomic_read(&ha->loop_down_timer) || LOOP_TRANSITION(ha)) |
2366 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) | ||
2367 | break; | 2373 | break; |
2368 | 2374 | ||
2369 | if (swl != NULL) { | 2375 | 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 | ||
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index ad3cacb9192d..9746cd1e664b 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -868,10 +868,6 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp) | |||
868 | DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) | 868 | DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) |
869 | 869 | ||
870 | fcport = sp->fcport; | 870 | fcport = sp->fcport; |
871 | if (atomic_read(&ha->loop_state) == LOOP_DOWN || | ||
872 | atomic_read(&fcport->state) == FCS_DEVICE_LOST) { | ||
873 | return 1; | ||
874 | } | ||
875 | 871 | ||
876 | spin_lock_irqsave(&ha->hardware_lock, flags); | 872 | spin_lock_irqsave(&ha->hardware_lock, flags); |
877 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { | 873 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { |
@@ -1008,6 +1004,8 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa, | |||
1008 | mcp->tov = 30; | 1004 | mcp->tov = 30; |
1009 | mcp->flags = 0; | 1005 | mcp->flags = 0; |
1010 | rval = qla2x00_mailbox_command(ha, mcp); | 1006 | rval = qla2x00_mailbox_command(ha, mcp); |
1007 | if (mcp->mb[0] == MBS_COMMAND_ERROR) | ||
1008 | rval = QLA_COMMAND_ERROR; | ||
1011 | 1009 | ||
1012 | /* Return data. */ | 1010 | /* Return data. */ |
1013 | *id = mcp->mb[1]; | 1011 | *id = mcp->mb[1]; |
@@ -2179,10 +2177,6 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp) | |||
2179 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) | 2177 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) |
2180 | 2178 | ||
2181 | fcport = sp->fcport; | 2179 | fcport = sp->fcport; |
2182 | if (atomic_read(&ha->loop_state) == LOOP_DOWN || | ||
2183 | atomic_read(&fcport->state) == FCS_DEVICE_LOST) { | ||
2184 | return QLA_FUNCTION_FAILED; | ||
2185 | } | ||
2186 | 2180 | ||
2187 | spin_lock_irqsave(&ha->hardware_lock, flags); | 2181 | spin_lock_irqsave(&ha->hardware_lock, flags); |
2188 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { | 2182 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { |
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 4bec0b4fb6b4..d54d2a99c3d3 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -126,6 +126,7 @@ qla2x00_write_nvram_word(scsi_qla_host_t *ha, uint32_t addr, uint16_t data) | |||
126 | 126 | ||
127 | /* Wait for NVRAM to become ready */ | 127 | /* Wait for NVRAM to become ready */ |
128 | WRT_REG_WORD(®->nvram, NVR_SELECT); | 128 | WRT_REG_WORD(®->nvram, NVR_SELECT); |
129 | RD_REG_WORD(®->nvram); /* PCI Posting. */ | ||
129 | do { | 130 | do { |
130 | NVRAM_DELAY(); | 131 | NVRAM_DELAY(); |
131 | word = RD_REG_WORD(®->nvram); | 132 | word = RD_REG_WORD(®->nvram); |
@@ -178,6 +179,7 @@ qla2x00_write_nvram_word_tmo(scsi_qla_host_t *ha, uint32_t addr, uint16_t data, | |||
178 | 179 | ||
179 | /* Wait for NVRAM to become ready */ | 180 | /* Wait for NVRAM to become ready */ |
180 | WRT_REG_WORD(®->nvram, NVR_SELECT); | 181 | WRT_REG_WORD(®->nvram, NVR_SELECT); |
182 | RD_REG_WORD(®->nvram); /* PCI Posting. */ | ||
181 | do { | 183 | do { |
182 | NVRAM_DELAY(); | 184 | NVRAM_DELAY(); |
183 | word = RD_REG_WORD(®->nvram); | 185 | word = RD_REG_WORD(®->nvram); |
@@ -235,6 +237,7 @@ qla2x00_nvram_request(scsi_qla_host_t *ha, uint32_t nv_cmd) | |||
235 | /* Read data from NVRAM. */ | 237 | /* Read data from NVRAM. */ |
236 | for (cnt = 0; cnt < 16; cnt++) { | 238 | for (cnt = 0; cnt < 16; cnt++) { |
237 | WRT_REG_WORD(®->nvram, NVR_SELECT | NVR_CLOCK); | 239 | WRT_REG_WORD(®->nvram, NVR_SELECT | NVR_CLOCK); |
240 | RD_REG_WORD(®->nvram); /* PCI Posting. */ | ||
238 | NVRAM_DELAY(); | 241 | NVRAM_DELAY(); |
239 | data <<= 1; | 242 | data <<= 1; |
240 | reg_data = RD_REG_WORD(®->nvram); | 243 | reg_data = RD_REG_WORD(®->nvram); |
@@ -337,6 +340,7 @@ qla2x00_clear_nvram_protection(scsi_qla_host_t *ha) | |||
337 | 340 | ||
338 | /* Wait for NVRAM to become ready. */ | 341 | /* Wait for NVRAM to become ready. */ |
339 | WRT_REG_WORD(®->nvram, NVR_SELECT); | 342 | WRT_REG_WORD(®->nvram, NVR_SELECT); |
343 | RD_REG_WORD(®->nvram); /* PCI Posting. */ | ||
340 | do { | 344 | do { |
341 | NVRAM_DELAY(); | 345 | NVRAM_DELAY(); |
342 | word = RD_REG_WORD(®->nvram); | 346 | word = RD_REG_WORD(®->nvram); |
@@ -388,6 +392,7 @@ qla2x00_set_nvram_protection(scsi_qla_host_t *ha, int stat) | |||
388 | 392 | ||
389 | /* Wait for NVRAM to become ready. */ | 393 | /* Wait for NVRAM to become ready. */ |
390 | WRT_REG_WORD(®->nvram, NVR_SELECT); | 394 | WRT_REG_WORD(®->nvram, NVR_SELECT); |
395 | RD_REG_WORD(®->nvram); /* PCI Posting. */ | ||
391 | do { | 396 | do { |
392 | NVRAM_DELAY(); | 397 | NVRAM_DELAY(); |
393 | word = RD_REG_WORD(®->nvram); | 398 | word = RD_REG_WORD(®->nvram); |
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 0d5472f2f59b..f7937f7f9c68 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h | |||
@@ -7,9 +7,9 @@ | |||
7 | /* | 7 | /* |
8 | * Driver version | 8 | * Driver version |
9 | */ | 9 | */ |
10 | #define QLA2XXX_VERSION "8.01.00-k" | 10 | #define QLA2XXX_VERSION "8.01.03-k" |
11 | 11 | ||
12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
13 | #define QLA_DRIVER_MINOR_VER 1 | 13 | #define QLA_DRIVER_MINOR_VER 1 |
14 | #define QLA_DRIVER_PATCH_VER 0 | 14 | #define QLA_DRIVER_PATCH_VER 3 |
15 | #define QLA_DRIVER_BETA_VER 0 | 15 | #define QLA_DRIVER_BETA_VER 0 |