aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiridhar Malavali <giridhar.malavali@qlogic.com>2012-05-15 14:34:12 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-22 06:17:28 -0400
commit5988aeb28fa0090520f912c44f5a35cf69de7d70 (patch)
treebd61a731bf0d4dcae064132a2f8c20d0df7dd3b4
parent008dda6650db2c8cd312d86ebe4a6c3a11daecd9 (diff)
[SCSI] qla2xxx: Detect PEG errors.
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>
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c30
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.h13
3 files changed, 43 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 62324a1d5573..ec1b925a19a8 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -20,7 +20,7 @@
20 * | DPC Thread | 0x401c | | 20 * | DPC Thread | 0x401c | |
21 * | Async Events | 0x505d | 0x502b-0x502f | 21 * | Async Events | 0x505d | 0x502b-0x502f |
22 * | | | 0x5047,0x5052 | 22 * | | | 0x5047,0x5052 |
23 * | Timer Routines | 0x6011 | 0x600e-0x600f | 23 * | Timer Routines | 0x6011 | |
24 * | User Space Interactions | 0x709f | 0x7018,0x702e, | 24 * | User Space Interactions | 0x709f | 0x7018,0x702e, |
25 * | | | 0x7039,0x7045, | 25 * | | | 0x7039,0x7045, |
26 * | | | 0x7073-0x7075, | 26 * | | | 0x7073-0x7075, |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 6f8850c38b3e..954e2c211729 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -3325,6 +3325,30 @@ exit:
3325 return rval; 3325 return rval;
3326} 3326}
3327 3327
3328static int qla82xx_check_temp(scsi_qla_host_t *vha)
3329{
3330 uint32_t temp, temp_state, temp_val;
3331 struct qla_hw_data *ha = vha->hw;
3332
3333 temp = qla82xx_rd_32(ha, CRB_TEMP_STATE);
3334 temp_state = qla82xx_get_temp_state(temp);
3335 temp_val = qla82xx_get_temp_val(temp);
3336
3337 if (temp_state == QLA82XX_TEMP_PANIC) {
3338 ql_log(ql_log_warn, vha, 0x600e,
3339 "Device temperature %d degrees C exceeds "
3340 " maximum allowed. Hardware has been shut down.\n",
3341 temp_val);
3342 return 1;
3343 } else if (temp_state == QLA82XX_TEMP_WARN) {
3344 ql_log(ql_log_warn, vha, 0x600f,
3345 "Device temperature %d degrees C exceeds "
3346 "operating range. Immediate action needed.\n",
3347 temp_val);
3348 }
3349 return 0;
3350}
3351
3328void qla82xx_clear_pending_mbx(scsi_qla_host_t *vha) 3352void qla82xx_clear_pending_mbx(scsi_qla_host_t *vha)
3329{ 3353{
3330 struct qla_hw_data *ha = vha->hw; 3354 struct qla_hw_data *ha = vha->hw;
@@ -3347,7 +3371,11 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
3347 /* don't poll if reset is going on */ 3371 /* don't poll if reset is going on */
3348 if (!ha->flags.isp82xx_reset_hdlr_active) { 3372 if (!ha->flags.isp82xx_reset_hdlr_active) {
3349 dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); 3373 dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE);
3350 if (dev_state == QLA82XX_DEV_NEED_RESET && 3374 if (qla82xx_check_temp(vha)) {
3375 set_bit(ISP_UNRECOVERABLE, &vha->dpc_flags);
3376 ha->flags.isp82xx_fw_hung = 1;
3377 qla82xx_clear_pending_mbx(vha);
3378 } else if (dev_state == QLA82XX_DEV_NEED_RESET &&
3351 !test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) { 3379 !test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) {
3352 ql_log(ql_log_warn, vha, 0x6001, 3380 ql_log(ql_log_warn, vha, 0x6001,
3353 "Adapter reset needed.\n"); 3381 "Adapter reset needed.\n");
diff --git a/drivers/scsi/qla2xxx/qla_nx.h b/drivers/scsi/qla2xxx/qla_nx.h
index 4ac50e274661..393319861bd6 100644
--- a/drivers/scsi/qla2xxx/qla_nx.h
+++ b/drivers/scsi/qla2xxx/qla_nx.h
@@ -26,6 +26,7 @@
26#define CRB_RCVPEG_STATE QLA82XX_REG(0x13c) 26#define CRB_RCVPEG_STATE QLA82XX_REG(0x13c)
27#define BOOT_LOADER_DIMM_STATUS QLA82XX_REG(0x54) 27#define BOOT_LOADER_DIMM_STATUS QLA82XX_REG(0x54)
28#define CRB_DMA_SHIFT QLA82XX_REG(0xcc) 28#define CRB_DMA_SHIFT QLA82XX_REG(0xcc)
29#define CRB_TEMP_STATE QLA82XX_REG(0x1b4)
29#define QLA82XX_DMA_SHIFT_VALUE 0x55555555 30#define QLA82XX_DMA_SHIFT_VALUE 0x55555555
30 31
31#define QLA82XX_HW_H0_CH_HUB_ADR 0x05 32#define QLA82XX_HW_H0_CH_HUB_ADR 0x05
@@ -1178,4 +1179,16 @@ static const int MD_MIU_TEST_AGT_RDDATA[] = { 0x410000A8, 0x410000AC,
1178#define CRB_NIU_XG_PAUSE_CTL_P0 0x1 1179#define CRB_NIU_XG_PAUSE_CTL_P0 0x1
1179#define CRB_NIU_XG_PAUSE_CTL_P1 0x8 1180#define CRB_NIU_XG_PAUSE_CTL_P1 0x8
1180 1181
1182#define qla82xx_get_temp_val(x) ((x) >> 16)
1183#define qla82xx_get_temp_state(x) ((x) & 0xffff)
1184#define qla82xx_encode_temp(val, state) (((val) << 16) | (state))
1185
1186/*
1187 * Temperature control.
1188 */
1189enum {
1190 QLA82XX_TEMP_NORMAL = 0x1, /* Normal operating range */
1191 QLA82XX_TEMP_WARN, /* Sound alert, temperature getting high */
1192 QLA82XX_TEMP_PANIC /* Fatal error, hardware has shut down. */
1193};
1181#endif 1194#endif