aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorGiridhar Malavali <giridhar.malavali@qlogic.com>2011-08-16 14:31:54 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-08-29 03:14:57 -0400
commit3173167f015b779e549e1be04707316cce1b57f1 (patch)
tree36c87222aaa7d50b75edfdff3ba7a4904b871e31 /drivers/scsi
parentb668ae37f10e5cefe65303150867e3fa2e631b93 (diff)
[SCSI] qla2xxx: Issue mailbox command only when firmware hung bit is reset for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c26
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c74
3 files changed, 56 insertions, 45 deletions
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index e1aebae553a9..ce32d8135c9e 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -574,6 +574,7 @@ extern int qla82xx_mbx_intr_enable(scsi_qla_host_t *);
574extern int qla82xx_mbx_intr_disable(scsi_qla_host_t *); 574extern int qla82xx_mbx_intr_disable(scsi_qla_host_t *);
575extern void qla82xx_start_iocbs(srb_t *); 575extern void qla82xx_start_iocbs(srb_t *);
576extern int qla82xx_fcoe_ctx_reset(scsi_qla_host_t *); 576extern int qla82xx_fcoe_ctx_reset(scsi_qla_host_t *);
577extern int qla82xx_check_md_needed(scsi_qla_host_t *);
577extern void qla82xx_chip_reset_cleanup(scsi_qla_host_t *); 578extern void qla82xx_chip_reset_cleanup(scsi_qla_host_t *);
578extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int); 579extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int);
579extern char *qdev_state(uint32_t); 580extern char *qdev_state(uint32_t);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 2375e38964e9..f03e915f1877 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1480,13 +1480,19 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
1480 if (rval == QLA_SUCCESS) { 1480 if (rval == QLA_SUCCESS) {
1481enable_82xx_npiv: 1481enable_82xx_npiv:
1482 fw_major_version = ha->fw_major_version; 1482 fw_major_version = ha->fw_major_version;
1483 rval = qla2x00_get_fw_version(vha, 1483 if (IS_QLA82XX(ha))
1484 &ha->fw_major_version, 1484 qla82xx_check_md_needed(vha);
1485 &ha->fw_minor_version, 1485 else {
1486 &ha->fw_subminor_version, 1486 rval = qla2x00_get_fw_version(vha,
1487 &ha->fw_attributes, &ha->fw_memory_size, 1487 &ha->fw_major_version,
1488 ha->mpi_version, &ha->mpi_capabilities, 1488 &ha->fw_minor_version,
1489 ha->phy_version); 1489 &ha->fw_subminor_version,
1490 &ha->fw_attributes,
1491 &ha->fw_memory_size,
1492 ha->mpi_version,
1493 &ha->mpi_capabilities,
1494 ha->phy_version);
1495 }
1490 if (rval != QLA_SUCCESS) 1496 if (rval != QLA_SUCCESS)
1491 goto failed; 1497 goto failed;
1492 ha->flags.npiv_supported = 0; 1498 ha->flags.npiv_supported = 0;
@@ -5441,11 +5447,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha)
5441 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); 5447 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
5442 5448
5443 /* Update the firmware version */ 5449 /* Update the firmware version */
5444 qla2x00_get_fw_version(vha, &ha->fw_major_version, 5450 status = qla82xx_check_md_needed(vha);
5445 &ha->fw_minor_version, &ha->fw_subminor_version,
5446 &ha->fw_attributes, &ha->fw_memory_size,
5447 ha->mpi_version, &ha->mpi_capabilities,
5448 ha->phy_version);
5449 5451
5450 if (ha->fce) { 5452 if (ha->fce) {
5451 ha->flags.fce_enabled = 1; 5453 ha->flags.fce_enabled = 1;
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index e5ae84c9598c..77fde8b13447 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -3619,44 +3619,52 @@ qla82xx_need_reset_handler(scsi_qla_host_t *vha)
3619 } 3619 }
3620} 3620}
3621 3621
3622static void 3622int
3623qla82xx_check_md_needed(scsi_qla_host_t *vha) 3623qla82xx_check_md_needed(scsi_qla_host_t *vha)
3624{ 3624{
3625 struct qla_hw_data *ha = vha->hw; 3625 struct qla_hw_data *ha = vha->hw;
3626 uint16_t fw_major_version, fw_minor_version, fw_subminor_version; 3626 uint16_t fw_major_version, fw_minor_version, fw_subminor_version;
3627 uint16_t fw_attributes; 3627 int rval = QLA_SUCCESS;
3628 uint32_t fw_memory_size, mpi_capabilities; 3628
3629 uint8_t mpi_version[3], phy_version[3]; 3629 fw_major_version = ha->fw_major_version;
3630 3630 fw_minor_version = ha->fw_minor_version;
3631 if (!ha->fw_dumped) { 3631 fw_subminor_version = ha->fw_subminor_version;
3632 qla2x00_get_fw_version(vha, 3632
3633 &fw_major_version, 3633 rval = qla2x00_get_fw_version(vha, &ha->fw_major_version,
3634 &fw_minor_version, 3634 &ha->fw_minor_version, &ha->fw_subminor_version,
3635 &fw_subminor_version, 3635 &ha->fw_attributes, &ha->fw_memory_size,
3636 &fw_attributes, &fw_memory_size, 3636 ha->mpi_version, &ha->mpi_capabilities,
3637 mpi_version, &mpi_capabilities, 3637 ha->phy_version);
3638 phy_version); 3638
3639 3639 if (rval != QLA_SUCCESS)
3640 if (fw_major_version != ha->fw_major_version || 3640 return rval;
3641 fw_minor_version != ha->fw_minor_version || 3641
3642 fw_subminor_version != ha->fw_subminor_version) { 3642 if (ql2xmdenable) {
3643 ql_log(ql_log_info, vha, 0xb02d, 3643 if (!ha->fw_dumped) {
3644 "Firmware version differs " 3644 if (fw_major_version != ha->fw_major_version ||
3645 "Previous version: %d:%d:%d - " 3645 fw_minor_version != ha->fw_minor_version ||
3646 "New version: %d:%d:%d\n", 3646 fw_subminor_version != ha->fw_subminor_version) {
3647 ha->fw_major_version, 3647
3648 ha->fw_minor_version, ha->fw_subminor_version, 3648 ql_log(ql_log_info, vha, 0xb02d,
3649 fw_major_version, fw_minor_version, 3649 "Firmware version differs "
3650 fw_subminor_version); 3650 "Previous version: %d:%d:%d - "
3651 /* Release MiniDump resources */ 3651 "New version: %d:%d:%d\n",
3652 qla82xx_md_free(vha); 3652 ha->fw_major_version,
3653 /* ALlocate MiniDump resources */ 3653 ha->fw_minor_version,
3654 qla82xx_md_prep(vha); 3654 ha->fw_subminor_version,
3655 fw_major_version, fw_minor_version,
3656 fw_subminor_version);
3657 /* Release MiniDump resources */
3658 qla82xx_md_free(vha);
3659 /* ALlocate MiniDump resources */
3660 qla82xx_md_prep(vha);
3661 } else
3662 ql_log(ql_log_info, vha, 0xb02e,
3663 "Firmware dump available to retrieve\n",
3664 vha->host_no);
3655 } 3665 }
3656 } else 3666 }
3657 ql_log(ql_log_info, vha, 0xb02e, 3667 return rval;
3658 "Firmware dump available to retrieve\n",
3659 vha->host_no);
3660} 3668}
3661 3669
3662 3670