qla2xxx: updates/fixes for 2.6.24 [8.02.00-k8].
Subsystems (2)
cover qla2xxx: updates/fixes for 2.6.24 [8.02.00-k8].
Here's a batch of fixes for 2.6.24.
Changes include:
- Correct resource_size_t usages.
- Add MODULE_FIRMWARE hint for ISP25XX firmware.
- Cleanup any outstanding SRB resources during shutdown.
- Clear EFT buffer before firmware reinitialization.
- Cleanse memory allocation logic during probe.
- Consolidate RISC-parity enablement codes.
- Move RISC-interrupt-register modifications to qla2x00_request_irqs().
- Correct issue where vport-state was not updated during an ISP_ABORT_NEEDED requst.
- Access the proper 'physical' port in FC-transport callbacks.
- Correct issue where incorrect init-fw mailbox command was used on non-NPIV capable ISPs.
- Update version number to 8.02.00-k8.
Diffstat:
drivers/scsi/qla2xxx/qla_attr.c | 24 ++- drivers/scsi/qla2xxx/qla_def.h | 2 - drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 87 +++------ drivers/scsi/qla2xxx/qla_inline.h | 7 + drivers/scsi/qla2xxx/qla_isr.c | 27 ++- drivers/scsi/qla2xxx/qla_mbx.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 404 +++++++++++++----------------------- drivers/scsi/qla2xxx/qla_sup.c | 36 ++-- drivers/scsi/qla2xxx/qla_version.h | 2 +- 10 files changed, 233 insertions(+), 359 deletions(-)
Regards,
Andrew Vasquez
QLogic Corporation
PATCH 1/11 qla2xxx: Correct resource_size_t usages.
Hmm, it looks like the conversion to resource_size_t usage (3776541d8a46347a4924353a192c6ce4a3d04e2e) requires some additional fixups to cleanup the structure-pointer castings used during IO mapped accesses to the chip.
There's only a small number of locations, where the driver uses IO mapped accesses to the hardware, the patch below should take care of it without introducing to many structural changes to code flow.
--- drivers/scsi/qla2xxx/qla_sup.c | 36 +++++++++++++++--------------------- 1 files changed, 15 insertions(+), 21 deletions(-)
drivers/scsi/qla2xxx/qla_sup.c +15 -21
@@ -893,6 +893,8 @@ qla2x00_flip_colors(scsi_qla_host_t *ha, uint16_t *pflags) } } +#define PIO_REG (h, r) ((h)->pio_address + offsetof(struct device_reg_2xxx, r)) +void qla2x00_beacon_blink (struct scsi_qla_host *ha) {
@@ -902,15 +904,12 @@ qla2x00_beacon_blink(struct scsi_qla_host *ha)unsigned long flags;struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; -if (ha->pio_address) - reg = (struct device_reg_2xxx __iomem *)ha->pio_address; -spin_lock_irqsave (&ha->hardware_lock, flags);/* Save the Original GPIOE. */ if (ha->pio_address) { - gpio_enable =RD_REG_WORD_PIO (®->gpioe); - gpio_data =RD_REG_WORD_PIO (®->gpiod); + gpio_enable =RD_REG_WORD_PIO (PIO_REG (ha, gpioe)); + gpio_data =RD_REG_WORD_PIO (PIO_REG (ha, gpiod)); }else { gpio_enable =RD_REG_WORD (®->gpioe); gpio_data =RD_REG_WORD (®->gpiod);
@@ -920,7 +919,7 @@ qla2x00_beacon_blink(struct scsi_qla_host *ha) gpio_enable |=GPIO_LED_MASK ;if (ha->pio_address) { -WRT_REG_WORD_PIO (®->gpioe, gpio_enable); +WRT_REG_WORD_PIO (PIO_REG (ha, gpioe), gpio_enable); }else {WRT_REG_WORD (®->gpioe, gpio_enable);RD_REG_WORD (®->gpioe);
@@ -936,7 +935,7 @@ qla2x00_beacon_blink(struct scsi_qla_host *ha)/* Set the modified gpio_data values */ if (ha->pio_address) { -WRT_REG_WORD_PIO (®->gpiod, gpio_data); +WRT_REG_WORD_PIO (PIO_REG (ha, gpiod), gpio_data); }else {WRT_REG_WORD (®->gpiod, gpio_data);RD_REG_WORD (®->gpiod);
@@ -962,14 +961,11 @@ qla2x00_beacon_on(struct scsi_qla_host *ha)return QLA_FUNCTION_FAILED ; } -if (ha->pio_address) - reg = (struct device_reg_2xxx __iomem *)ha->pio_address; -/* Turn off LEDs. */ spin_lock_irqsave (&ha->hardware_lock, flags);if (ha->pio_address) { - gpio_enable =RD_REG_WORD_PIO (®->gpioe); - gpio_data =RD_REG_WORD_PIO (®->gpiod); + gpio_enable =RD_REG_WORD_PIO (PIO_REG (ha, gpioe)); + gpio_data =RD_REG_WORD_PIO (PIO_REG (ha, gpiod)); }else { gpio_enable =RD_REG_WORD (®->gpioe); gpio_data =RD_REG_WORD (®->gpiod);
@@ -978,7 +974,7 @@ qla2x00_beacon_on(struct scsi_qla_host *ha)/* Set the modified gpio_enable values. */ if (ha->pio_address) { -WRT_REG_WORD_PIO (®->gpioe, gpio_enable); +WRT_REG_WORD_PIO (PIO_REG (ha, gpioe), gpio_enable); }else {WRT_REG_WORD (®->gpioe, gpio_enable);RD_REG_WORD (®->gpioe);
@@ -987,7 +983,7 @@ qla2x00_beacon_on(struct scsi_qla_host *ha)/* Clear out previously set LED colour. */ gpio_data &= ~GPIO_LED_MASK ;if (ha->pio_address) { -WRT_REG_WORD_PIO (®->gpiod, gpio_data); +WRT_REG_WORD_PIO (PIO_REG (ha, gpiod), gpio_data); }else {WRT_REG_WORD (®->gpiod, gpio_data);RD_REG_WORD (®->gpiod);
@@ -1244,13 +1240,12 @@ qla2x00_read_flash_byte(scsi_qla_host_t *ha, uint32_t addr)if (ha->pio_address) {uint16_t data2; - reg = (struct device_reg_2xxx __iomem *)ha->pio_address; -WRT_REG_WORD_PIO (®->flash_address, (uint16_t )addr); +WRT_REG_WORD_PIO (PIO_REG (ha, flash_address), (uint16_t )addr);do { - data =RD_REG_WORD_PIO (®->flash_data); + data =RD_REG_WORD_PIO (PIO_REG (ha, flash_data));barrier ();cpu_relax (); - data2 =RD_REG_WORD_PIO (®->flash_data); + data2 =RD_REG_WORD_PIO (PIO_REG (ha, flash_data)); }while (data != data2); }else {WRT_REG_WORD (®->flash_address, (uint16_t )addr);
@@ -1304,9 +1299,8 @@ qla2x00_write_flash_byte(scsi_qla_host_t *ha, uint32_t addr, uint8_t data)/* Always perform IO mapped accesses to the FLASH registers. */ if (ha->pio_address) { - reg = (struct device_reg_2xxx __iomem *)ha->pio_address; -WRT_REG_WORD_PIO (®->flash_address, (uint16_t )addr); -WRT_REG_WORD_PIO (®->flash_data, (uint16_t )data); +WRT_REG_WORD_PIO (PIO_REG (ha, flash_address), (uint16_t )addr); +WRT_REG_WORD_PIO (PIO_REG (ha, flash_data), (uint16_t )data); }else {WRT_REG_WORD (®->flash_address, (uint16_t )addr);RD_REG_WORD (®->ctrl_status);/* PCI Posting. */
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 3/11 qla2xxx: Cleanup any outstanding SRB resources during shutdown.
In reply to Andrew VasquezRefactor SRB-failure completion codes in the process. Also, signal the DPC routine to complete sooner as backend processing at shutdown-time is superflous.
--- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 16 +--------------- drivers/scsi/qla2xxx/qla_os.c | 30 ++++++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 19 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
@@ -66,6 +66,7 @@ extern int ql2xqfullrampup;extern int num_hosts;extern int qla2x00_loop_reset (scsi_qla_host_t *); +extern void qla2x00_abort_all_cmds (scsi_qla_host_t *,int );/* * Global Functions in qla_mid.c source file.
drivers/scsi/qla2xxx/qla_init.c +1 -15
@@ -3213,9 +3213,6 @@ int qla2x00_abort_isp(scsi_qla_host_t *ha) {int rval; -unsigned long flags =0 ; -uint16_t cnt; -srb_t *sp;uint8_t status =0 ;if (ha->flags.online) {
@@ -3236,19 +3233,8 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) LOOP_DOWN_TIME); } -spin_lock_irqsave (&ha->hardware_lock, flags);/* Requeue all commands in outstanding command list. */ -for (cnt =1 ; cnt <MAX_OUTSTANDING_COMMANDS ; cnt++) { - sp = ha->outstanding_cmds[cnt]; -if (sp) { - ha->outstanding_cmds[cnt] =NULL ; - sp->flags =0 ; - sp->cmd->result =DID_RESET <<16 ; - sp->cmd->host_scribble = (unsigned char *)NULL ; -qla2x00_sp_compl (ha, sp); - } - } -spin_unlock_irqrestore (&ha->hardware_lock, flags); +qla2x00_abort_all_cmds (ha,DID_RESET <<16 ); ha->isp_ops->get_flash_version (ha, ha->request_ring);
drivers/scsi/qla2xxx/qla_os.c +26 -4
@@ -1117,6 +1117,27 @@ qla2x00_device_reset(scsi_qla_host_t *ha, fc_port_t *reset_fcport)return ha->isp_ops->abort_target (reset_fcport); } +void +qla2x00_abort_all_cmds (scsi_qla_host_t *ha,int res) +{ +int cnt; +unsigned long flags; +srb_t *sp; + +spin_lock_irqsave (&ha->hardware_lock, flags); +for (cnt =1 ; cnt <MAX_OUTSTANDING_COMMANDS ; cnt++) { + sp = ha->outstanding_cmds[cnt]; +if (sp) { + ha->outstanding_cmds[cnt] =NULL ; + sp->flags =0 ; + sp->cmd->result = res; + sp->cmd->host_scribble = (unsigned char *)NULL ; +qla2x00_sp_compl (ha, sp); + } + } +spin_unlock_irqrestore (&ha->hardware_lock, flags); +} +static int qla2xxx_slave_alloc (struct scsi_device *sdev) {
@@ -1601,6 +1622,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)sprintf (ha->host_str,"%s_%ld" ,QLA2XXX_DRIVER_NAME , ha->host_no); ha->parent =NULL ; ha->bars = bars; +spin_lock_init (&ha->hardware_lock);/* Set ISP-type information. */ qla2x00_set_isp_flags (ha);
@@ -1614,8 +1636,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)"Found an ISP%04X, irq %d, iobase 0x%p\n" , pdev->device, pdev->irq, ha->iobase); -spin_lock_init (&ha->hardware_lock); - ha->prev_topology =0 ; ha->init_cb_size =sizeof (init_cb_t); ha->mgmt_svr_loop_id =MANAGEMENT_SERVER + ha->vp_idx;
@@ -1841,10 +1861,14 @@ qla2x00_remove_one(struct pci_dev *pdev)static void qla2x00_free_device (scsi_qla_host_t *ha) { +qla2x00_abort_all_cmds (ha,DID_NO_CONNECT <<16 ); +/* Disable timer */ if (ha->timer_active)qla2x00_stop_timer (ha); + ha->flags.online =0 ; +/* Kill the kernel thread for this host */ if (ha->dpc_thread) {struct task_struct *t = ha->dpc_thread;
@@ -1863,8 +1887,6 @@ qla2x00_free_device(scsi_qla_host_t *ha)if (ha->eft)qla2x00_disable_eft_trace (ha); - ha->flags.online =0 ; -/* Stop currently executing firmware. */ qla2x00_try_to_stop_firmware (ha);
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 4/11 qla2xxx: Clear EFT buffer before firmware reinitialization.
In reply to Andrew VasquezTo insure that there is no stale data present during EFT re-registration.
--- drivers/scsi/qla2xxx/qla_init.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +1 -0
@@ -3259,6 +3259,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)clear_bit (ISP_ABORT_RETRY , &ha->dpc_flags);if (ha->eft) { +memset (ha->eft,0 ,EFT_SIZE ); rval =qla2x00_enable_eft_trace (ha, ha->eft_dma,EFT_NUM_BUFFERS );if (rval) {
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 6/11 qla2xxx: Consolidate RISC-parity enablement codes.
In reply to Andrew VasquezCollapse duplicate codes called during probe() and RISC-reset into qla2x00_setup_chip().
--- drivers/scsi/qla2xxx/qla_init.c | 70 +++++++++++++------------------------- drivers/scsi/qla2xxx/qla_os.c | 12 ------- 2 files changed, 24 insertions(+), 58 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +24 -46
@@ -925,6 +925,16 @@ qla2x00_setup_chip(scsi_qla_host_t *ha) {int rval;uint32_t srisc_address =0 ; +struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; +unsigned long flags; + +if (!IS_FWI2_CAPABLE (ha) && !IS_QLA2100 (ha) && !IS_QLA2200 (ha)) { +/* Disable SRAM, Instruction RAM and GP RAM parity. */ +spin_lock_irqsave (&ha->hardware_lock, flags); +WRT_REG_WORD (®->hccr, (HCCR_ENABLE_PARITY +0x0 )); +RD_REG_WORD (®->hccr); +spin_unlock_irqrestore (&ha->hardware_lock, flags); + }/* Load firmware sequences */ rval = ha->isp_ops->load_risc (ha, &srisc_address);
@@ -968,6 +978,19 @@ qla2x00_setup_chip(scsi_qla_host_t *ha) } } +if (!IS_FWI2_CAPABLE (ha) && !IS_QLA2100 (ha) && !IS_QLA2200 (ha)) { +/* Enable proper parity. */ +spin_lock_irqsave (&ha->hardware_lock, flags); +if (IS_QLA2300 (ha)) +/* SRAM parity */ +WRT_REG_WORD (®->hccr,HCCR_ENABLE_PARITY +0x1 ); +else +/* SRAM, Instruction RAM and GP RAM parity */ +WRT_REG_WORD (®->hccr,HCCR_ENABLE_PARITY +0x7 ); +RD_REG_WORD (®->hccr); +spin_unlock_irqrestore (&ha->hardware_lock, flags); + } +if (rval) {DEBUG2_3 (printk ("scsi(%ld): Setup chip **** FAILED ****.\n" , ha->host_no));
@@ -3344,60 +3367,15 @@ static int qla2x00_restart_isp(scsi_qla_host_t *ha) {uint8_t status =0 ; -struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; -unsigned long flags =0 ;uint32_t wait_time;/* If firmware needs to be loaded */ if (qla2x00_isp_firmware (ha)) { ha->flags.online =0 ; -if (!(status = ha->isp_ops->chip_diag (ha))) { -if (IS_QLA2100 (ha) ||IS_QLA2200 (ha)) { - status =qla2x00_setup_chip (ha); - goto done; - } - -spin_lock_irqsave (&ha->hardware_lock, flags); - -if (!IS_QLA24XX (ha) && !IS_QLA54XX (ha) && - !IS_QLA25XX (ha)) { -/* -* Disable SRAM, Instruction RAM and GP RAM -* parity. -*/ -WRT_REG_WORD (®->hccr, - (HCCR_ENABLE_PARITY +0x0 )); -RD_REG_WORD (®->hccr); - } - -spin_unlock_irqrestore (&ha->hardware_lock, flags); - +if (!(status = ha->isp_ops->chip_diag (ha))) status =qla2x00_setup_chip (ha); - -spin_lock_irqsave (&ha->hardware_lock, flags); - -if (!IS_QLA24XX (ha) && !IS_QLA54XX (ha) && - !IS_QLA25XX (ha)) { -/* Enable proper parity */ -if (IS_QLA2300 (ha)) -/* SRAM parity */ -WRT_REG_WORD (®->hccr, - (HCCR_ENABLE_PARITY +0x1 )); -else -/* -* SRAM, Instruction RAM and GP RAM -* parity. -*/ -WRT_REG_WORD (®->hccr, - (HCCR_ENABLE_PARITY +0x7 )); -RD_REG_WORD (®->hccr); - } - -spin_unlock_irqrestore (&ha->hardware_lock, flags); - } } - done:if (!status && !(status =qla2x00_init_rings (ha))) {clear_bit (RESET_MARKER_NEEDED , &ha->dpc_flags);if (!(status =qla2x00_fw_ready (ha))) {
drivers/scsi/qla2xxx/qla_os.c +0 -12
@@ -1773,18 +1773,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)WRT_REG_WORD (®->isp.semaphore,0 );WRT_REG_WORD (®->isp.hccr,HCCR_CLR_RISC_INT );WRT_REG_WORD (®->isp.hccr,HCCR_CLR_HOST_INT ); - -/* Enable proper parity */ -if (!IS_QLA2100 (ha) && !IS_QLA2200 (ha)) { -if (IS_QLA2300 (ha)) -/* SRAM parity */ -WRT_REG_WORD (®->isp.hccr, - (HCCR_ENABLE_PARITY +0x1 )); -else -/* SRAM, Instruction RAM and GP RAM parity */ -WRT_REG_WORD (®->isp.hccr, - (HCCR_ENABLE_PARITY +0x7 )); - } }spin_unlock_irqrestore (&ha->hardware_lock, flags);
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 5/11 qla2xxx: Cleanse memory allocation logic during probe.
In reply to Andrew Vasquez- Drop loop-till-allocated structure of code within qla2x00_mem_alloc().
- Properly unwind deallcations of memory during failures.
- Drop qla2x00_allocate_sp_pool() and qla2x00_free_sp_pool() functions as their implementations can easily be collapsed into the callers.
- Defer DMA pool allocation of SFP data until requested.
--- drivers/scsi/qla2xxx/qla_attr.c | 13 ++ drivers/scsi/qla2xxx/qla_os.c | 330 ++++++++++++--------------------------- 2 files changed, 112 insertions(+), 231 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +13 -0
@@ -428,6 +428,19 @@ qla2x00_sysfs_read_sfp(struct kobject *kobj,if (!capable (CAP_SYS_ADMIN ) || off !=0 || count !=SFP_DEV_SIZE *2 )return 0 ; +if (ha->sfp_data) + goto do_read; + + ha->sfp_data =dma_pool_alloc (ha->s_dma_pool,GFP_KERNEL , + &ha->sfp_data_dma); +if (!ha->sfp_data) { +qla_printk (KERN_WARNING , ha, +"Unable to allocate memory for SFP read-data.\n" ); +return 0 ; + } + +do_read: +memset (ha->sfp_data,0 ,SFP_BLOCK_SIZE ); addr =0xa0 ;for (iter =0 , offset =0 ; iter < (SFP_DEV_SIZE *2 ) /SFP_BLOCK_SIZE ; iter++, offset +=SFP_BLOCK_SIZE ) {
drivers/scsi/qla2xxx/qla_os.c +98 -230
368 lines not on this page · raw message
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 8/11 qla2xxx: Correct issue where vport-state was not updated during an ISP_ABORT_NEEDED requst.
In reply to Andrew VasquezFrom: Seokmann Ju <[email protected]>
While running IO simultaneously through physical port and virtual port, if user changes Data Rate (from scli utility), IO through virtual port fails. It failed because the vport had not received the ISP_ABORT_NEEDED notification.
--- drivers/scsi/qla2xxx/qla_os.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +15 -0
@@ -2220,6 +2220,9 @@ qla2x00_do_dpc(void *data)fc_port_t *fcport;uint8_t status;uint16_t next_loopid; +struct scsi_qla_host *vha; +int i; + ha = (scsi_qla_host_t *)data;
@@ -2262,6 +2265,18 @@ qla2x00_do_dpc(void *data) }clear_bit (ABORT_ISP_ACTIVE , &ha->dpc_flags); } + +for_each_mapped_vp_idx (ha, i) { +list_for_each_entry (vha, &ha->vp_list, + vp_list) { +if (i == vha->vp_idx) { +set_bit (ISP_ABORT_NEEDED , + &vha->dpc_flags); +break ; + } + } + } +DEBUG (printk ("scsi(%ld): dpc: qla2x00_abort_isp end\n" , ha->host_no)); }
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 10/11 qla2xxx: Correct issue where incorrect init-fw mailbox command was used on non-NPIV capable ISPs.
In reply to Andrew VasquezBIT_2 of the firmware attributes is only valid on FW-interface-2 type HBAs. Code in commit c48339decceec8e011498b0fc4c7c7d8b2ea06c1 would cause the incorrect initialize-firmware mailbox command to be issued for non-NPIV capable ISPs. Correct this by reverting to previously used (and correct) pre-condition 'if' check.
--- drivers/scsi/qla2xxx/qla_mbx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_mbx.c +1 -1
@@ -980,7 +980,7 @@ qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size)DEBUG11 (printk ("qla2x00_init_firmware(%ld): entered.\n" , ha->host_no)); -if (ha->fw_attributes &BIT_2 ) +if (ha->flags.npiv_supported) mcp->mb[0 ] =MBC_MID_INITIALIZE_FIRMWARE ;else mcp->mb[0 ] =MBC_INITIALIZE_FIRMWARE ;
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 7/11 qla2xxx: Move RISC-interrupt-register modifications to qla2x00_request_irqs().
In reply to Andrew VasquezThere's no functional change involved with this update, instead it simply migrates the "set cleared interrupt state" codes to a more approprate method, qla2x00_request_irqs(), and cleans-up the driver's probe() logic.
--- drivers/scsi/qla2xxx/qla_isr.c | 27 ++++++++++++++++++++++----- drivers/scsi/qla2xxx/qla_os.c | 18 ------------------ 2 files changed, 22 insertions(+), 23 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +22 -5
@@ -1815,6 +1815,8 @@ int qla2x00_request_irqs(scsi_qla_host_t *ha) {int ret; +device_reg_t __iomem *reg = ha->iobase; +unsigned long flags;/* If possible, enable MSI-X. */ if (!IS_QLA2432 (ha) && !IS_QLA2532 (ha))
@@ -1846,7 +1848,7 @@ qla2x00_request_irqs(scsi_qla_host_t *ha)DEBUG2 (qla_printk (KERN_INFO , ha,"MSI-X: Enabled (0x%X, 0x%X).\n" , ha->chip_revision, ha->fw_attributes)); -return ret; + goto clear_risc_ints; }qla_printk (KERN_WARNING , ha,"MSI-X: Falling back-to INTa mode -- %d.\n" , ret);
@@ -1864,15 +1866,30 @@ skip_msi: ret =request_irq (ha->pdev->irq, ha->isp_ops->intr_handler,IRQF_DISABLED |IRQF_SHARED ,QLA2XXX_DRIVER_NAME , ha); -if (!ret) { - ha->flags.inta_enabled =1 ; - ha->host->irq = ha->pdev->irq; - }else { +if (ret) {qla_printk (KERN_WARNING , ha,"Failed to reserve interrupt %d already in use.\n" , ha->pdev->irq); + goto fail; + } + ha->flags.inta_enabled =1 ; + ha->host->irq = ha->pdev->irq; +clear_risc_ints: + + ha->isp_ops->disable_intrs (ha); +spin_lock_irqsave (&ha->hardware_lock, flags); +if (IS_FWI2_CAPABLE (ha)) { +WRT_REG_DWORD (®->isp24.hccr,HCCRX_CLR_HOST_INT ); +WRT_REG_DWORD (®->isp24.hccr,HCCRX_CLR_RISC_INT ); + }else { +WRT_REG_WORD (®->isp.semaphore,0 ); +WRT_REG_WORD (®->isp.hccr,HCCR_CLR_RISC_INT ); +WRT_REG_WORD (®->isp.hccr,HCCR_CLR_HOST_INT ); } +spin_unlock_irqrestore (&ha->hardware_lock, flags); + ha->isp_ops->enable_intrs (ha); +fail:return ret; }
drivers/scsi/qla2xxx/qla_os.c +0 -18
@@ -1576,10 +1576,8 @@ static int __devinit qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) { int ret = -ENODEV; -device_reg_t __iomem *reg;struct Scsi_Host *host;scsi_qla_host_t *ha; -unsigned long flags =0 ;char pci_info[30 ];char fw_str[30 ];struct scsi_host_template *sht;
@@ -1762,22 +1760,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)DEBUG2 (printk ("DEBUG: detect hba %ld at address = %p\n" , ha->host_no, ha)); - ha->isp_ops->disable_intrs (ha); - -spin_lock_irqsave (&ha->hardware_lock, flags); - reg = ha->iobase; -if (IS_FWI2_CAPABLE (ha)) { -WRT_REG_DWORD (®->isp24.hccr,HCCRX_CLR_HOST_INT ); -WRT_REG_DWORD (®->isp24.hccr,HCCRX_CLR_RISC_INT ); - }else { -WRT_REG_WORD (®->isp.semaphore,0 ); -WRT_REG_WORD (®->isp.hccr,HCCR_CLR_RISC_INT ); -WRT_REG_WORD (®->isp.hccr,HCCR_CLR_HOST_INT ); - } -spin_unlock_irqrestore (&ha->hardware_lock, flags); - - ha->isp_ops->enable_intrs (ha); -pci_set_drvdata (pdev, ha); ha->flags.init_done =1 ;
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 9/11 qla2xxx: Access the proper 'physical' port in FC-transport callbacks.
In reply to Andrew VasquezFrom: Seokmann Ju <[email protected]>
For following fc_host specific attributes, vports rely on the pport. So, this patch changed way to access the data for those attributes so that they can access pport's.
- get_host_speed (speed)
- get_host_port_state (port_state)
- get_host_port_type (port_type)
- get_fc_host_stats
Also, added PORT_SPEED_8GB case in the speed attribute for 8Gb HBAs.
--- drivers/scsi/qla2xxx/qla_attr.c | 11 +++++++---- drivers/scsi/qla2xxx/qla_def.h | 2 -- drivers/scsi/qla2xxx/qla_inline.h | 7 +++++++ 3 files changed, 14 insertions(+), 6 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +7 -4
@@ -848,7 +848,7 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost)static void qla2x00_get_host_speed (struct Scsi_Host *shost) { -scsi_qla_host_t *ha =shost_priv (shost); +scsi_qla_host_t *ha =to_qla_parent (shost_priv (shost));uint32_t speed =0 ;switch (ha->link_data_rate) {
@@ -861,6 +861,9 @@ qla2x00_get_host_speed(struct Scsi_Host *shost)case PORT_SPEED_4GB : speed =4 ;break ; +case PORT_SPEED_8GB : + speed =8 ; +break ; }fc_host_speed (shost) = speed; }
@@ -868,7 +871,7 @@ qla2x00_get_host_speed(struct Scsi_Host *shost)static void qla2x00_get_host_port_type (struct Scsi_Host *shost) { -scsi_qla_host_t *ha =shost_priv (shost); +scsi_qla_host_t *ha =to_qla_parent (shost_priv (shost));uint32_t port_type =FC_PORTTYPE_UNKNOWN ;switch (ha->current_topology) {
@@ -978,7 +981,7 @@ qla2x00_issue_lip(struct Scsi_Host *shost)static struct fc_host_statistics *qla2x00_get_fc_host_stats (struct Scsi_Host *shost) { -scsi_qla_host_t *ha =shost_priv (shost); +scsi_qla_host_t *ha =to_qla_parent (shost_priv (shost));int rval;struct link_statistics *stats;dma_addr_t stats_dma;
@@ -1062,7 +1065,7 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost)static void qla2x00_get_host_port_state (struct Scsi_Host *shost) { -scsi_qla_host_t *ha =shost_priv (shost); +scsi_qla_host_t *ha =to_qla_parent (shost_priv (shost));if (!ha->flags.online)fc_host_port_state (shost) =FC_PORTSTATE_OFFLINE ;
drivers/scsi/qla2xxx/qla_def.h +0 -2
@@ -2041,8 +2041,6 @@ typedef struct vport_params {#define VP_RET_CODE_NO_MEM 5#define VP_RET_CODE_NOT_FOUND 6 -#define to_qla_parent (x) (((x)->parent) ? (x)->parent : (x)) -/* * ISP operations */
drivers/scsi/qla2xxx/qla_inline.h +7 -0
@@ -119,6 +119,13 @@ static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *ha)qla2x00_get_firmware_state (ha, &fw_state); } +static __inline__scsi_qla_host_t *to_qla_parent (scsi_qla_host_t *); +static __inline__scsi_qla_host_t * +to_qla_parent (scsi_qla_host_t *ha) +{ +return ha->parent ? ha->parent : ha; +} +/** * qla2x00_issue_marker() - Issue a Marker IOCB if necessary. * @ha: HA context
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 11/11 qla2xxx: Update version number to 8.02.00-k8.
In reply to Andrew Vasquez--- drivers/scsi/qla2xxx/qla_version.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +1 -1
@@ -7,7 +7,7 @@/* * Driver version */ -#define QLA2XXX_VERSION "8.02.00-k7" +#define QLA2XXX_VERSION "8.02.00-k8"#define QLA_DRIVER_MAJOR_VER 8#define QLA_DRIVER_MINOR_VER 2
Signature · 1 line
1.5.4.rc5.5.gab98
PATCH 2/11 qla2xxx: Add MODULE_FIRMWARE hint for ISP25XX firmware.
In reply to Andrew Vasquez--- drivers/scsi/qla2xxx/qla_os.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +1 -0
@@ -3016,3 +3016,4 @@ MODULE_FIRMWARE(FW_FILE_ISP22XX);MODULE_FIRMWARE (FW_FILE_ISP2300 );MODULE_FIRMWARE (FW_FILE_ISP2322 );MODULE_FIRMWARE (FW_FILE_ISP24XX ); +MODULE_FIRMWARE (FW_FILE_ISP25XX );
Signature · 1 line
1.5.4.rc5.5.gab98