aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorJoe Carnuccio <joe.carnuccio@qlogic.com>2010-01-12 16:02:46 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-01-18 11:48:26 -0500
commit90a86fc05ffefe48581c88106d0b9cc37f6e060c (patch)
treeb9f8ee2bec5833d83031b8f14ae79f3e55e2f01b /drivers/scsi/qla2xxx
parent9db0fb3aa4cc4e42241e194ef64931321fa72196 (diff)
[SCSI] qla2xxx: Enhance EEH support and enable AER support.
qla2xxx: EEH added call to pci_restore_state. qla2xxx: EEH added delay in slot reset routine. qla2xxx: EEH moved call to pci_save_state(), see (1). qla2xxx: EEH additional changes for RHEL5.5. qla2xxx: EEH added function call, removed function call, see (2). (1) In qla2xxx_probe_one the call to pci_save_state() has been moved to after the call to qla2xxx_request_irqs(). (2) Add call to pci_disable_pcie_error_reporting() in remove_one. Delete call to pci_cleanup_aer_uncorrect_error_status() in pci_resume. Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c5
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c40
2 files changed, 27 insertions, 18 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index ffd0efdff40e..5613456dbbb1 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2252,10 +2252,11 @@ qla2x00_free_irqs(scsi_qla_host_t *vha)
2252 2252
2253 if (ha->flags.msix_enabled) 2253 if (ha->flags.msix_enabled)
2254 qla24xx_disable_msix(ha); 2254 qla24xx_disable_msix(ha);
2255 else if (ha->flags.inta_enabled) { 2255 else if (ha->flags.msi_enabled) {
2256 free_irq(ha->pdev->irq, rsp); 2256 free_irq(ha->pdev->irq, rsp);
2257 pci_disable_msi(ha->pdev); 2257 pci_disable_msi(ha->pdev);
2258 } 2258 } else
2259 free_irq(ha->pdev->irq, rsp);
2259} 2260}
2260 2261
2261 2262
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 8529eb1f3cd4..fe34b7f9dee6 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1818,7 +1818,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1818 /* Set EEH reset type to fundamental if required by hba */ 1818 /* Set EEH reset type to fundamental if required by hba */
1819 if ( IS_QLA24XX(ha) || IS_QLA25XX(ha) || IS_QLA81XX(ha)) { 1819 if ( IS_QLA24XX(ha) || IS_QLA25XX(ha) || IS_QLA81XX(ha)) {
1820 pdev->needs_freset = 1; 1820 pdev->needs_freset = 1;
1821 pci_save_state(pdev);
1822 } 1821 }
1823 1822
1824 /* Configure PCI I/O space */ 1823 /* Configure PCI I/O space */
@@ -1975,6 +1974,9 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1975 ret = qla2x00_request_irqs(ha, rsp); 1974 ret = qla2x00_request_irqs(ha, rsp);
1976 if (ret) 1975 if (ret)
1977 goto probe_init_failed; 1976 goto probe_init_failed;
1977
1978 pci_save_state(pdev);
1979
1978 /* Alloc arrays of request and response ring ptrs */ 1980 /* Alloc arrays of request and response ring ptrs */
1979que_init: 1981que_init:
1980 if (!qla2x00_alloc_queues(ha)) { 1982 if (!qla2x00_alloc_queues(ha)) {
@@ -2176,6 +2178,8 @@ qla2x00_remove_one(struct pci_dev *pdev)
2176 kfree(ha); 2178 kfree(ha);
2177 ha = NULL; 2179 ha = NULL;
2178 2180
2181 pci_disable_pcie_error_reporting(pdev);
2182
2179 pci_disable_device(pdev); 2183 pci_disable_device(pdev);
2180 pci_set_drvdata(pdev, NULL); 2184 pci_set_drvdata(pdev, NULL);
2181} 2185}
@@ -3310,6 +3314,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
3310 return PCI_ERS_RESULT_CAN_RECOVER; 3314 return PCI_ERS_RESULT_CAN_RECOVER;
3311 case pci_channel_io_frozen: 3315 case pci_channel_io_frozen:
3312 ha->flags.eeh_busy = 1; 3316 ha->flags.eeh_busy = 1;
3317 qla2x00_free_irqs(vha);
3313 pci_disable_device(pdev); 3318 pci_disable_device(pdev);
3314 return PCI_ERS_RESULT_NEED_RESET; 3319 return PCI_ERS_RESULT_NEED_RESET;
3315 case pci_channel_io_perm_failure: 3320 case pci_channel_io_perm_failure:
@@ -3363,10 +3368,19 @@ qla2xxx_pci_slot_reset(struct pci_dev *pdev)
3363 pci_ers_result_t ret = PCI_ERS_RESULT_DISCONNECT; 3368 pci_ers_result_t ret = PCI_ERS_RESULT_DISCONNECT;
3364 scsi_qla_host_t *base_vha = pci_get_drvdata(pdev); 3369 scsi_qla_host_t *base_vha = pci_get_drvdata(pdev);
3365 struct qla_hw_data *ha = base_vha->hw; 3370 struct qla_hw_data *ha = base_vha->hw;
3366 int rc; 3371 struct rsp_que *rsp;
3372 int rc, retries = 10;
3367 3373
3368 DEBUG17(qla_printk(KERN_WARNING, ha, "slot_reset\n")); 3374 DEBUG17(qla_printk(KERN_WARNING, ha, "slot_reset\n"));
3369 3375
3376 /* Workaround: qla2xxx driver which access hardware earlier
3377 * needs error state to be pci_channel_io_online.
3378 * Otherwise mailbox command timesout.
3379 */
3380 pdev->error_state = pci_channel_io_normal;
3381
3382 pci_restore_state(pdev);
3383
3370 if (ha->mem_only) 3384 if (ha->mem_only)
3371 rc = pci_enable_device_mem(pdev); 3385 rc = pci_enable_device_mem(pdev);
3372 else 3386 else
@@ -3378,27 +3392,23 @@ qla2xxx_pci_slot_reset(struct pci_dev *pdev)
3378 return ret; 3392 return ret;
3379 } 3393 }
3380 3394
3395 rsp = ha->rsp_q_map[0];
3396 if (qla2x00_request_irqs(ha, rsp))
3397 return ret;
3398
3381 if (ha->isp_ops->pci_config(base_vha)) 3399 if (ha->isp_ops->pci_config(base_vha))
3382 return ret; 3400 return ret;
3383 3401
3384#ifdef QL_DEBUG_LEVEL_17 3402 while (ha->flags.mbox_busy && retries--)
3385 { 3403 msleep(1000);
3386 uint8_t b;
3387 uint32_t i;
3388 3404
3389 printk("slot_reset_1: ");
3390 for (i = 0; i < 256; i++) {
3391 pci_read_config_byte(ha->pdev, i, &b);
3392 printk("%s%02x", (i%16) ? " " : "\n", b);
3393 }
3394 printk("\n");
3395 }
3396#endif
3397 set_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags); 3405 set_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags);
3398 if (qla2x00_abort_isp(base_vha) == QLA_SUCCESS) 3406 if (qla2x00_abort_isp(base_vha) == QLA_SUCCESS)
3399 ret = PCI_ERS_RESULT_RECOVERED; 3407 ret = PCI_ERS_RESULT_RECOVERED;
3400 clear_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags); 3408 clear_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags);
3401 3409
3410 pci_cleanup_aer_uncorrect_error_status(pdev);
3411
3402 DEBUG17(qla_printk(KERN_WARNING, ha, 3412 DEBUG17(qla_printk(KERN_WARNING, ha,
3403 "slot_reset-return:ret=%x\n", ret)); 3413 "slot_reset-return:ret=%x\n", ret));
3404 3414
@@ -3422,8 +3432,6 @@ qla2xxx_pci_resume(struct pci_dev *pdev)
3422 } 3432 }
3423 3433
3424 ha->flags.eeh_busy = 0; 3434 ha->flags.eeh_busy = 0;
3425
3426 pci_cleanup_aer_uncorrect_error_status(pdev);
3427} 3435}
3428 3436
3429static struct pci_error_handlers qla2xxx_err_handler = { 3437static struct pci_error_handlers qla2xxx_err_handler = {