diff options
author | Sarang Radke <sarang.radke@qlogic.com> | 2011-12-02 01:42:09 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-12-15 01:57:41 -0500 |
commit | 8e0f3a66a2833eaad618584c2bac89a8ae2efce7 (patch) | |
tree | c86cee3cf7f1f042893139f6a0a7c3df71f1f99d | |
parent | 8a288960192591c405767d98ebe372f66df1a6c6 (diff) |
[SCSI] qla4xxx: Don't recover adapter if device state is FAILED
Multiple reset request don't get handled correctly as
the driver tries to recover adapter which is in FAILED state.
Signed-off-by: Sarang Radke <sarang.radke@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index dde539ca4b3d..064d67282f59 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -2414,6 +2414,7 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha) | |||
2414 | { | 2414 | { |
2415 | int status = QLA_ERROR; | 2415 | int status = QLA_ERROR; |
2416 | uint8_t reset_chip = 0; | 2416 | uint8_t reset_chip = 0; |
2417 | uint32_t dev_state; | ||
2417 | 2418 | ||
2418 | /* Stall incoming I/O until we are done */ | 2419 | /* Stall incoming I/O until we are done */ |
2419 | scsi_block_requests(ha->host); | 2420 | scsi_block_requests(ha->host); |
@@ -2501,6 +2502,25 @@ recover_ha_init_adapter: | |||
2501 | * Since we don't want to block the DPC for too long | 2502 | * Since we don't want to block the DPC for too long |
2502 | * with multiple resets in the same thread, | 2503 | * with multiple resets in the same thread, |
2503 | * utilize DPC to retry */ | 2504 | * utilize DPC to retry */ |
2505 | if (is_qla8022(ha)) { | ||
2506 | qla4_8xxx_idc_lock(ha); | ||
2507 | dev_state = qla4_8xxx_rd_32(ha, QLA82XX_CRB_DEV_STATE); | ||
2508 | qla4_8xxx_idc_unlock(ha); | ||
2509 | if (dev_state == QLA82XX_DEV_FAILED) { | ||
2510 | ql4_printk(KERN_INFO, ha, "%s: don't retry " | ||
2511 | "recover adapter. H/W is in Failed " | ||
2512 | "state\n", __func__); | ||
2513 | qla4xxx_dead_adapter_cleanup(ha); | ||
2514 | clear_bit(DPC_RETRY_RESET_HA, &ha->dpc_flags); | ||
2515 | clear_bit(DPC_RESET_HA, &ha->dpc_flags); | ||
2516 | clear_bit(DPC_RESET_HA_FW_CONTEXT, | ||
2517 | &ha->dpc_flags); | ||
2518 | status = QLA_ERROR; | ||
2519 | |||
2520 | goto exit_recover; | ||
2521 | } | ||
2522 | } | ||
2523 | |||
2504 | if (!test_bit(DPC_RETRY_RESET_HA, &ha->dpc_flags)) { | 2524 | if (!test_bit(DPC_RETRY_RESET_HA, &ha->dpc_flags)) { |
2505 | ha->retry_reset_ha_cnt = MAX_RESET_HA_RETRIES; | 2525 | ha->retry_reset_ha_cnt = MAX_RESET_HA_RETRIES; |
2506 | DEBUG2(printk("scsi%ld: recover adapter - retrying " | 2526 | DEBUG2(printk("scsi%ld: recover adapter - retrying " |
@@ -2539,6 +2559,7 @@ recover_ha_init_adapter: | |||
2539 | clear_bit(DPC_RETRY_RESET_HA, &ha->dpc_flags); | 2559 | clear_bit(DPC_RETRY_RESET_HA, &ha->dpc_flags); |
2540 | } | 2560 | } |
2541 | 2561 | ||
2562 | exit_recover: | ||
2542 | ha->adapter_error_count++; | 2563 | ha->adapter_error_count++; |
2543 | 2564 | ||
2544 | if (test_bit(AF_ONLINE, &ha->flags)) | 2565 | if (test_bit(AF_ONLINE, &ha->flags)) |