提交 335a1cc9 编写于 作者: A Andrew Vasquez 提交者: James Bottomley

[SCSI] qla2xxx: Correct ISP24xx soft-reset handling.

A driver must wait 100us before attempting an MMIO operation
to the RISC after a soft-reset has been initiated.  A
similar delay was needed with earlier ISPs.

Note: a PCI config-space read is used to flush the MMIO
write to the ISP, since the ISP's state machines are unable
to respond to any MMIO read during the reset process.
Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 8d5708f3
...@@ -970,7 +970,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) ...@@ -970,7 +970,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
int rval; int rval;
uint32_t cnt, timer; uint32_t cnt, timer;
uint32_t risc_address; uint32_t risc_address;
uint16_t mb[4]; uint16_t mb[4], wd;
uint32_t stat; uint32_t stat;
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 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,10 +1514,10 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
WRT_REG_DWORD(&reg->ctrl_status, WRT_REG_DWORD(&reg->ctrl_status,
CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES);
RD_REG_DWORD(&reg->ctrl_status); pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
udelay(100);
/* Wait for firmware to complete NVRAM accesses. */ /* Wait for firmware to complete NVRAM accesses. */
udelay(5);
mb[0] = (uint32_t) RD_REG_WORD(&reg->mailbox0); mb[0] = (uint32_t) RD_REG_WORD(&reg->mailbox0);
for (cnt = 10000 ; cnt && mb[0]; cnt--) { for (cnt = 10000 ; cnt && mb[0]; cnt--) {
udelay(5); udelay(5);
...@@ -1525,7 +1525,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) ...@@ -1525,7 +1525,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
barrier(); barrier();
} }
udelay(20); /* Wait for soft-reset to complete. */
for (cnt = 0; cnt < 30000; cnt++) { for (cnt = 0; cnt < 30000; cnt++) {
if ((RD_REG_DWORD(&reg->ctrl_status) & if ((RD_REG_DWORD(&reg->ctrl_status) &
CSRX_ISP_SOFT_RESET) == 0) CSRX_ISP_SOFT_RESET) == 0)
......
...@@ -567,6 +567,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) ...@@ -567,6 +567,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
unsigned long flags = 0; unsigned long flags = 0;
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
uint32_t cnt, d2; uint32_t cnt, d2;
uint16_t wd;
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
...@@ -581,10 +582,10 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) ...@@ -581,10 +582,10 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
WRT_REG_DWORD(&reg->ctrl_status, WRT_REG_DWORD(&reg->ctrl_status,
CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES);
RD_REG_DWORD(&reg->ctrl_status); pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
udelay(100);
/* Wait for firmware to complete NVRAM accesses. */ /* Wait for firmware to complete NVRAM accesses. */
udelay(5);
d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0); d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0);
for (cnt = 10000 ; cnt && d2; cnt--) { for (cnt = 10000 ; cnt && d2; cnt--) {
udelay(5); udelay(5);
...@@ -592,7 +593,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) ...@@ -592,7 +593,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
barrier(); barrier();
} }
udelay(20); /* Wait for soft-reset to complete. */
d2 = RD_REG_DWORD(&reg->ctrl_status); d2 = RD_REG_DWORD(&reg->ctrl_status);
for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) { for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) {
udelay(5); udelay(5);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册