aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
authorMadhuranath Iyengar <madhuranath.iyengar@qlogic.com>2010-09-03 18:20:54 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-09-05 14:35:01 -0400
commitb1d46989c12ec4d93f274ca8378bb1a6014d244a (patch)
tree3bcae91b1470f09add485e7fcfa5a149d206e29d /drivers/scsi/qla2xxx/qla_init.c
parentbddd2d65a48c492d3e585e65df0be89c58b4acda (diff)
[SCSI] qla2xxx: Handle MPI timeout indicated by AE8002
In case the MPI times out, the FW issues an async event AE8002 to indicate this to every FCoE function. The FC/FCoE driver is required to handle this, by doing a soft reset and issuing a Write MPI register mailbox command to reset the MPI. Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index f2da5c5dacdd..c2d7bb8cd53f 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -944,6 +944,19 @@ qla2x00_reset_chip(scsi_qla_host_t *vha)
944} 944}
945 945
946/** 946/**
947 * qla81xx_reset_mpi() - Reset's MPI FW via Write MPI Register MBC.
948 *
949 * Returns 0 on success.
950 */
951int
952qla81xx_reset_mpi(scsi_qla_host_t *vha)
953{
954 uint16_t mb[4] = {0x1010, 0, 1, 0};
955
956 return qla81xx_write_mpi_register(vha, mb);
957}
958
959/**
947 * qla24xx_reset_risc() - Perform full reset of ISP24xx RISC. 960 * qla24xx_reset_risc() - Perform full reset of ISP24xx RISC.
948 * @ha: HA context 961 * @ha: HA context
949 * 962 *
@@ -957,6 +970,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha)
957 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 970 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
958 uint32_t cnt, d2; 971 uint32_t cnt, d2;
959 uint16_t wd; 972 uint16_t wd;
973 static int abts_cnt; /* ISP abort retry counts */
960 974
961 spin_lock_irqsave(&ha->hardware_lock, flags); 975 spin_lock_irqsave(&ha->hardware_lock, flags);
962 976
@@ -990,6 +1004,23 @@ qla24xx_reset_risc(scsi_qla_host_t *vha)
990 barrier(); 1004 barrier();
991 } 1005 }
992 1006
1007 /* If required, do an MPI FW reset now */
1008 if (test_and_clear_bit(MPI_RESET_NEEDED, &vha->dpc_flags)) {
1009 if (qla81xx_reset_mpi(vha) != QLA_SUCCESS) {
1010 if (++abts_cnt < 5) {
1011 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
1012 set_bit(MPI_RESET_NEEDED, &vha->dpc_flags);
1013 } else {
1014 /*
1015 * We exhausted the ISP abort retries. We have to
1016 * set the board offline.
1017 */
1018 abts_cnt = 0;
1019 vha->flags.online = 0;
1020 }
1021 }
1022 }
1023
993 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_RISC_RESET); 1024 WRT_REG_DWORD(&reg->hccr, HCCRX_SET_RISC_RESET);
994 RD_REG_DWORD(&reg->hccr); 1025 RD_REG_DWORD(&reg->hccr);
995 1026