Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 316804 Details for
Bug 462416
[QLogic 5.3 bug] Update qla2xxx - PCI EE error handling support
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
EEH for rhel5.3
qla2xxx_rhel5.3_EEH_patch11.txt (text/plain), 9.77 KB, created by
Marcus Barrow
on 2008-09-16 02:39:19 UTC
(
hide
)
Description:
EEH for rhel5.3
Filename:
MIME Type:
Creator:
Marcus Barrow
Created:
2008-09-16 02:39:19 UTC
Size:
9.77 KB
patch
obsolete
> > >BZ 462416 Update qla2xxx - PCI EE error handling support > >This patch provides support for PCI Enhanced Error Handling. > >It was originally submitted for 5.2 but problems were found during testing. >IBM has provided addional fixes for the kernel, then updated and tested this >patch to the driver. > >It applies cleanly and builds under kernel-2.6.18-110. > >This patch is late because I received a data corruption patch late last week, >and there were problems with my tree and setting up lab equipment on site to >perform additional testing. > >--- > drivers/scsi/qla2xxx/qla_def.h | 1 + > drivers/scsi/qla2xxx/qla_init.c | 11 +++ > drivers/scsi/qla2xxx/qla_isr.c | 28 ++++++++- > drivers/scsi/qla2xxx/qla_mbx.c | 2 +- > drivers/scsi/qla2xxx/qla_os.c | 134 ++++++++++++++++++++++++++++++++++++++- > 5 files changed, 173 insertions(+), 3 deletions(-) > >diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h >index 674f505..37ce268 100644 >--- a/drivers/scsi/qla2xxx/qla_def.h >+++ b/drivers/scsi/qla2xxx/qla_def.h >@@ -2271,6 +2271,7 @@ typedef struct scsi_qla_host { > uint32_t gpsc_supported :1; > uint32_t vsan_enabled :1; > uint32_t npiv_supported :1; >+ uint32_t pci_channel_io_perm_failure :1; > } flags; > > atomic_t loop_state; >diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c >index 9c77952..d74a4aa 100644 >--- a/drivers/scsi/qla2xxx/qla_init.c >+++ b/drivers/scsi/qla2xxx/qla_init.c >@@ -66,6 +66,7 @@ qla2x00_initialize_adapter(scsi_qla_host > /* Clear adapter flags. */ > ha->flags.online = 0; > ha->flags.reset_active = 0; >+ ha->flags.pci_channel_io_perm_failure = 0; > atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); > atomic_set(&ha->loop_state, LOOP_DOWN); > ha->device_flags = DFLG_NO_CABLE; >@@ -3175,6 +3176,13 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) > } > spin_unlock_irqrestore(&ha->hardware_lock, flags); > >+ if (pci_channel_offline(ha->pdev) && >+ ha->flags.pci_channel_io_perm_failure) { >+ clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags); >+ status = 0; >+ goto isp_return; >+ } >+ > ha->isp_ops->get_flash_version(ha, ha->request_ring); > > rval = ha->isp_ops->nvram_config(ha); >@@ -3244,6 +3252,7 @@ isp_abort_retry: > > } > >+isp_return: > if (status) { > qla_printk(KERN_INFO, ha, > "qla2x00_abort_isp: **** FAILED ****\n"); >@@ -3891,6 +3900,8 @@ qla2x00_try_to_stop_firmware(scsi_qla_ho > { > int ret, retries; > >+ if (ha->flags.pci_channel_io_perm_failure) >+ return; > if (!IS_FWI2_CAPABLE(ha)) > return; > if (!ha->fw_major_version) >diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c >index 4106c90..f5bb36d 100644 >--- a/drivers/scsi/qla2xxx/qla_isr.c >+++ b/drivers/scsi/qla2xxx/qla_isr.c >@@ -36,6 +36,7 @@ qla2100_intr_handler(int irq, void *dev_ > int status; > unsigned long flags; > unsigned long iter; >+ uint16_t hccr; > uint16_t mb[4]; > > ha = (scsi_qla_host_t *) dev_id; >@@ -50,7 +51,23 @@ qla2100_intr_handler(int irq, void *dev_ > > spin_lock_irqsave(&ha->hardware_lock, flags); > for (iter = 50; iter--; ) { >- if ((RD_REG_WORD(®->istatus) & ISR_RISC_INT) == 0) >+ hccr = RD_REG_WORD(®->hccr); >+ if (hccr & HCCR_RISC_PAUSE) { >+ if (pci_channel_offline(ha->pdev)) >+ break; >+ >+ /* >+ * Issue a "HARD" reset in order for the RISC interrupt >+ * bit to be cleared. Schedule a big hammmer to get >+ * out of the RISC PAUSED state. >+ */ >+ WRT_REG_WORD(®->hccr, HCCR_RESET_RISC); >+ RD_REG_WORD(®->hccr); >+ >+ ha->isp_ops->fw_dump(ha, 1); >+ set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); >+ break; >+ } else if ((RD_REG_WORD(®->istatus) & ISR_RISC_INT) == 0) > break; > > if (RD_REG_WORD(®->semaphore) & BIT_0) { >@@ -130,6 +147,9 @@ qla2300_intr_handler(int irq, void *dev_ > for (iter = 50; iter--; ) { > stat = RD_REG_DWORD(®->u.isp2300.host_status); > if (stat & HSR_RISC_PAUSED) { >+ if (pci_channel_offline(ha->pdev)) >+ break; >+ > hccr = RD_REG_WORD(®->hccr); > if (hccr & (BIT_15 | BIT_13 | BIT_11 | BIT_8)) > qla_printk(KERN_INFO, ha, "Parity error -- " >@@ -1605,6 +1625,9 @@ qla24xx_intr_handler(int irq, void *dev_ > for (iter = 50; iter--; ) { > stat = RD_REG_DWORD(®->host_status); > if (stat & HSRX_RISC_PAUSED) { >+ if (pci_channel_offline(ha->pdev)) >+ break; >+ > hccr = RD_REG_DWORD(®->hccr); > > qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " >@@ -1740,6 +1763,9 @@ qla24xx_msix_default(int irq, void *dev_ > do { > stat = RD_REG_DWORD(®->host_status); > if (stat & HSRX_RISC_PAUSED) { >+ if (pci_channel_offline(ha->pdev)) >+ break; >+ > hccr = RD_REG_DWORD(®->hccr); > > qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " >diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c >index c6a3418..29e5f19 100644 >--- a/drivers/scsi/qla2xxx/qla_mbx.c >+++ b/drivers/scsi/qla2xxx/qla_mbx.c >@@ -57,7 +57,7 @@ qla2x00_mailbox_command(scsi_qla_host_t > * seconds. This is to serialize actual issuing of mailbox cmds during > * non ISP abort time. > */ >- if (!abort_active) { >+ if (!abort_active && !ha->flags.pci_channel_io_perm_failure) { > if (!wait_for_completion_timeout(&ha->mbx_cmd_comp, > mcp->tov * HZ)) { > /* Timeout occurred. Return error. */ >diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c >index d452052..d320d75 100644 >--- a/drivers/scsi/qla2xxx/qla_os.c >+++ b/drivers/scsi/qla2xxx/qla_os.c >@@ -409,6 +409,11 @@ qla2x00_queuecommand(struct scsi_cmnd *c > srb_t *sp; > int rval; > >+ if (unlikely(pci_channel_offline(ha->pdev))) { >+ cmd->result = DID_REQUEUE << 16; >+ goto qc_fail_command; >+ } >+ > rval = fc_remote_port_chkready(rport); > if (rval) { > cmd->result = rval; >@@ -471,6 +476,11 @@ qla24xx_queuecommand(struct scsi_cmnd *c > srb_t *sp; > int rval; > >+ if (unlikely(pci_channel_offline(ha->pdev))) { >+ cmd->result = DID_REQUEUE << 16; >+ goto qc24_fail_command; >+ } >+ > rval = fc_remote_port_chkready(rport); > if (rval) { > cmd->result = rval; >@@ -1910,6 +1920,24 @@ qla2x00_remove_one(struct pci_dev *pdev) > } > } > >+ /* Disable timer */ >+ if (ha->timer_active) >+ qla2x00_stop_timer(ha); >+ >+ /* Kill the kernel thread for this host */ >+ if (ha->dpc_thread) { >+ struct task_struct *t = ha->dpc_thread; >+ >+ /* >+ * qla2xxx_wake_dpc checks for ->dpc_thread >+ * so we need to zero it out. >+ */ >+ ha->dpc_thread = NULL; >+ kthread_stop(t); >+ } >+ >+ ha->flags.online = 0; >+ > qla84xx_put_chip(ha); > > qla2x00_free_sysfs_attr(ha); >@@ -2918,6 +2946,109 @@ qla2x00_release_firmware(void) > up(&qla_fw_lock); > } > >+static pci_ers_result_t >+qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) >+{ >+ scsi_qla_host_t *ha = pci_get_drvdata(pdev); >+ >+ switch (state) { >+ case pci_channel_io_normal: >+ return PCI_ERS_RESULT_CAN_RECOVER; >+ case pci_channel_io_frozen: >+ pci_disable_device(pdev); >+ return PCI_ERS_RESULT_NEED_RESET; >+ case pci_channel_io_perm_failure: >+ ha->flags.pci_channel_io_perm_failure = 1; >+ return PCI_ERS_RESULT_DISCONNECT; >+ } >+ return PCI_ERS_RESULT_NEED_RESET; >+} >+ >+static pci_ers_result_t >+qla2xxx_pci_mmio_enabled(struct pci_dev *pdev) >+{ >+ int risc_paused = 0; >+ uint32_t stat; >+ unsigned long flags; >+ scsi_qla_host_t *ha = pci_get_drvdata(pdev); >+ struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; >+ struct device_reg_24xx __iomem *reg24 = &ha->iobase->isp24; >+ >+ spin_lock_irqsave(&ha->hardware_lock, flags); >+ if (IS_QLA2100(ha) || IS_QLA2200(ha)){ >+ stat = RD_REG_DWORD(®->hccr); >+ if (stat & HCCR_RISC_PAUSE) >+ risc_paused = 1; >+ } else if (IS_QLA23XX(ha)) { >+ stat = RD_REG_DWORD(®->u.isp2300.host_status); >+ if (stat & HSR_RISC_PAUSED) >+ risc_paused = 1; >+ } else if (IS_FWI2_CAPABLE(ha)) { >+ stat = RD_REG_DWORD(®24->host_status); >+ if (stat & HSRX_RISC_PAUSED) >+ risc_paused = 1; >+ } >+ spin_unlock_irqrestore(&ha->hardware_lock, flags); >+ >+ if (risc_paused) { >+ qla_printk(KERN_INFO, ha, "RISC paused -- mmio_enabled, " >+ "Dumping firmware!\n"); >+ ha->isp_ops->fw_dump(ha, 0); >+ >+ return PCI_ERS_RESULT_NEED_RESET; >+ } else >+ return PCI_ERS_RESULT_RECOVERED; >+} >+ >+static pci_ers_result_t >+qla2xxx_pci_slot_reset(struct pci_dev *pdev) >+{ >+ pci_ers_result_t ret = PCI_ERS_RESULT_DISCONNECT; >+ scsi_qla_host_t *ha = pci_get_drvdata(pdev); >+ int rc; >+ >+ rc = pci_enable_device(pdev); >+ >+ if (rc) { >+ qla_printk(KERN_WARNING, ha, >+ "Can't re-enable PCI device after reset.\n"); >+ >+ return ret; >+ } >+ pci_set_master(pdev); >+ >+ if (ha->isp_ops->pci_config(ha)) >+ return ret; >+ >+ set_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); >+ if (qla2x00_abort_isp(ha)== QLA_SUCCESS) >+ ret = PCI_ERS_RESULT_RECOVERED; >+ clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); >+ >+ return ret; >+} >+ >+static void >+qla2xxx_pci_resume(struct pci_dev *pdev) >+{ >+ scsi_qla_host_t *ha = pci_get_drvdata(pdev); >+ int ret; >+ >+ ret = qla2x00_wait_for_hba_online(ha); >+ if (ret != QLA_SUCCESS) { >+ qla_printk(KERN_ERR, ha, >+ "the device failed to resume I/O " >+ "from slot/link_reset"); >+ } >+} >+ >+static struct pci_error_handlers qla2xxx_err_handler = { >+ .error_detected = qla2xxx_pci_error_detected, >+ .mmio_enabled = qla2xxx_pci_mmio_enabled, >+ .slot_reset = qla2xxx_pci_slot_reset, >+ .resume = qla2xxx_pci_resume, >+}; >+ > static struct pci_device_id qla2xxx_pci_tbl[] = { > { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100) }, > { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200) }, >@@ -2944,6 +3075,7 @@ static struct pci_driver qla2xxx_pci_dri > .id_table = qla2xxx_pci_tbl, > .probe = qla2x00_probe_one, > .remove = __devexit_p(qla2x00_remove_one), >+ .err_handler = &qla2xxx_err_handler, > }; > > /** >@@ -2998,7 +3130,7 @@ static void __exit > qla2x00_module_exit(void) > { > pci_unregister_driver(&qla2xxx_pci_driver); >- /* qla2x00_release_firmware(); */ >+ qla2x00_release_firmware(); > ql_nl_unregister(); > kmem_cache_destroy(srb_cachep); > fc_release_transport(qla2xxx_transport_template); >-- >1.4.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 462416
: 316804 |
318023