diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 28 |
1 files changed, 17 insertions, 11 deletions
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) { |