qla2xxx: Driver update [8.02.01-k1].
Subsystems (2)
cover qla2xxx: Driver update [8.02.01-k1].
This patchset updates the qla2xxx driver to 8.02.01-k1
drivers/scsi/qla2xxx/Kconfig | 3 +- drivers/scsi/qla2xxx/qla_attr.c | 36 +++- drivers/scsi/qla2xxx/qla_dbg.c | 124 +---------- drivers/scsi/qla2xxx/qla_dbg.h | 23 +-- drivers/scsi/qla2xxx/qla_def.h | 78 ++++++- drivers/scsi/qla2xxx/qla_dfs.c | 2 +- drivers/scsi/qla2xxx/qla_fw.h | 173 ++++++++++++++- drivers/scsi/qla2xxx/qla_gbl.h | 33 ++- drivers/scsi/qla2xxx/qla_gs.c | 16 +- drivers/scsi/qla2xxx/qla_init.c | 192 +++++++++++----- drivers/scsi/qla2xxx/qla_inline.h | 87 +------- drivers/scsi/qla2xxx/qla_iocb.c | 5 +- drivers/scsi/qla2xxx/qla_isr.c | 223 ++++++++---------- drivers/scsi/qla2xxx/qla_mbx.c | 318 +++++++++++++++++++------- drivers/scsi/qla2xxx/qla_mid.c | 30 +-- drivers/scsi/qla2xxx/qla_os.c | 443 +++++++++++++++++------------------ drivers/scsi/qla2xxx/qla_settings.h | 16 +-- drivers/scsi/qla2xxx/qla_sup.c | 315 ++++++++++++++++++++----- drivers/scsi/qla2xxx/qla_version.h | 6 +- 19 files changed, 1266 insertions(+), 857 deletions(-)
here's the commits:
- Update firmware filenames for new ISP parts.
- Update copyright banner.
- Add support for host supported speeds FC transport attribute.
- Remove unused and obsolete #define's.
- Use an rport's scsi_target_id member consistently throughout driver.
- Simplify interrupt handler locking.
- Add FC-transport Asynchronous Event Notification support.
- Add hardware trace-logging support.
- Cruft cleanup of functions and structures.
- Use PCI-SIG nomenclature for PCIe bandwidth units.
- Add Flash Descriptor Table layout support.
- Check alternate 'reason' code during GPSC status handling.
- Add midlayer target/device reset support.
- Assign mailbox command timeout values in a consistent manner.
- Add ISP84XX support.
- Remove unused member (dma_handle) from srb_t structure.
- Consistently access the physical HA port.
- Check DFLG_NO_CABLE only on physical port.
- Use proper HA during asynchrounous event handling.
- Correct vport configuration-change handling.
- Update version number to 8.02.01-k1.
Regards,
Andrew Vasquez
QLogic Corporation
PATCH 1/21 qla2xxx: Update firmware filenames for new ISP parts.
--- drivers/scsi/qla2xxx/Kconfig | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/Kconfig +2 -1
@@ -16,7 +16,8 @@ config SCSI_QLA_FC 22xx ql2200_fw.bin 2300, 2312, 6312 ql2300_fw.bin 2322, 6322 ql2322_fw.bin - 24xx ql2400_fw.bin + 24xx, 54xx ql2400_fw.bin + 25xx ql2500_fw.bin Upon request, the driver caches the firmware image until the driver is unloaded.
Signature · 1 line
1.5.5.rc2
PATCH 2/21 qla2xxx: Update copyright banner.
In reply to Andrew Vasquez--- drivers/scsi/qla2xxx/qla_attr.c | 2 +- drivers/scsi/qla2xxx/qla_dbg.c | 2 +- drivers/scsi/qla2xxx/qla_dbg.h | 2 +- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi/qla2xxx/qla_dfs.c | 2 +- drivers/scsi/qla2xxx/qla_fw.h | 2 +- drivers/scsi/qla2xxx/qla_gbl.h | 2 +- drivers/scsi/qla2xxx/qla_gs.c | 2 +- drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_inline.h | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 2 +- drivers/scsi/qla2xxx/qla_isr.c | 2 +- drivers/scsi/qla2xxx/qla_mbx.c | 2 +- drivers/scsi/qla2xxx/qla_mid.c | 18 +++--------------- drivers/scsi/qla2xxx/qla_os.c | 2 +- drivers/scsi/qla2xxx/qla_settings.h | 2 +- drivers/scsi/qla2xxx/qla_sup.c | 2 +- drivers/scsi/qla2xxx/qla_version.h | 2 +- 18 files changed, 20 insertions(+), 32 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_dbg.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_dbg.h +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_def.h +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_dfs.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_fw.h +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_gbl.h +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_gs.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_init.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_inline.h +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_iocb.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_isr.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_mbx.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_mid.c +3 -15
@@ -1,20 +1,8 @@/* -* QLOGIC LINUX SOFTWARE -* -* QLogic ISP2x00 device driver for Linux 2.6.x -* Copyright (C) 2003-2005 QLogic Corporation -* (www.qlogic.com) -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2, or (at your option) any -* later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. +* QLogic Fibre Channel HBA Driver +* Copyright (c) 2003-2008 QLogic Corporation * +* See LICENSE.qla2xxx for copyright and licensing details. */ #include "qla_def.h"
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_settings.h +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_sup.c +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
drivers/scsi/qla2xxx/qla_version.h +1 -1
@@ -1,6 +1,6 @@/* * QLogic Fibre Channel HBA Driver -* Copyright (c) 2003-2005 QLogic Corporation +* Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */
Signature · 1 line
1.5.5.rc2
PATCH 3/21 qla2xxx: Add support for host supported speeds FC transport attribute.
In reply to Andrew VasquezUse generic FC transport #defines for speed values.
--- drivers/scsi/qla2xxx/qla_attr.c | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +20 -5
@@ -849,20 +849,20 @@ static void qla2x00_get_host_speed(struct Scsi_Host *shost) {scsi_qla_host_t *ha =to_qla_parent (shost_priv (shost)); -uint32_t speed =0 ; +u32 speed =FC_PORTSPEED_UNKNOWN ;switch (ha->link_data_rate) {case PORT_SPEED_1GB : - speed =1 ; + speed =FC_PORTSPEED_1GBIT ;break ;case PORT_SPEED_2GB : - speed =2 ; + speed =FC_PORTSPEED_2GBIT ;break ;case PORT_SPEED_4GB : - speed =4 ; + speed =FC_PORTSPEED_4GBIT ;break ;case PORT_SPEED_8GB : - speed =8 ; + speed =FC_PORTSPEED_8GBIT ;break ; }fc_host_speed (shost) = speed;
@@ -1196,6 +1196,7 @@ struct fc_function_template qla2xxx_transport_functions = { .show_host_node_name = 1, .show_host_port_name = 1, .show_host_supported_classes = 1, + .show_host_supported_speeds = 1, .get_host_port_id = qla2x00_get_host_port_id, .show_host_port_id = 1,
@@ -1276,9 +1277,23 @@ struct fc_function_template qla2xxx_transport_vport_functions = {void qla2x00_init_host_attr (scsi_qla_host_t *ha) { +u32 speed =FC_PORTSPEED_UNKNOWN ; +fc_host_node_name (ha->host) =wwn_to_u64 (ha->node_name);fc_host_port_name (ha->host) =wwn_to_u64 (ha->port_name);fc_host_supported_classes (ha->host) =FC_COS_CLASS3 ;fc_host_max_npiv_vports (ha->host) = ha->max_npiv_vports;;fc_host_npiv_vports_inuse (ha->host) = ha->cur_vport_count; + +if (IS_QLA25XX (ha)) + speed =FC_PORTSPEED_8GBIT |FC_PORTSPEED_4GBIT | +FC_PORTSPEED_2GBIT |FC_PORTSPEED_1GBIT ; +else if (IS_QLA24XX (ha) ||IS_QLA54XX (ha)) + speed =FC_PORTSPEED_4GBIT |FC_PORTSPEED_2GBIT | +FC_PORTSPEED_1GBIT ; +else if (IS_QLA23XX (ha)) + speed =FC_PORTSPEED_2GBIT |FC_PORTSPEED_1GBIT ; +else + speed =FC_PORTSPEED_1GBIT ; +fc_host_supported_speeds (ha->host) = speed; }
Signature · 1 line
1.5.5.rc2
PATCH 4/21 qla2xxx: Remove unused and obsolete #define's.
In reply to Andrew Vasquez--- drivers/scsi/qla2xxx/qla_gbl.h | 2 -- drivers/scsi/qla2xxx/qla_mbx.c | 2 -- drivers/scsi/qla2xxx/qla_os.c | 9 --------- drivers/scsi/qla2xxx/qla_settings.h | 14 -------------- 4 files changed, 0 insertions(+), 27 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +0 -2
@@ -151,10 +151,8 @@ qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);extern int qla2x00_abort_command (scsi_qla_host_t *,srb_t *); -#if USE_ABORT_TGT extern int qla2x00_abort_target (fc_port_t *); -#endif extern int qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
drivers/scsi/qla2xxx/qla_mbx.c +0 -2
@@ -776,7 +776,6 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)return rval; } -#if USE_ABORT_TGT /* * qla2x00_abort_target * Issue abort target mailbox command.
@@ -834,7 +833,6 @@ qla2x00_abort_target(fc_port_t *fcport)return rval; } -#endif /* * qla2x00_get_adapter_id
drivers/scsi/qla2xxx/qla_os.c +0 -9
@@ -816,15 +816,6 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)if (qla2x00_wait_for_loop_ready (ha) ==QLA_SUCCESS ) {if (qla2x00_device_reset (ha, fcport) ==0 ) ret =SUCCESS ; - -#if defined(LOGOUT_AFTER_DEVICE_RESET ) -if (ret ==SUCCESS ) { -if (fcport->flags &FC_FABRIC_DEVICE ) { - ha->isp_ops->fabric_logout (ha, fcport->loop_id); -qla2x00_mark_device_lost (ha, fcport,0 ,0 ); - } - } -#endif }else {DEBUG2 (printk (KERN_INFO "%s failed: loop not ready\n" ,__func__));
drivers/scsi/qla2xxx/qla_settings.h +0 -14
@@ -4,23 +4,9 @@* * See LICENSE.qla2xxx for copyright and licensing details. */ -/* -* Compile time Options: -* 0 - Disable and 1 - Enable -*/ -#define DEBUG_QLA2100 0/* For Debug of qla2x00 */ - -#define USE_ABORT_TGT 1/* Use Abort Target mbx cmd */ -#define MAX_RETRIES_OF_ISP_ABORT 5/* Max time to wait for the loop to be in LOOP_READY state */ #define MAX_LOOP_TIMEOUT (60 * 5) -/* -* Some vendor subsystems do not recover properly after a device reset. Define -* the following to force a logout after a successful device reset. -*/ -#undef LOGOUT_AFTER_DEVICE_RESET -#include "qla_version.h"
Signature · 1 line
1.5.5.rc2
PATCH 5/21 qla2xxx: Use an rport's scsi_target_id member consistently throughout driver.
In reply to Andrew VasquezRather than using a duplicate/cached value stored in the driver's internal fcport structure.
--- drivers/scsi/qla2xxx/qla_attr.c | 9 ++++++--- drivers/scsi/qla2xxx/qla_def.h | 2 -- drivers/scsi/qla2xxx/qla_init.c | 4 ---- 3 files changed, 6 insertions(+), 9 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +6 -3
@@ -900,7 +900,8 @@ qla2x00_get_starget_node_name(struct scsi_target *starget)u64 node_name =0 ;list_for_each_entry (fcport, &ha->fcports, list) { -if (starget->id == fcport->os_target_id) { +if (fcport->rport && + starget->id == fcport->rport->scsi_target_id) { node_name =wwn_to_u64 (fcport->node_name);break ; }
@@ -918,7 +919,8 @@ qla2x00_get_starget_port_name(struct scsi_target *starget)u64 port_name =0 ;list_for_each_entry (fcport, &ha->fcports, list) { -if (starget->id == fcport->os_target_id) { +if (fcport->rport && + starget->id == fcport->rport->scsi_target_id) { port_name =wwn_to_u64 (fcport->port_name);break ; }
@@ -936,7 +938,8 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)uint32_t port_id = ~0U ;list_for_each_entry (fcport, &ha->fcports, list) { -if (starget->id == fcport->os_target_id) { +if (fcport->rport && + starget->id == fcport->rport->scsi_target_id) { port_id = fcport->d_id.b.domain <<16 | fcport->d_id.b.area <<8 | fcport->d_id.b.al_pa;break ;
drivers/scsi/qla2xxx/qla_def.h +0 -2
@@ -1542,8 +1542,6 @@ typedef struct fc_port {atomic_t state;uint32_t flags; -unsigned int os_target_id; -int port_login_retry_count;int login_retry;atomic_t port_down_timer;
drivers/scsi/qla2xxx/qla_init.c +0 -4
@@ -2251,10 +2251,6 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)if (fcport->port_type ==FCT_TARGET ) rport_ids.roles |=FC_RPORT_ROLE_FCP_TARGET ;fc_remote_port_rolechg (rport, rport_ids.roles); - -if (rport->scsi_target_id !=-1 && - rport->scsi_target_id < ha->host->max_id) - fcport->os_target_id = rport->scsi_target_id; }/*
Signature · 1 line
1.5.5.rc2
PATCH 6/21 qla2xxx: Simplify interrupt handler locking.
In reply to Andrew VasquezThere's no need to use the heavier (albiet safer) *_irq[save|restore]() locking primitives within the driver's interrupt handlers, interrupts are guaranteed to be non-reentrant. Use lightweight spin_lock() and spin_unlock() primitives while acquiring the hardware_lock.
--- drivers/scsi/qla2xxx/qla_isr.c | 31 ++++++++++++------------------- 1 files changed, 12 insertions(+), 19 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +12 -19
@@ -33,7 +33,6 @@ qla2100_intr_handler(int irq, void *dev_id)scsi_qla_host_t *ha;struct device_reg_2xxx __iomem *reg;int status; -unsigned long flags;unsigned long iter;uint16_t hccr;uint16_t mb[4 ];
@@ -48,7 +47,7 @@ qla2100_intr_handler(int irq, void *dev_id) reg = &ha->iobase->isp; status =0 ; -spin_lock_irqsave (&ha->hardware_lock, flags); +spin_lock (&ha->hardware_lock);for (iter =50 ; iter--; ) { hccr =RD_REG_WORD (®->hccr);if (hccr &HCCR_RISC_PAUSE ) {
@@ -99,7 +98,7 @@ qla2100_intr_handler(int irq, void *dev_id)RD_REG_WORD (®->hccr); } } -spin_unlock_irqrestore (&ha->hardware_lock, flags); +spin_unlock (&ha->hardware_lock);if (test_bit (MBX_INTR_WAIT , &ha->mbx_cmd_flags) && (status &MBX_INTERRUPT ) && ha->flags.mbox_int) {
@@ -125,7 +124,6 @@ qla2300_intr_handler(int irq, void *dev_id)scsi_qla_host_t *ha;struct device_reg_2xxx __iomem *reg;int status; -unsigned long flags;unsigned long iter;uint32_t stat;uint16_t hccr;
@@ -141,7 +139,7 @@ qla2300_intr_handler(int irq, void *dev_id) reg = &ha->iobase->isp; status =0 ; -spin_lock_irqsave (&ha->hardware_lock, flags); +spin_lock (&ha->hardware_lock);for (iter =50 ; iter--; ) { stat =RD_REG_DWORD (®->u.isp2300.host_status);if (stat &HSR_RISC_PAUSED ) {
@@ -211,7 +209,7 @@ qla2300_intr_handler(int irq, void *dev_id)WRT_REG_WORD (®->hccr,HCCR_CLR_RISC_INT );RD_REG_WORD_RELAXED (®->hccr); } -spin_unlock_irqrestore (&ha->hardware_lock, flags); +spin_unlock (&ha->hardware_lock);if (test_bit (MBX_INTR_WAIT , &ha->mbx_cmd_flags) && (status &MBX_INTERRUPT ) && ha->flags.mbox_int) {
@@ -1533,7 +1531,6 @@ qla24xx_intr_handler(int irq, void *dev_id)scsi_qla_host_t *ha;struct device_reg_24xx __iomem *reg;int status; -unsigned long flags;unsigned long iter;uint32_t stat;uint32_t hccr;
@@ -1549,7 +1546,7 @@ qla24xx_intr_handler(int irq, void *dev_id) reg = &ha->iobase->isp24; status =0 ; -spin_lock_irqsave (&ha->hardware_lock, flags); +spin_lock (&ha->hardware_lock);for (iter =50 ; iter--; ) { stat =RD_REG_DWORD (®->host_status);if (stat &HSRX_RISC_PAUSED ) {
@@ -1597,7 +1594,7 @@ qla24xx_intr_handler(int irq, void *dev_id)WRT_REG_DWORD (®->hccr,HCCRX_CLR_RISC_INT );RD_REG_DWORD_RELAXED (®->hccr); } -spin_unlock_irqrestore (&ha->hardware_lock, flags); +spin_unlock (&ha->hardware_lock);if (test_bit (MBX_INTR_WAIT , &ha->mbx_cmd_flags) && (status &MBX_INTERRUPT ) && ha->flags.mbox_int) {
@@ -1656,18 +1653,16 @@ qla24xx_msix_rsp_q(int irq, void *dev_id) {scsi_qla_host_t *ha;struct device_reg_24xx __iomem *reg; -unsigned long flags; ha = dev_id; reg = &ha->iobase->isp24; -spin_lock_irqsave (&ha->hardware_lock, flags); +spin_lock (&ha->hardware_lock);qla24xx_process_response_queue (ha); -WRT_REG_DWORD (®->hccr,HCCRX_CLR_RISC_INT ); -spin_unlock_irqrestore (&ha->hardware_lock, flags); +spin_unlock (&ha->hardware_lock);return IRQ_HANDLED ; }
@@ -1678,7 +1673,6 @@ qla24xx_msix_default(int irq, void *dev_id)scsi_qla_host_t *ha;struct device_reg_24xx __iomem *reg;int status; -unsigned long flags;uint32_t stat;uint32_t hccr;uint16_t mb[4 ];
@@ -1687,7 +1681,7 @@ qla24xx_msix_default(int irq, void *dev_id) reg = &ha->iobase->isp24; status =0 ; -spin_lock_irqsave (&ha->hardware_lock, flags); +spin_lock (&ha->hardware_lock); do { stat = RD_REG_DWORD(®->host_status); if (stat & HSRX_RISC_PAUSED) {
@@ -1734,7 +1728,7 @@ qla24xx_msix_default(int irq, void *dev_id) }WRT_REG_DWORD (®->hccr,HCCRX_CLR_RISC_INT ); }while (0 ); -spin_unlock_irqrestore (&ha->hardware_lock, flags); +spin_unlock (&ha->hardware_lock);if (test_bit (MBX_INTR_WAIT , &ha->mbx_cmd_flags) && (status &MBX_INTERRUPT ) && ha->flags.mbox_int) {
@@ -1821,7 +1815,6 @@ 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))
@@ -1882,7 +1875,7 @@ skip_msi: clear_risc_ints: ha->isp_ops->disable_intrs (ha); -spin_lock_irqsave (&ha->hardware_lock, flags); +spin_lock_irq (&ha->hardware_lock);if (IS_FWI2_CAPABLE (ha)) {WRT_REG_DWORD (®->isp24.hccr,HCCRX_CLR_HOST_INT );WRT_REG_DWORD (®->isp24.hccr,HCCRX_CLR_RISC_INT );
@@ -1891,7 +1884,7 @@ clear_risc_ints: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); +spin_unlock_irq (&ha->hardware_lock); ha->isp_ops->enable_intrs (ha); fail:
Signature · 1 line
1.5.5.rc2
James Bottomley
maintainerRe: [PATCH 06/21] qla2xxx: Simplify interrupt handler locking.
Quoted 5 lines · Andrew Vasquez
There's no need to use the heavier (albiet safer) *_irq[save|restore]() locking primitives within the driver's interrupt handlers, interrupts are guaranteed to be non-reentrant. Use lightweight
spin_lock()andspin_unlock()primitives while acquiring thehardware_lock.
The above statement isn't entirely true: interrupts are not guaranteed to be non re-entrant. They are guaranteed not to be re-entered from the *same* interrupt, but if you've got more than one card, the interrupt routine can be executing simultaneously on an SMP system which is in contravention of the classical definition of re-entrancy.
So, the rules for locks in interrupt is that as long as the lock is unique per interrupting instance (which it looks like yours are) you can get away with not requiring interrupt disables within critical sections but if you have a more global lock which could be taken by different interrupting entities then you must do interrupt disables still.
James
Re: [PATCH 06/21] qla2xxx: Simplify interrupt handler locking.
Quoted 7 lines · James Bottomley
Quoted 5 lines · Andrew Vasquez
There's no need to use the heavier (albiet safer) *_irq[save|restore]() locking primitives within the driver's interrupt handlers, interrupts are guaranteed to be non-reentrant. Use lightweight
spin_lock()andspin_unlock()primitives while acquiring thehardware_lock.
Quoted 8 lines
The above statement isn't entirely true: interrupts are not guaranteed to be non re-entrant. They are guaranteed not to be re-entered from the *same* interrupt, but if you've got more than one card, the interrupt routine can be executing simultaneously on an SMP system which is in contravention of the classical definition of re-entrancy.
So, the rules for locks in interrupt is that as long as the lock is unique per interrupting instance (which it looks like yours are)
They are...
Quoted 4 lines
you can
get away with not requiring interrupt disables within critical sections but if you have a more global lock which could be taken by different interrupting entities then you must do interrupt disables still.
Thanks for the clarification. Would you like me to resubmit with an altered changelog or can the current one glide in?
Thanks, av
James Bottomley
maintainerRe: [PATCH 06/21] qla2xxx: Simplify interrupt handler locking.
Quoted 15 lines · Andrew Vasquez
Quoted 13 lines · James Bottomley
Quoted 5 lines · Andrew Vasquez
There's no need to use the heavier (albiet safer) *_irq[save|restore]() locking primitives within the driver's interrupt handlers, interrupts are guaranteed to be non-reentrant. Use lightweight
spin_lock()andspin_unlock()primitives while acquiring thehardware_lock.The above statement isn't entirely true: interrupts are not guaranteed to be non re-entrant. They are guaranteed not to be re-entered from the *same* interrupt, but if you've got more than one card, the interrupt routine can be executing simultaneously on an SMP system which is in contravention of the classical definition of re-entrancy.
Quoted 4 lines
Quoted 2 lines
So, the rules for locks in interrupt is that as long as the lock is unique per interrupting instance (which it looks like yours are)
They are...
Thanks.
Quoted 7 lines
Quoted 4 lines
you can
get away with not requiring interrupt disables within critical sections but if you have a more global lock which could be taken by different interrupting entities then you must do interrupt disables still.Thanks for the clarification. Would you like me to resubmit with an altered changelog or can the current one glide in?
No .. that's OK ... I can't think of a better way to word it that won't take up whole sentences.
James
PATCH 7/21 qla2xxx: Add FC-transport Asynchronous Event Notification support.
In reply to Andrew VasquezSupported events include LIP, LIP reset, RSCN, link up, and link down.
To support AEN (and additional forthcoming features), we also introduce a simple deferred-work construct to manage events which require a non-atomic sleeping-capable context. This work-list is processed as part of the driver's standard DPC routine.
--- drivers/scsi/qla2xxx/qla_def.h | 22 ++++++++++++ drivers/scsi/qla2xxx/qla_gbl.h | 2 + drivers/scsi/qla2xxx/qla_isr.c | 5 +++ drivers/scsi/qla2xxx/qla_os.c | 73 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +22 -0
@@ -2115,6 +2115,26 @@ struct qla_msix_entry {#define WATCH_INTERVAL 1/* number of seconds */ +/* Work events. */ +enum qla_work_type { +QLA_EVT_AEN , +}; + + +struct qla_work_evt { +struct list_head list; +enum qla_work_type type; +u32 flags; +#define QLA_EVT_FLAG_FREE 0x1 + +union { +struct { +enum fc_host_event_code code; +u32 data; + } aen; + } u; +}; +/* * Linux Host Adapter structure */
@@ -2354,6 +2374,8 @@ typedef struct scsi_qla_host {uint32_t login_retry_count;int max_q_depth; +struct list_head work_list; +/* Fibre Channel Device List. */ struct list_head fcports;
drivers/scsi/qla2xxx/qla_gbl.h +2 -0
@@ -67,6 +67,8 @@ extern int num_hosts;extern int qla2x00_loop_reset (scsi_qla_host_t *);extern void qla2x00_abort_all_cmds (scsi_qla_host_t *,int ); +extern int qla2x00_post_aen_work (struct scsi_qla_host *,enum +fc_host_event_code ,u32 );/* * Global Functions in qla_mid.c source file.
drivers/scsi/qla2xxx/qla_isr.c +5 -0
@@ -408,6 +408,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)set_bit (REGISTER_FC4_NEEDED , &ha->dpc_flags); ha->flags.management_server_logged_in =0 ; +qla2x00_post_aen_work (ha,FCH_EVT_LIP , mb[1 ]);break ;case MBA_LOOP_UP :/* Loop Up Event */
@@ -427,6 +428,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) link_speed); ha->flags.management_server_logged_in =0 ; +qla2x00_post_aen_work (ha,FCH_EVT_LINKUP , ha->link_data_rate);break ;case MBA_LOOP_DOWN :/* Loop Down Event */
@@ -450,6 +452,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) ha->link_data_rate =PORT_SPEED_UNKNOWN ;if (ql2xfdmienable)set_bit (REGISTER_FDMI_NEEDED , &ha->dpc_flags); +qla2x00_post_aen_work (ha,FCH_EVT_LINKDOWN ,0 );break ;case MBA_LIP_RESET :/* LIP reset occurred */
@@ -473,6 +476,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) ha->operating_mode =LOOP ; ha->flags.management_server_logged_in =0 ; +qla2x00_post_aen_work (ha,FCH_EVT_LIPRESET , mb[1 ]);break ;case MBA_POINT_TO_POINT :/* Point-to-Point */
@@ -610,6 +614,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)set_bit (LOOP_RESYNC_NEEDED , &ha->dpc_flags);set_bit (RSCN_UPDATE , &ha->dpc_flags); +qla2x00_post_aen_work (ha,FCH_EVT_RSCN , rscn_entry);break ;/* case MBA_RIO_RESPONSE: */
drivers/scsi/qla2xxx/qla_os.c +73 -0
91 lines not on this page · raw message
Signature · 1 line
1.5.5.rc2
PATCH 8/21 qla2xxx: Add hardware trace-logging support.
In reply to Andrew VasquezRecent ISPs have a region within FLASH which acts as a repository for the logging of serious hardware and software failures. Currently, the region is large enough to support up to 255 entries.
--- drivers/scsi/qla2xxx/qla_def.h | 10 +++ drivers/scsi/qla2xxx/qla_fw.h | 14 +++- drivers/scsi/qla2xxx/qla_gbl.h | 5 + drivers/scsi/qla2xxx/qla_init.c | 11 +++ drivers/scsi/qla2xxx/qla_isr.c | 15 ++++ drivers/scsi/qla2xxx/qla_mbx.c | 8 ++ drivers/scsi/qla2xxx/qla_os.c | 23 ++++++ drivers/scsi/qla2xxx/qla_sup.c | 168 +++++++++++++++++++++++++++++++++------ 8 files changed, 229 insertions(+), 25 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +10 -0
@@ -2118,6 +2118,7 @@ struct qla_msix_entry {/* Work events. */ enum qla_work_type {QLA_EVT_AEN , +QLA_EVT_HWE_LOG , };
@@ -2132,6 +2133,10 @@ struct qla_work_evt {enum fc_host_event_code code;u32 data; } aen; +struct { +uint16_t code; +uint16_t d1, d2, d3; + } hwe; } u; };
@@ -2173,6 +2178,7 @@ typedef struct scsi_qla_host { uint32_t vsan_enabled :1; uint32_t npiv_supported :1; uint32_t fce_enabled :1; + uint32_t hw_event_marker_found :1; } flags;atomic_t loop_state;
@@ -2478,6 +2484,10 @@ typedef struct scsi_qla_host {uint64_t fce_wr, fce_rd;struct mutex fce_mutex; +uint32_t hw_event_start; +uint32_t hw_event_ptr; +uint32_t hw_event_pause_errors; +uint8_t host_str[16 ];uint32_t pci_attr;uint16_t chip_revision;
drivers/scsi/qla2xxx/qla_fw.h +13 -1
@@ -793,7 +793,19 @@ struct device_reg_24xx {#define FA_VPD_NVRAM_ADDR 0x48000#define FA_FEATURE_ADDR 0x4C000#define FA_FLASH_DESCR_ADDR 0x50000 -#define FA_HW_EVENT_ADDR 0x54000 +#define FA_HW_EVENT0_ADDR 0x54000 +#define FA_HW_EVENT1_ADDR 0x54200 +#define FA_HW_EVENT_SIZE 0x200 +#define FA_HW_EVENT_ENTRY_SIZE 4 +/* +* Flash Error Log Event Codes. +*/ +#define HW_EVENT_RESET_ERR 0xF00B +#define HW_EVENT_ISP_ERR 0xF020 +#define HW_EVENT_PARITY_ERR 0xF022 +#define HW_EVENT_NVRAM_CHKSUM_ERR 0xF023 +#define HW_EVENT_FLASH_FW_ERR 0xF024 +#define FA_BOOT_LOG_ADDR 0x58000#define FA_FW_DUMP0_ADDR 0x60000#define FA_FW_DUMP1_ADDR 0x70000
drivers/scsi/qla2xxx/qla_gbl.h +5 -0
@@ -69,6 +69,8 @@ extern int qla2x00_loop_reset(scsi_qla_host_t *);extern void qla2x00_abort_all_cmds (scsi_qla_host_t *,int );extern int qla2x00_post_aen_work (struct scsi_qla_host *,enum fc_host_event_code ,u32 ); +extern int qla2x00_post_hwe_work (struct scsi_qla_host *,uint16_t ,uint16_t , +uint16_t ,uint16_t );/* * Global Functions in qla_mid.c source file.
@@ -298,6 +300,9 @@ extern uint8_t *qla25xx_read_optrom_data(struct scsi_qla_host *, uint8_t *,extern int qla2x00_get_flash_version (scsi_qla_host_t *,void *);extern int qla24xx_get_flash_version (scsi_qla_host_t *,void *); +extern int qla2xxx_hw_event_log (scsi_qla_host_t *,uint16_t ,uint16_t , +uint16_t ,uint16_t ); +/* * Global Function Prototypes in qla_dbg.c source file. */
drivers/scsi/qla2xxx/qla_init.c +11 -0
@@ -500,6 +500,7 @@ qla2x00_reset_chip(scsi_qla_host_t *ha)static inline void qla24xx_reset_risc (scsi_qla_host_t *ha) { +int hw_evt =0 ;unsigned long flags =0 ;struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;uint32_t cnt, d2;
@@ -528,6 +529,8 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) d2 = (uint32_t )RD_REG_WORD (®->mailbox0);barrier (); } +if (cnt ==0 ) + hw_evt =1 ;/* Wait for soft-reset to complete. */ d2 =RD_REG_DWORD (®->ctrl_status);
@@ -536,6 +539,10 @@ qla24xx_reset_risc(scsi_qla_host_t *ha) d2 =RD_REG_DWORD (®->ctrl_status);barrier (); } +if (cnt ==0 || hw_evt) +qla2xxx_hw_event_log (ha,HW_EVENT_RESET_ERR , +RD_REG_WORD (®->mailbox1),RD_REG_WORD (®->mailbox2), +RD_REG_WORD (®->mailbox3));WRT_REG_DWORD (®->hccr,HCCRX_SET_RISC_RESET );RD_REG_DWORD (®->hccr);
@@ -1555,6 +1562,10 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)qla_printk (KERN_WARNING , ha,"Falling back to functioning (yet " "invalid -- WWPN) defaults.\n" ); +if (chksum) +qla2xxx_hw_event_log (ha,HW_EVENT_NVRAM_CHKSUM_ERR ,0 , +MSW (chksum),LSW (chksum)); +/* * Set default initialization control block. */
drivers/scsi/qla2xxx/qla_isr.c +15 -0
@@ -349,6 +349,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)"ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n" , mb[1], mb[2], mb[3]); +qla2x00_post_hwe_work (ha, mb[0 ], mb[1 ], mb[2 ], mb[3 ]); ha->isp_ops->fw_dump (ha,1 );if (IS_FWI2_CAPABLE (ha)) {
@@ -373,6 +374,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) ha->host_no));qla_printk (KERN_WARNING , ha,"ISP Request Transfer Error.\n" ); +qla2x00_post_hwe_work (ha, mb[0 ], mb[1 ], mb[2 ], mb[3 ]);set_bit (ISP_ABORT_NEEDED , &ha->dpc_flags);break ;
@@ -381,6 +383,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) ha->host_no));qla_printk (KERN_WARNING , ha,"ISP Response Transfer Error.\n" ); +qla2x00_post_hwe_work (ha, mb[0 ], mb[1 ], mb[2 ], mb[3 ]);set_bit (ISP_ABORT_NEEDED , &ha->dpc_flags);break ;
@@ -1558,6 +1561,12 @@ qla24xx_intr_handler(int irq, void *dev_id)if (pci_channel_offline (ha->pdev))break ; +if (ha->hw_event_pause_errors ==0 ) +qla2x00_post_hwe_work (ha,HW_EVENT_PARITY_ERR , +0 ,MSW (stat),LSW (stat)); +else if (ha->hw_event_pause_errors <0xffffffff ) + ha->hw_event_pause_errors++; + hccr =RD_REG_DWORD (®->hccr); qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, "
@@ -1693,6 +1702,12 @@ qla24xx_msix_default(int irq, void *dev_id)if (pci_channel_offline (ha->pdev))break ; +if (ha->hw_event_pause_errors ==0 ) +qla2x00_post_hwe_work (ha,HW_EVENT_PARITY_ERR , +0 ,MSW (stat),LSW (stat)); +else if (ha->hw_event_pause_errors <0xffffffff ) + ha->hw_event_pause_errors++; + hccr =RD_REG_DWORD (®->hccr); qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, "
drivers/scsi/qla2xxx/qla_mbx.c +8 -0
@@ -587,6 +587,14 @@ qla2x00_mbx_reg_test(scsi_qla_host_t *ha)if (mcp->mb[5 ] !=0xA5A5 || mcp->mb[6 ] !=0x5A5A || mcp->mb[7 ] !=0x2525 ) rval =QLA_FUNCTION_FAILED ; +if (rval ==QLA_FUNCTION_FAILED ) { +struct device_reg_24xx __iomem *reg = + &ha->iobase->isp24; + +qla2xxx_hw_event_log (ha,HW_EVENT_ISP_ERR ,0 , +LSW (RD_REG_DWORD (®->hccr)), +LSW (RD_REG_DWORD (®->istatus))); + } }if (rval !=QLA_SUCCESS ) {
drivers/scsi/qla2xxx/qla_os.c +23 -0
@@ -1690,6 +1690,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->gid_list_info_size =8 ; ha->optrom_size =OPTROM_SIZE_25XX ; ha->isp_ops = &qla25xx_isp_ops; + ha->hw_event_start =PCI_FUNC (pdev->devfn) ? +FA_HW_EVENT1_ADDR :FA_HW_EVENT0_ADDR ; } host->can_queue = ha->request_q_length +128 ;
@@ -2244,6 +2246,23 @@ qla2x00_post_aen_work(struct scsi_qla_host *ha, enum fc_host_event_code code,return qla2x00_post_work (ha, e,1 ); } +int +qla2x00_post_hwe_work (struct scsi_qla_host *ha,uint16_t code,uint16_t d1, +uint16_t d2,uint16_t d3) +{ +struct qla_work_evt *e; + + e =qla2x00_alloc_work (ha,QLA_EVT_HWE_LOG ,1 ); +if (!e) +return QLA_FUNCTION_FAILED ; + + e->u.hwe.code = code; + e->u.hwe.d1 = d1; + e->u.hwe.d2 = d2; + e->u.hwe.d3 = d3; +return qla2x00_post_work (ha, e,1 ); +} +static void qla2x00_do_work (struct scsi_qla_host *ha) {
@@ -2260,6 +2279,10 @@ qla2x00_do_work(struct scsi_qla_host *ha)fc_host_post_event (ha->host,fc_get_event_number (), e->u.aen.code, e->u.aen.data);break ; +case QLA_EVT_HWE_LOG : +qla2xxx_hw_event_log (ha, e->u.hwe.code, e->u.hwe.d1, + e->u.hwe.d2, e->u.hwe.d3); +break ; }if (e->flags &QLA_EVT_FLAG_FREE )kfree (e);
drivers/scsi/qla2xxx/qla_sup.c +144 -24
196 lines not on this page · raw message
Signature · 1 line
1.5.5.rc2
PATCH 9/21 qla2xxx: Cruft cleanup of functions and structures.
In reply to Andrew VasquezStrip unused (DEBUG-ONLY) enabled functions, inlines, useless wrappers, and unused DPC flags from the code. Another step in the migration towards a cleaner (less-crusty) driver.
--- drivers/scsi/qla2xxx/qla_dbg.c | 122 ------------------------------------- drivers/scsi/qla2xxx/qla_dbg.h | 13 ---- drivers/scsi/qla2xxx/qla_def.h | 2 - drivers/scsi/qla2xxx/qla_gbl.h | 4 - drivers/scsi/qla2xxx/qla_gs.c | 6 -- drivers/scsi/qla2xxx/qla_init.c | 41 ------------ drivers/scsi/qla2xxx/qla_inline.h | 85 ------------------------- drivers/scsi/qla2xxx/qla_iocb.c | 3 - drivers/scsi/qla2xxx/qla_isr.c | 90 --------------------------- drivers/scsi/qla2xxx/qla_mid.c | 2 - drivers/scsi/qla2xxx/qla_os.c | 62 +------------------ 11 files changed, 2 insertions(+), 428 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +0 -122
@@ -1410,125 +1410,3 @@ qla2x00_dump_buffer(uint8_t * b, uint32_t size)if (cnt %16 )printk ("\n" ); } - -/************************************************************************** -* qla2x00_print_scsi_cmd -* Dumps out info about the scsi cmd and srb. -* Input -* cmd : struct scsi_cmnd -**************************************************************************/ -void -qla2x00_print_scsi_cmd (struct scsi_cmnd * cmd) -{ -int i; -struct scsi_qla_host *ha; -srb_t *sp; - - ha =shost_priv (cmd->device->host); - - sp = (srb_t *) cmd->SCp.ptr; -printk ("SCSI Command @=0x%p, Handle=0x%p\n" , cmd, cmd->host_scribble); -printk (" chan=0x%02x, target=0x%02x, lun=0x%02x, cmd_len=0x%02x\n" , - cmd->device->channel, cmd->device->id, cmd->device->lun, - cmd->cmd_len); -printk (" CDB: " ); -for (i =0 ; i < cmd->cmd_len; i++) { -printk ("0x%02x " , cmd->cmnd[i]); - } -printk ("\n seg_cnt=%d, allowed=%d, retries=%d\n" , -scsi_sg_count (cmd), cmd->allowed, cmd->retries); -printk (" request buffer=0x%p, request buffer len=0x%x\n" , -scsi_sglist (cmd),scsi_bufflen (cmd)); -printk (" tag=%d, transfersize=0x%x\n" , - cmd->tag, cmd->transfersize); -printk (" serial_number=%lx, SP=%p\n" , cmd->serial_number, sp); -printk (" data direction=%d\n" , cmd->sc_data_direction); - -if (!sp) -return ; - -printk (" sp flags=0x%x\n" , sp->flags); -} - -#if defined(QL_DEBUG_ROUTINES ) -/* -* qla2x00_formatted_dump_buffer -* Prints string plus buffer. -* -* Input: -* string = Null terminated string (no newline at end). -* buffer = buffer address. -* wd_size = word size 8, 16, 32 or 64 bits -* count = number of words. -*/ -void -qla2x00_formatted_dump_buffer (char *string,uint8_t * buffer, -uint8_t wd_size,uint32_t count) -{ -uint32_t cnt; -uint16_t *buf16; -uint32_t *buf32; - -if (strcmp (string,"" ) !=0 ) -printk ("%s\n" ,string); - -switch (wd_size) { -case 8 : -printk (" 0 1 2 3 4 5 6 7 " -"8 9 Ah Bh Ch Dh Eh Fh\n" ); -printk ("-----------------------------------------" -"-------------------------------------\n" ); - -for (cnt =1 ; cnt <= count; cnt++, buffer++) { -printk ("%02x" ,*buffer); -if (cnt %16 ==0 ) -printk ("\n" ); -else -printk (" " ); - } -if (cnt %16 !=0 ) -printk ("\n" ); -break ; -case 16 : -printk (" 0 2 4 6 8 Ah " -" Ch Eh\n" ); -printk ("-----------------------------------------" -"-------------\n" ); - - buf16 = (uint16_t *) buffer; -for (cnt =1 ; cnt <= count; cnt++, buf16++) { -printk ("%4x" ,*buf16); - -if (cnt %8 ==0 ) -printk ("\n" ); -else if (*buf16 <10 ) -printk (" " ); -else -printk (" " ); - } -if (cnt %8 !=0 ) -printk ("\n" ); -break ; -case 32 : -printk (" 0 4 8 Ch\n" ); -printk ("------------------------------------------\n" ); - - buf32 = (uint32_t *) buffer; -for (cnt =1 ; cnt <= count; cnt++, buf32++) { -printk ("%8x" , *buf32); - -if (cnt %4 ==0 ) -printk ("\n" ); -else if (*buf32 <10 ) -printk (" " ); -else -printk (" " ); - } -if (cnt %4 !=0 ) -printk ("\n" ); -break ; -default : -break ; - } -} -#endif
drivers/scsi/qla2xxx/qla_dbg.h +0 -13
@@ -22,19 +22,6 @@/* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */ /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */ /* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */ -/* -* Local Macro Definitions. -*/ -#if defined(QL_DEBUG_LEVEL_1 ) || defined(QL_DEBUG_LEVEL_2 ) || \ - defined(QL_DEBUG_LEVEL_3 ) || defined(QL_DEBUG_LEVEL_4 ) || \ - defined(QL_DEBUG_LEVEL_5 ) || defined(QL_DEBUG_LEVEL_6 ) || \ - defined(QL_DEBUG_LEVEL_7 ) || defined(QL_DEBUG_LEVEL_8 ) || \ - defined(QL_DEBUG_LEVEL_9 ) || defined(QL_DEBUG_LEVEL_10 ) || \ - defined(QL_DEBUG_LEVEL_11 ) || defined(QL_DEBUG_LEVEL_12 ) || \ - defined(QL_DEBUG_LEVEL_13 ) || defined(QL_DEBUG_LEVEL_14 ) || \ - defined(QL_DEBUG_LEVEL_15 ) -#define QL_DEBUG_ROUTINES -#endif /* * Macros use for debugging the driver.
drivers/scsi/qla2xxx/qla_def.h +0 -2
@@ -2449,8 +2449,6 @@ typedef struct scsi_qla_host {#define MBX_TIMEDOUT BIT_5#define MBX_ACCESS_TIMEDOUT BIT_6 -mbx_cmd_t mc; -/* Basic firmware related information. */ uint16_t fw_major_version;uint16_t fw_minor_version;
drivers/scsi/qla2xxx/qla_gbl.h +0 -4
@@ -38,9 +38,6 @@ extern int qla2x00_loop_resync(scsi_qla_host_t *);extern int qla2x00_fabric_login (scsi_qla_host_t *,fc_port_t *,uint16_t *);extern int qla2x00_local_device_login (scsi_qla_host_t *,fc_port_t *); -extern void qla2x00_restart_queues (scsi_qla_host_t *,uint8_t ); - -extern void qla2x00_rescan_fcports (scsi_qla_host_t *);extern void qla2x00_update_fcports (scsi_qla_host_t *);extern int qla2x00_abort_isp (scsi_qla_host_t *);
@@ -312,7 +309,6 @@ extern void qla24xx_fw_dump(scsi_qla_host_t *, int);extern void qla25xx_fw_dump (scsi_qla_host_t *,int );extern void qla2x00_dump_regs (scsi_qla_host_t *);extern void qla2x00_dump_buffer (uint8_t *,uint32_t ); -extern void qla2x00_print_scsi_cmd (struct scsi_cmnd *);/* * Global Function Prototypes in qla_gs.c source file.
drivers/scsi/qla2xxx/qla_gs.c +0 -6
@@ -6,12 +6,6 @@*/ #include "qla_def.h" -static inline struct ct_sns_req * -qla2x00_prep_ct_req (struct ct_sns_req *,uint16_t ,uint16_t ); - -static inline struct sns_cmd_pkt * -qla2x00_prep_sns_cmd (scsi_qla_host_t *,uint16_t ,uint16_t ,uint16_t ); -static int qla2x00_sns_ga_nxt (scsi_qla_host_t *,fc_port_t *);static int qla2x00_sns_gid_pt (scsi_qla_host_t *,sw_info_t *);static int qla2x00_sns_gpn_id (scsi_qla_host_t *,sw_info_t *);
drivers/scsi/qla2xxx/qla_init.c +0 -41
59 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_inline.h +0 -85
115 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_iocb.c +0 -3
@@ -11,9 +11,6 @@#include <scsi/scsi_tcq.h> -static inline uint16_t qla2x00_get_cmd_direction (struct scsi_cmnd *cmd); -static inline cont_entry_t *qla2x00_prep_cont_type0_iocb (scsi_qla_host_t *); -static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb (scsi_qla_host_t *);static request_t *qla2x00_req_pkt (scsi_qla_host_t *ha);static void qla2x00_isp_cmd (scsi_qla_host_t *ha);
drivers/scsi/qla2xxx/qla_isr.c +0 -90
120 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_mid.c +0 -2
@@ -16,8 +16,6 @@#include <scsi/scsicam.h> #include <linux/delay.h> -void qla2x00_vp_stop_timer (scsi_qla_host_t *); -void qla2x00_vp_stop_timer (scsi_qla_host_t *vha) {
drivers/scsi/qla2xxx/qla_os.c +2 -60
124 lines not on this page · raw message
Signature · 1 line
1.5.5.rc2
PATCH 10/21 qla2xxx: Use PCI-SIG nomenclature for PCIe bandwidth units.
In reply to Andrew Vasquez--- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +2 -2
@@ -249,9 +249,9 @@ qla24xx_pci_info_str(struct scsi_qla_host *ha, char *str)strcpy (str,"PCIe (" );if (lspeed ==1 ) -strcat (str,"2.5Gb/s " ); +strcat (str,"2.5GT/s " );else if (lspeed ==2 ) -strcat (str,"5.0Gb/s " ); +strcat (str,"5.0GT/s " );else strcat (str,"<unknown> " );snprintf (lwstr,sizeof (lwstr),"x%d)" , lwidth);
Signature · 1 line
1.5.5.rc2
PATCH 11/21 qla2xxx: Add Flash Descriptor Table layout support.
In reply to Andrew VasquezThe Flash Descriptor Table (FDT) present on many recent HBAs encodes flash accessing characteristics of the flash-part used on the HBA. Use this information during flash manipulation (writes) rather than using specific hard-coded values based on queried manufacturer and device IDs.
--- drivers/scsi/qla2xxx/qla_def.h | 7 ++ drivers/scsi/qla2xxx/qla_fw.h | 32 ++++++++ drivers/scsi/qla2xxx/qla_gbl.h | 2 + drivers/scsi/qla2xxx/qla_init.c | 1 + drivers/scsi/qla2xxx/qla_sup.c | 153 ++++++++++++++++++++++++++++----------- 5 files changed, 152 insertions(+), 43 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +7 -0
@@ -2521,6 +2521,13 @@ typedef struct scsi_qla_host {uint8_t fcode_revision[16 ];uint32_t fw_revision[4 ]; +uint16_t fdt_odd_index; +uint32_t fdt_wrt_disable; +uint32_t fdt_erase_cmd; +uint32_t fdt_block_size; +uint32_t fdt_unprotect_sec_cmd; +uint32_t fdt_protect_sec_cmd; +/* Needed for BEACON */ uint16_t beacon_blink_led;uint8_t beacon_color_state;
drivers/scsi/qla2xxx/qla_fw.h +32 -0
@@ -1186,4 +1186,36 @@ struct vf_evfp_entry_24xx { };/* END MID Support ***********************************************************/ + +/* Flash Description Table ***************************************************/ + +struct qla_fdt_layout { +uint8_t sig[4 ]; +uint16_t version; +uint16_t len; +uint16_t checksum; +uint8_t unused1[2 ]; +uint8_t model[16 ]; +uint16_t man_id; +uint16_t id; +uint8_t flags; +uint8_t erase_cmd; +uint8_t alt_erase_cmd; +uint8_t wrt_enable_cmd; +uint8_t wrt_enable_bits; +uint8_t wrt_sts_reg_cmd; +uint8_t unprotect_sec_cmd; +uint8_t read_man_id_cmd; +uint32_t block_size; +uint32_t alt_block_size; +uint32_t flash_size; +uint32_t wrt_enable_data; +uint8_t read_id_addr_len; +uint8_t wrt_disable_bits; +uint8_t read_dev_id_len; +uint8_t chip_erase_cmd; +uint16_t read_timeout; +uint8_t protect_sec_cmd; +uint8_t unused2[65 ]; +};#endif
drivers/scsi/qla2xxx/qla_gbl.h +2 -0
@@ -300,6 +300,8 @@ extern int qla24xx_get_flash_version(scsi_qla_host_t *, void *);extern int qla2xxx_hw_event_log (scsi_qla_host_t *,uint16_t ,uint16_t ,uint16_t ,uint16_t ); +extern void qla2xxx_get_flash_info (scsi_qla_host_t *); +/* * Global Function Prototypes in qla_dbg.c source file. */
drivers/scsi/qla2xxx/qla_init.c +1 -0
@@ -106,6 +106,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha) rval =qla2x00_setup_chip (ha);if (rval)return (rval); +qla2xxx_get_flash_info (ha); } rval =qla2x00_init_rings (ha);
drivers/scsi/qla2xxx/qla_sup.c +110 -43
212 lines not on this page · raw message
Signature · 1 line
1.5.5.rc2
PATCH 12/21 qla2xxx: Check alternate 'reason' code during GPSC status handling.
In reply to Andrew VasquezSome switches return 0x09 (Command not supported) as the reason code for GPSC failure. Check for this code, and disable additional GPSC queries if found.
--- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_gs.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +1 -0
@@ -1611,6 +1611,7 @@ typedef struct fc_port {#define CT_ACCEPT_RESPONSE 0x8002#define CT_REASON_INVALID_COMMAND_CODE 0x01#define CT_REASON_CANNOT_PERFORM 0x09 +#define CT_REASON_COMMAND_UNSUPPORTED 0x0b#define CT_EXPL_ALREADY_REGISTERED 0x10#define NS_N_PORT_TYPE 0x01
drivers/scsi/qla2xxx/qla_gs.c +4 -2
@@ -1841,8 +1841,10 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) "GPSC")) != QLA_SUCCESS) {/* FM command unsupported? */ if (rval ==QLA_INVALID_COMMAND && - ct_rsp->header.reason_code == -CT_REASON_INVALID_COMMAND_CODE ) { + (ct_rsp->header.reason_code == +CT_REASON_INVALID_COMMAND_CODE || + ct_rsp->header.reason_code == +CT_REASON_COMMAND_UNSUPPORTED )) {DEBUG2 (printk ("scsi(%ld): GPSC command " "unsupported, disabling query...\n" , ha->host_no));
Signature · 1 line
1.5.5.rc2
PATCH 13/21 qla2xxx: Add midlayer target/device reset support.
In reply to Andrew VasquezNow that infrastructure is present within the midlayer and there is a clear distinction between what is expected from a device and target reset, convert the current device-reset codes to a target-reset, and add codes to perform a proper device-reset (LUN reset).
In the process of adding reset support, collapse and consolidate large sections of mailbox-command (TMF issuance) codes, generalize the two 'wait-for-commands-to-complete' functions, and add a generic-reset routine for use by midlayer reset functions.
--- drivers/scsi/qla2xxx/qla_def.h | 3 +- drivers/scsi/qla2xxx/qla_fw.h | 2 +- drivers/scsi/qla2xxx/qla_gbl.h | 8 +- drivers/scsi/qla2xxx/qla_mbx.c | 123 +++++++++++++------- drivers/scsi/qla2xxx/qla_os.c | 254 ++++++++++++++++------------------------ 5 files changed, 192 insertions(+), 198 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +2 -1
@@ -2062,7 +2062,8 @@ struct isp_operations {void (*disable_intrs) (struct scsi_qla_host *);int (*abort_command) (struct scsi_qla_host *,srb_t *); -int (*abort_target) (struct fc_port *); +int (*target_reset) (struct fc_port *,unsigned int ); +int (*lun_reset) (struct fc_port *,unsigned int );int (*fabric_login) (struct scsi_qla_host *,uint16_t ,uint8_t ,uint8_t ,uint8_t ,uint16_t *,uint8_t ); int (*fabric_logout) (struct scsi_qla_host *, uint16_t, uint8_t,
drivers/scsi/qla2xxx/qla_fw.h +1 -1
@@ -719,7 +719,7 @@ struct tsk_mgmt_entry {uint16_t timeout;/* Command timeout. */ -uint8_t lun[8 ];/* FCP LUN (BE). */ +struct scsi_lun lun;/* FCP LUN (BE). */ uint32_t control_flags;/* Control Flags. */ #define TCF_NOTMCMD_TO_TARGET BIT_31
drivers/scsi/qla2xxx/qla_gbl.h +6 -2
@@ -153,7 +153,10 @@ extern int qla2x00_abort_command(scsi_qla_host_t *, srb_t *);extern int -qla2x00_abort_target (fc_port_t *); +qla2x00_abort_target (struct fc_port *,unsigned int ); + +extern int +qla2x00_lun_reset (struct fc_port *,unsigned int ); extern int qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
@@ -219,7 +222,8 @@ qla24xx_get_isp_stats(scsi_qla_host_t *, struct link_statistics *, dma_addr_t);extern int qla24xx_abort_command (scsi_qla_host_t *,srb_t *); -extern int qla24xx_abort_target (fc_port_t *); +extern int qla24xx_abort_target (struct fc_port *,unsigned int ); +extern int qla24xx_lun_reset (struct fc_port *,unsigned int );extern int qla2x00_set_serdes_params (scsi_qla_host_t *,uint16_t ,uint16_t ,uint16_t );
drivers/scsi/qla2xxx/qla_mbx.c +82 -41
203 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_os.c +101 -153
357 lines not on this page · raw message
Signature · 1 line
1.5.5.rc2
PATCH 14/21 qla2xxx: Assign mailbox command timeout values in a consistent manner.
In reply to Andrew VasquezFrom: Ravi Anand <[email protected]>
--- drivers/scsi/qla2xxx/qla_mbx.c | 62 ++++++++++++++++++++-------------------- 1 files changed, 31 insertions(+), 31 deletions(-)
drivers/scsi/qla2xxx/qla_mbx.c +31 -31
@@ -310,7 +310,7 @@ qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t risc_addr, } mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -367,7 +367,7 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr) } } - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -417,7 +417,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *ha, uint16_t *major, uint16_t *minor, mcp->out_mb =MBX_0 ; mcp->in_mb =MBX_6 |MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->flags =0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; rval =qla2x00_mailbox_command (ha, mcp);/* Return mailbox data. */
@@ -466,7 +466,7 @@ qla2x00_get_fw_options(scsi_qla_host_t *ha, uint16_t *fwopts) mcp->mb[0 ] =MBC_GET_FIRMWARE_OPTION ; mcp->out_mb =MBX_0 ; mcp->in_mb =MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -524,7 +524,7 @@ qla2x00_set_fw_options(scsi_qla_host_t *ha, uint16_t *fwopts) mcp->mb[12 ] =0 ;/* Undocumented, but used */ mcp->out_mb |=MBX_12 |MBX_11 |MBX_10 ; } - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -576,7 +576,7 @@ qla2x00_mbx_reg_test(scsi_qla_host_t *ha) mcp->mb[7 ] =0x2525 ; mcp->out_mb =MBX_7 |MBX_6 |MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_7 |MBX_6 |MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -648,7 +648,7 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr) mcp->in_mb |=MBX_1 ; } - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -697,7 +697,7 @@ qla2x00_issue_iocb(scsi_qla_host_t *ha, void* buffer, dma_addr_t phys_addr, mcp->mb[7 ] =LSW (MSD (phys_addr)); mcp->out_mb =MBX_7 |MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_2 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -768,7 +768,7 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp) mcp->mb[6 ] = (uint16_t )sp->cmd->device->lun; mcp->out_mb =MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -809,7 +809,7 @@ qla2x00_abort_target(struct fc_port *fcport, unsigned int l) mcp->mb[9 ] = ha->vp_idx; mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);if (rval !=QLA_SUCCESS ) {
@@ -851,7 +851,7 @@ qla2x00_lun_reset(struct fc_port *fcport, unsigned int l) mcp->mb[9 ] = ha->vp_idx; mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);if (rval !=QLA_SUCCESS ) {
@@ -906,7 +906,7 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa, mcp->mb[9 ] = ha->vp_idx; mcp->out_mb =MBX_9 |MBX_0 ; mcp->in_mb =MBX_9 |MBX_7 |MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);if (mcp->mb[0 ] ==MBS_COMMAND_ERROR )
@@ -963,7 +963,7 @@ qla2x00_get_retry_cnt(scsi_qla_host_t *ha, uint8_t *retry_cnt, uint8_t *tov, mcp->mb[0 ] =MBC_GET_RETRY_COUNT ; mcp->out_mb =MBX_0 ; mcp->in_mb =MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -1030,7 +1030,7 @@ qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size) mcp->in_mb =MBX_5 |MBX_4 |MBX_0 ; mcp->buf_size = size; mcp->flags =MBX_DMA_OUT ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; rval =qla2x00_mailbox_command (ha, mcp);if (rval !=QLA_SUCCESS ) {
@@ -1220,7 +1220,7 @@ qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr) mcp->mb[0 ] =MBC_GET_FIRMWARE_STATE ; mcp->out_mb =MBX_0 ; mcp->in_mb =MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -1281,7 +1281,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name, } mcp->in_mb =MBX_7 |MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -1353,7 +1353,7 @@ qla2x00_lip_reset(scsi_qla_host_t *ha) mcp->mb[3 ] =0 ; } mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -1778,7 +1778,7 @@ qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain, } mcp->in_mb =MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -1826,7 +1826,7 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha) mcp->mb[3 ] =0 ; mcp->out_mb =MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -1887,7 +1887,7 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma, mcp->out_mb |=MBX_6 |MBX_3 |MBX_2 |MBX_1 ; } mcp->in_mb =MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -1931,7 +1931,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, mcp->mb[0 ] =MBC_GET_RESOURCE_COUNTS ; mcp->out_mb =MBX_0 ; mcp->in_mb =MBX_11 |MBX_10 |MBX_7 |MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -2071,7 +2071,7 @@ qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id, mcp->mb[1 ] = loop_id <<8 ; mcp->out_mb |=MBX_1 ; } - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =IOCTL_CMD ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -2117,7 +2117,7 @@ qla24xx_get_isp_stats(scsi_qla_host_t *ha, struct link_statistics *stats, mcp->mb[10 ] =0 ; mcp->out_mb =MBX_10 |MBX_9 |MBX_8 |MBX_7 |MBX_6 |MBX_3 |MBX_2 |MBX_0 ; mcp->in_mb =MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =IOCTL_CMD ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -2351,7 +2351,7 @@ qla2x00_set_serdes_params(scsi_qla_host_t *ha, uint16_t sw_em_1g, mcp->mb[4 ] = sw_em_4g |BIT_15 ; mcp->out_mb =MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -2419,7 +2419,7 @@ qla2x00_enable_eft_trace(scsi_qla_host_t *ha, dma_addr_t eft_dma, mcp->mb[7 ] =TC_AEN_DISABLE ; mcp->out_mb =MBX_7 |MBX_6 |MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);if (rval !=QLA_SUCCESS ) {
@@ -2448,7 +2448,7 @@ qla2x00_disable_eft_trace(scsi_qla_host_t *ha) mcp->mb[1 ] =TC_EFT_DISABLE ; mcp->out_mb =MBX_1 |MBX_0 ; mcp->in_mb =MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);if (rval !=QLA_SUCCESS ) {
@@ -2488,7 +2488,7 @@ qla2x00_enable_fce_trace(scsi_qla_host_t *ha, dma_addr_t fce_dma, mcp->out_mb =MBX_10 |MBX_9 |MBX_8 |MBX_7 |MBX_6 |MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_6 |MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);if (rval !=QLA_SUCCESS ) {
@@ -2524,7 +2524,7 @@ qla2x00_disable_fce_trace(scsi_qla_host_t *ha, uint64_t *wr, uint64_t *rd) mcp->out_mb =MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_9 |MBX_8 |MBX_7 |MBX_6 |MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);if (rval !=QLA_SUCCESS ) {
@@ -2572,7 +2572,7 @@ qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr, mcp->mb[10 ] =0 ; mcp->out_mb =MBX_10 |MBX_9 |MBX_8 |MBX_7 |MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -2606,7 +2606,7 @@ qla2x00_set_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id, mcp->mb[4 ] = mcp->mb[5 ] =0 ; mcp->out_mb =MBX_5 |MBX_4 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_5 |MBX_4 |MBX_3 |MBX_1 |MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
@@ -2924,7 +2924,7 @@ qla2x00_dump_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t addr, } mcp->in_mb =MBX_0 ; - mcp->tov =30 ; + mcp->tov =MBX_TOV_SECONDS ; mcp->flags =0 ; rval =qla2x00_mailbox_command (ha, mcp);
Signature · 1 line
1.5.5.rc2
PATCH 15/21 qla2xxx: Add ISP84XX support.
In reply to Andrew VasquezFrom: Harihara Kadayam <[email protected]>
Additional cleanups and
--- drivers/scsi/qla2xxx/qla_attr.c | 2 +- drivers/scsi/qla2xxx/qla_dbg.h | 8 +++ drivers/scsi/qla2xxx/qla_def.h | 26 ++++++++- drivers/scsi/qla2xxx/qla_fw.h | 123 ++++++++++++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_gbl.h | 8 +++ drivers/scsi/qla2xxx/qla_gs.c | 2 +- drivers/scsi/qla2xxx/qla_init.c | 119 ++++++++++++++++++++++++++++++++++--- drivers/scsi/qla2xxx/qla_isr.c | 48 +++++++++++++-- drivers/scsi/qla2xxx/qla_mbx.c | 125 ++++++++++++++++++++++++++++++++++++-- drivers/scsi/qla2xxx/qla_os.c | 17 +++++- drivers/scsi/qla2xxx/qla_sup.c | 2 +- 11 files changed, 454 insertions(+), 26 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +1 -1
@@ -1291,7 +1291,7 @@ qla2x00_init_host_attr(scsi_qla_host_t *ha)if (IS_QLA25XX (ha)) speed =FC_PORTSPEED_8GBIT |FC_PORTSPEED_4GBIT |FC_PORTSPEED_2GBIT |FC_PORTSPEED_1GBIT ; -else if (IS_QLA24XX (ha) ||IS_QLA54XX (ha)) +else if (IS_QLA24XX_TYPE (ha)) speed =FC_PORTSPEED_4GBIT |FC_PORTSPEED_2GBIT |FC_PORTSPEED_1GBIT ;else if (IS_QLA23XX (ha))
drivers/scsi/qla2xxx/qla_dbg.h +8 -0
@@ -22,6 +22,7 @@/* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */ /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */ /* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */ +/* #define QL_DEBUG_LEVEL_16 */ /* Output ISP84XX trace msgs */ /* * Macros use for debugging the driver.
@@ -41,6 +42,7 @@#define DEBUG2_9_10 (x) do { if (ql2xextended_error_logging) { x; } } while (0)#define DEBUG2_11 (x) do { if (ql2xextended_error_logging) { x; } } while (0)#define DEBUG2_13 (x) do { if (ql2xextended_error_logging) { x; } } while (0) +#define DEBUG2_16 (x) do { if (ql2xextended_error_logging) { x; } } while (0)#if defined(QL_DEBUG_LEVEL_3 )#define DEBUG3 (x) do {x;} while (0)
@@ -120,6 +122,12 @@#define DEBUG15 (x) do {} while (0)#endif +#if defined(QL_DEBUG_LEVEL_16 ) +#define DEBUG16 (x) do {x;} while (0) +#else +#define DEBUG16 (x) do {} while (0) +#endif +/* * Firmware Dump structure definition */
drivers/scsi/qla2xxx/qla_def.h +25 -1
@@ -24,6 +24,7 @@#include <linux/workqueue.h> #include <linux/firmware.h> #include <linux/aer.h> +#include <linux/mutex.h> #include <asm/semaphore.h> #include <scsi/scsi.h>
@@ -2142,6 +2143,21 @@ struct qla_work_evt { } u; }; +struct qla_chip_state_84xx { +struct list_head list; +struct kref kref; + +void *bus; +spinlock_t access_lock; +struct mutex fw_update_mutex; +uint32_t fw_update; +uint32_t op_fw_version; +uint32_t op_fw_size; +uint32_t op_fw_seq_size; +uint32_t diag_fw_version; +uint32_t gold_fw_version; +}; +/* * Linux Host Adapter structure */
@@ -2230,6 +2246,7 @@ typedef struct scsi_qla_host {#define DFLG_NO_CABLE BIT_4#define PCI_DEVICE_ID_QLOGIC_ISP2532 0x2532 +#define PCI_DEVICE_ID_QLOGIC_ISP8432 0x8432uint32_t device_type;#define DT_ISP2100 BIT_0#define DT_ISP2200 BIT_1
@@ -2243,7 +2260,8 @@ typedef struct scsi_qla_host {#define DT_ISP5422 BIT_9#define DT_ISP5432 BIT_10#define DT_ISP2532 BIT_11 -#define DT_ISP_LAST (DT_ISP2532 << 1) +#define DT_ISP8432 BIT_12 +#define DT_ISP_LAST (DT_ISP8432 << 1)#define DT_IIDMA BIT_26#define DT_FWI2 BIT_27
@@ -2265,12 +2283,16 @@ typedef struct scsi_qla_host {#define IS_QLA5422 (ha) (DT_MASK(ha) & DT_ISP5422)#define IS_QLA5432 (ha) (DT_MASK(ha) & DT_ISP5432)#define IS_QLA2532 (ha) (DT_MASK(ha) & DT_ISP2532) +#define IS_QLA8432 (ha) (DT_MASK(ha) & DT_ISP8432)#define IS_QLA23XX (ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \ IS_QLA6312(ha) || IS_QLA6322(ha))#define IS_QLA24XX (ha) (IS_QLA2422(ha) || IS_QLA2432(ha))#define IS_QLA54XX (ha) (IS_QLA5422(ha) || IS_QLA5432(ha))#define IS_QLA25XX (ha) (IS_QLA2532(ha)) +#define IS_QLA84XX (ha) (IS_QLA8432(ha)) +#define IS_QLA24XX_TYPE (ha) (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \ + IS_QLA84XX(ha))#define IS_IIDMA_CAPABLE (ha) ((ha)->device_type & DT_IIDMA)#define IS_FWI2_CAPABLE (ha) ((ha)->device_type & DT_FWI2)
@@ -2575,6 +2597,8 @@ typedef struct scsi_qla_host {#define VP_ERR_ADAP_NORESOURCES 5uint16_t max_npiv_vports;/* 63 or 125 per topoloty */ int cur_vport_count; + +struct qla_chip_state_84xx *cs84xx; } scsi_qla_host_t;
drivers/scsi/qla2xxx/qla_fw.h +123 -0
127 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_gbl.h +8 -0
@@ -47,6 +47,8 @@ extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);extern void qla2x00_alloc_fw_dump (scsi_qla_host_t *);extern void qla2x00_try_to_stop_firmware (scsi_qla_host_t *); +extern void qla84xx_put_chip (struct scsi_qla_host *); +/* * Global Data in qla_os.c source file. */
@@ -150,6 +152,10 @@ extern int qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);extern int +qla2x00_issue_iocb_timeout (scsi_qla_host_t *,void *,dma_addr_t ,size_t , +uint32_t ); + +extern int qla2x00_abort_command (scsi_qla_host_t *,srb_t *); extern int
@@ -249,6 +255,8 @@ qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t);extern int qla2x00_set_idma_speed (scsi_qla_host_t *,uint16_t ,uint16_t ,uint16_t *); +extern int qla84xx_verify_chip (struct scsi_qla_host *,uint16_t *); +/* * Global Function Prototypes in qla_isr.c source file. */
drivers/scsi/qla2xxx/qla_gs.c +1 -1
@@ -1532,7 +1532,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha) eiter->a.sup_speed =__constant_cpu_to_be32 (FDMI_PORT_SPEED_1GB |FDMI_PORT_SPEED_2GB |FDMI_PORT_SPEED_4GB |FDMI_PORT_SPEED_8GB ); - else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) + else if (IS_QLA24XX_TYPE(ha)) eiter->a.sup_speed = __constant_cpu_to_be32(FDMI_PORT_SPEED_1GB |FDMI_PORT_SPEED_2GB |FDMI_PORT_SPEED_4GB );
drivers/scsi/qla2xxx/qla_init.c +111 -8
166 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_isr.c +43 -5
78 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_mbx.c +118 -7
162 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_os.c +15 -2
@@ -339,6 +339,8 @@ qla24xx_fw_version_str(struct scsi_qla_host *ha, char *str)strcat (str,"[T10 CRC] " );if (ha->fw_attributes &BIT_5 )strcat (str,"[VI] " ); +if (ha->fw_attributes &BIT_10 ) +strcat (str,"[84XX] " );if (ha->fw_attributes &BIT_13 )strcat (str,"[Experimental]" );return str;
@@ -1378,6 +1380,13 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha) ha->device_type |=DT_IIDMA ; ha->fw_srisc_address =RISC_START_ADDRESS_2400 ;break ; +case PCI_DEVICE_ID_QLOGIC_ISP8432 : + ha->device_type |=DT_ISP8432 ; + ha->device_type |=DT_ZIO_SUPPORTED ; + ha->device_type |=DT_FWI2 ; + ha->device_type |=DT_IIDMA ; + ha->fw_srisc_address =RISC_START_ADDRESS_2400 ; +break ;case PCI_DEVICE_ID_QLOGIC_ISP5422 : ha->device_type |=DT_ISP5422 ; ha->device_type |=DT_FWI2 ;
@@ -1501,6 +1510,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) sht = &qla2x00_driver_template;if (pdev->device ==PCI_DEVICE_ID_QLOGIC_ISP2422 || pdev->device ==PCI_DEVICE_ID_QLOGIC_ISP2432 || + pdev->device ==PCI_DEVICE_ID_QLOGIC_ISP8432 || pdev->device ==PCI_DEVICE_ID_QLOGIC_ISP5422 || pdev->device ==PCI_DEVICE_ID_QLOGIC_ISP5432 || pdev->device ==PCI_DEVICE_ID_QLOGIC_ISP2532 ) {
@@ -1591,7 +1601,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)if (IS_QLA2322 (ha) ||IS_QLA6322 (ha)) ha->optrom_size =OPTROM_SIZE_2322 ; ha->isp_ops = &qla2300_isp_ops; - }else if (IS_QLA24XX (ha) ||IS_QLA54XX (ha)) { + }else if (IS_QLA24XX_TYPE (ha)) { host->max_id =MAX_TARGETS_2200 ; ha->mbx_count =MAILBOX_REGISTER_COUNT ; ha->request_q_length =REQUEST_ENTRY_CNT_24XX ;
@@ -1736,6 +1746,8 @@ qla2x00_remove_one(struct pci_dev *pdev)qla2x00_dfs_remove (ha); +qla84xx_put_chip (ha); +qla2x00_free_sysfs_attr (ha);fc_remove_host (ha->host);
@@ -2642,7 +2654,7 @@ qla2x00_request_firmware(scsi_qla_host_t *ha) blob = &qla_fw_blobs[FW_ISP2300 ]; }else if (IS_QLA2322 (ha) ||IS_QLA6322 (ha)) { blob = &qla_fw_blobs[FW_ISP2322 ]; - }else if (IS_QLA24XX (ha) ||IS_QLA54XX (ha)) { + }else if (IS_QLA24XX_TYPE (ha)) { blob = &qla_fw_blobs[FW_ISP24XX ]; }else if (IS_QLA25XX (ha)) { blob = &qla_fw_blobs[FW_ISP25XX ];
@@ -2792,6 +2804,7 @@ static struct pci_device_id qla2xxx_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432) }, + { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP8432) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2532) },
drivers/scsi/qla2xxx/qla_sup.c +1 -1
@@ -553,7 +553,7 @@ qla2xxx_get_flash_info(scsi_qla_host_t *ha)struct qla_fdt_layout *fdt;uint8_t man_id, flash_id; -if (!IS_QLA24XX (ha) && !IS_QLA25XX (ha)) +if (!IS_QLA24XX_TYPE (ha) && !IS_QLA25XX (ha))return ; wptr = (uint16_t *)ha->request_ring;
Signature · 1 line
1.5.5.rc2
PATCH 16/21 qla2xxx: Remove unused member (dma_handle) from srb_t structure.
In reply to Andrew VasquezThe member is not needed as there's no non-scatter-gather list I/Os submitted by the upper-layers.
--- drivers/scsi/qla2xxx/qla_def.h | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +0 -3
@@ -193,9 +193,6 @@ typedef struct srb {uint16_t flags; -/* Single transfer DMA context */ -dma_addr_t dma_handle; -uint32_t request_sense_length;uint8_t *request_sense_ptr; } srb_t;
Signature · 1 line
1.5.5.rc2
PATCH 17/21 qla2xxx: Consistently access the physical HA port.
In reply to Andrew VasquezFrom: Seokmann Ju <[email protected]>
There were several places where referencing ha structure of virtual ports for resources. Among those refereces, certain fields are get up-to-dated only on ha structure of physical port.
--- drivers/scsi/qla2xxx/qla_init.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +8 -6
@@ -2453,7 +2453,8 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)if (fcport->loop_id ==FC_NO_LOOP_ID ) { fcport->loop_id = next_loopid; - rval =qla2x00_find_new_loop_id (ha, fcport); + rval =qla2x00_find_new_loop_id ( +to_qla_parent (ha), fcport);if (rval !=QLA_SUCCESS ) {/* Ran out of IDs to use */ break ;
@@ -2478,7 +2479,8 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)/* Find a new loop ID to use. */ fcport->loop_id = next_loopid; - rval =qla2x00_find_new_loop_id (ha, fcport); + rval =qla2x00_find_new_loop_id (to_qla_parent (ha), + fcport);if (rval !=QLA_SUCCESS ) {/* Ran out of IDs to use */ break ;
@@ -4044,16 +4046,16 @@ qla24xx_configure_vhba(scsi_qla_host_t *ha)if (!ha->parent)return -EINVAL ; - rval =qla2x00_fw_ready (ha); + rval =qla2x00_fw_ready (ha->parent);if (rval ==QLA_SUCCESS ) {clear_bit (RESET_MARKER_NEEDED , &ha->dpc_flags); -qla2x00_marker (ha,0 ,0 ,MK_SYNC_ALL ); +qla2x00_marker (ha->parent,0 ,0 ,MK_SYNC_ALL ); } ha->flags.management_server_logged_in =0 ;/* Login to SNS first */ -qla24xx_login_fabric (ha,NPH_SNS ,0xff ,0xff ,0xfc , +qla24xx_login_fabric (ha->parent,NPH_SNS ,0xff ,0xff ,0xfc , mb,BIT_1 );if (mb[0 ] !=MBS_COMMAND_COMPLETE ) { DEBUG15(qla_printk(KERN_INFO, ha,
@@ -4067,7 +4069,7 @@ qla24xx_configure_vhba(scsi_qla_host_t *ha)atomic_set (&ha->loop_state,LOOP_UP );set_bit (LOOP_RESYNC_NEEDED , &ha->dpc_flags);set_bit (LOCAL_LOOP_UPDATE , &ha->dpc_flags); - rval =qla2x00_loop_resync (ha); + rval =qla2x00_loop_resync (ha->parent);return rval; }
Signature · 1 line
1.5.5.rc2
PATCH 18/21 qla2xxx: Check DFLG_NO_CABLE only on physical port.
In reply to Andrew VasquezFrom: Seokmann Ju <[email protected]>
As there is no actual cable connection on vports, made change so that the driver checks DFLG_NO_CABLE against ha->device_flags only for physical port.
--- drivers/scsi/qla2xxx/qla_os.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +2 -1
@@ -2577,7 +2577,8 @@ qla2x00_timer(scsi_qla_host_t *ha)set_bit (RESTART_QUEUES_NEEDED , &ha->dpc_flags); start_dpc++; -if (!(ha->device_flags &DFLG_NO_CABLE )) { +if (!(ha->device_flags &DFLG_NO_CABLE ) && + !ha->parent) {DEBUG (printk ("scsi(%ld): Loop down - " "aborting ISP.\n" , ha->host_no));
Signature · 1 line
1.5.5.rc2
PATCH 19/21 qla2xxx: Use proper HA during asynchrounous event handling.
In reply to Andrew VasquezFrom: Seokmann Ju <[email protected]>
Changes are added to the driver so that it can behave properly upon having asynchronous events, for example, addition of target devices to the VPs.
--- drivers/scsi/qla2xxx/qla_isr.c | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +26 -6
@@ -272,6 +272,8 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)uint32_t rscn_entry, host_pid;uint8_t rscn_queue_index;unsigned long flags; +scsi_qla_host_t *vha; +int i;/* Setup to process RIO completion. */ handle_cnt =0 ;
@@ -542,6 +544,18 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)break ;case MBA_PORT_UPDATE :/* Port database update */ +if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { +for_each_mapped_vp_idx (ha, i) { +list_for_each_entry (vha, &ha->vp_list, + vp_list) { +if ((mb[3 ] &0xff ) + == vha->vp_idx) { + ha = vha; +break ; + } + } + } + }/* * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET * event etc. earlier indicating loop is down) then process
@@ -576,12 +590,18 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)break ;case MBA_RSCN_UPDATE :/* State Change Registration */ -/* Check if the Vport has issued a SCR */ -if (ha->parent &&test_bit (VP_SCR_NEEDED , &ha->vp_flags)) -break ; -/* Only handle SCNs for our Vport index. */ -if (ha->flags.npiv_supported && ha->vp_idx != mb[3 ]) -break ; +if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { +for_each_mapped_vp_idx (ha, i) { +list_for_each_entry (vha, &ha->vp_list, + vp_list) { +if ((mb[3 ] &0xff ) + == vha->vp_idx) { + ha = vha; +break ; + } + } + } + }DEBUG2 (printk ("scsi(%ld): Asynchronous RSCR UPDATE.\n" , ha->host_no));
Signature · 1 line
1.5.5.rc2
PATCH 20/21 qla2xxx: Correct vport configuration-change handling.
In reply to Andrew VasquezFrom: Seokmann Ju <[email protected]>
Upon having configuration changes on vports only, the driver handles SCR regardless physical port state and, in turn, it results mailbox error as below:
Mar 20 11:24:20 dl585 kernel: qla2x00_mailbox_command(9): **** FAILED. mbx0=4005, mbx1=1, mbx2=8100, cmd=70 ****
With the changes, driver checks physical port loop_state and make sure the port is ready to take commands.
--- drivers/scsi/qla2xxx/qla_mid.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_mid.c +9 -1
@@ -254,9 +254,17 @@ qla2x00_vp_abort_isp(scsi_qla_host_t *vha)static int qla2x00_do_dpc_vp (scsi_qla_host_t *vha) { +scsi_qla_host_t *ha = vha->parent; +if (test_and_clear_bit (VP_IDX_ACQUIRED , &vha->vp_flags)) {/* VP acquired. complete port configuration */ -qla24xx_configure_vp (vha); +if (atomic_read (&ha->loop_state) ==LOOP_READY ) { +qla24xx_configure_vp (vha); + }else { +set_bit (VP_IDX_ACQUIRED , &vha->vp_flags); +set_bit (VP_DPC_NEEDED , &ha->dpc_flags); + } +return 0 ; }
Signature · 1 line
1.5.5.rc2
PATCH 21/21 qla2xxx: Update version number to 8.02.01-k1.
In reply to Andrew Vasquez--- drivers/scsi/qla2xxx/qla_version.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +2 -2
@@ -7,9 +7,9 @@/* * Driver version */ -#define QLA2XXX_VERSION "8.02.00-k9" +#define QLA2XXX_VERSION "8.02.01-k1"#define QLA_DRIVER_MAJOR_VER 8#define QLA_DRIVER_MINOR_VER 2 -#define QLA_DRIVER_PATCH_VER 0 +#define QLA_DRIVER_PATCH_VER 1#define QLA_DRIVER_BETA_VER 0
Signature · 1 line
1.5.5.rc2