Re: [PATCH -mmotm] scsi: fix the wrong position of the comment
On Sun, 10 Mar 2013, James Bottomley wrote: On Sun, 2013-03-10 at 00:57 -0800, Andrew Morton wrote: On Sun, 10 Mar 2013 08:22:47 + James Bottomley jbottom...@parallels.com wrote: [missing SCSI cc added] On Sun, 2013-03-10 at 17:09 +0900, Akinobu Mita wrote: This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Andrew Vasquez andrew.vasq...@qlogic.com --- drivers/scsi/qla2xxx/qla_attr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 04bf7b8..e44d47e 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) } /* No pending activities shall be there on the vha now */ - if (ql2xextended_error_logging ql_dbg_user) - msleep(prandom_u32() % 10); + if (ql2xextended_error_logging ql_dbg_user) { /* * Just to see if something falls on the net we have placed * below */ - + msleep(prandom_u32() % 10); + } I don't git a toss if it's random or prandom: Andrew: get rid of it; we do not sleep in kernel for random intervals whatever the provocation ... if this is supposed to be a warning or error condition then print something. That msleep was added by commit feafb7b1714cf599a6d0fed45801ab3f66046cbd Author: Arun Easi arun.e...@qlogic.com AuthorDate: Fri Sep 3 14:57:00 2010 -0700 Commit: James Bottomley james.bottom...@suse.de CommitDate: Sun Sep 5 15:13:12 2010 -0300 [SCSI] qla2xxx: Fix vport delete issues Sorry, I didn't notice multiple Andrews on the cc list. I meant Andrew Vasquez (or other member of the qla team) remove this, please (and preferably do something correct). James, We'll take a look at this, yes. Adding Giri and Co. to the CC. Thanks, AV This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message. -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [2.6 patch] scsi/qla4xxx/ql4_isr.c: remove dead code
On Tue, 19 Feb 2008, James Bottomley wrote: On Tue, 2008-02-19 at 21:29 +0200, Adrian Bunk wrote: This patch removes dead code spotted by the Coverity checker. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] --- drivers/scsi/qla4xxx/ql4_isr.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) --- linux-2.6/drivers/scsi/qla4xxx/ql4_isr.c.old2008-02-19 20:29:16.0 +0200 +++ linux-2.6/drivers/scsi/qla4xxx/ql4_isr.c2008-02-19 20:30:37.0 +0200 @@ -91,38 +91,22 @@ static void qla4xxx_status_entry(struct if (scsi_status == 0) { cmd-result = DID_OK 16; break; } if (sts_entry-iscsiFlags ISCSI_FLAG_RESIDUAL_OVER) { cmd-result = DID_ERROR 16; break; } - if (sts_entry-iscsiFlags ISCSI_FLAG_RESIDUAL_UNDER) { + if (sts_entry-iscsiFlags ISCSI_FLAG_RESIDUAL_UNDER) scsi_set_resid(cmd, residual); - if (!scsi_status ((scsi_bufflen(cmd) - residual) - cmd-underflow)) { - - cmd-result = DID_ERROR 16; - - DEBUG2(printk(scsi%ld:%d:%d:%d: %s: - Mid-layer Data underrun0, - xferlen = 0x%x, - residual = 0x%x\n, ha-host_no, - cmd-device-channel, - cmd-device-id, - cmd-device-lun, __func__, - scsi_bufflen(cmd), residual)); - break; - } - } This code doesn't look dead to me, it looks to be enforcing cmd-underrun if set ... what makes the coverity checker think it can never be executed? Hmm, guess it's the earlier 'if (scsi_status == 0)' check a few lines up... Dave S., can you take a look at this... Thanks, av - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] qla2xxx: fix compilation compile
On Sat, 16 Feb 2008, FUJITA Tomonori wrote: scsi/qla2xxx/qla_dfs.c: In function 'qla2x00_dfs_fce_show': scsi/qla2xxx/qla_dfs.c:26: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'uint64_t' Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED] Acked-by: Andrew Vasquez [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: 2.6.24 regression w/ QLA2300
On Tue, 05 Feb 2008, Alan D. Brunelle wrote: commit 9b73e76f3cf63379dcf45fcd4f112f5812418d0a Merge: 50d9a12... 23c3e29... Author: Linus Torvalds [EMAIL PROTECTED] Date: Fri Jan 25 17:19:08 2008 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits) I believe a regression was introduced. I'm running on a 4-way IA64, with straight 2.6.24 and 2 dual-port cards: 40:01.0 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) 40:01.1 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) c0:01.0 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) c0:01.1 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) the adapters failed initialization. In particular, I narrowed it down to failing the qla2x00_mbox_command call within qla2x00_init_firmware function. I went and removed the qla2x00-related parts of this (large-ish) merge, and the 4 ports initialized just fine. Could you load the (default 2.6.24) driver with ql2xextended_error_logging modules parameter set: # insmod qla2xxx ql2xextended_error_logging=1 and send the resultant kernel logs? Specifically, reverting the patch below enabled the devices to initialize properly. If need be, I'm certainly willing to help narrow down to the specific part in this patch... That's a rather large patch... :( Any chance you could git-bisect? Also, could you send your .config file you are using? Thanks, Andrew Vasquez - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: 2.6.24 regression w/ QLA2300
On Tue, 05 Feb 2008, Andrew Vasquez wrote: On Tue, 05 Feb 2008, Alan D. Brunelle wrote: commit 9b73e76f3cf63379dcf45fcd4f112f5812418d0a Merge: 50d9a12... 23c3e29... Author: Linus Torvalds [EMAIL PROTECTED] Date: Fri Jan 25 17:19:08 2008 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits) I believe a regression was introduced. I'm running on a 4-way IA64, with straight 2.6.24 and 2 dual-port cards: 40:01.0 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) 40:01.1 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) c0:01.0 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) c0:01.1 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 03) the adapters failed initialization. In particular, I narrowed it down to failing the qla2x00_mbox_command call within qla2x00_init_firmware function. I went and removed the qla2x00-related parts of this (large-ish) merge, and the 4 ports initialized just fine. Could you load the (default 2.6.24) driver with ql2xextended_error_logging modules parameter set: # insmod qla2xxx ql2xextended_error_logging=1 and send the resultant kernel logs? Could you tray the patch referenced here: qla2xxx: Correct issue where incorrect init-fw mailbox command was used on non-NPIV capable ISPs. http://article.gmane.org/gmane.linux.scsi/38240 Thanks, av --- qla2xxx: Correct issue where incorrect init-fw mailbox command was used on non-NPIV capable ISPs. BIT_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. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_mbx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 0c10c0b..99d29ff 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -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; -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: 2.6.24 regression w/ QLA2300
On Tue, 05 Feb 2008, Andrew Vasquez wrote: Could you load the (default 2.6.24) driver with ql2xextended_error_logging modules parameter set: # insmod qla2xxx ql2xextended_error_logging=1 and send the resultant kernel logs? Could you tray the patch referenced here: qla2xxx: Correct issue where incorrect init-fw mailbox command was used on non-NPIV capable ISPs. http://article.gmane.org/gmane.linux.scsi/38240 BTW: the regression in question is not present in vanilla 2.6.24. Instead it was introduced early on in the 2.6.25 merge-window. Linus' tree currently has the patch referenced above as well. -- av - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: 2.6.24 regression w/ QLA2300
On Tue, 05 Feb 2008, Alan D. Brunelle wrote: and send the resultant kernel logs? Here's the output to the console (if there are other logs you need, let me know). I'll try the patch next, and sorry, hadn't realized merges were still coming in under 2.6.24 in Linus' tree... QLogic Fibre Channel HBA Driver ACPI: PCI Interrupt :40:01.0[A] - GSI 38 (level, low) - IRQ 58 qla2xxx :40:01.0: Found an ISP2312, irq 58, iobase 0xc000a0041000 qla2xxx :40:01.0: Configuring PCI space... qla2x00_get_flash_version(): Unrecognized code type ff at pcids da1c. qla2x00_get_flash_version(): Unrecognized code type ff at pcids 1f61c. qla2xxx :40:01.0: Configure NVRAM parameters... qla2xxx :40:01.0: Verifying loaded RISC code... scsi(14): Load RISC code scsi(14): Verifying Checksum of loaded RISC code. scsi(14): Checksum OK, start firmware. qla2xxx :40:01.0: Allocated (412 KB) for firmware dump... scsi(14): Issue init firmware. qla2x00_mailbox_command(14): FAILED. mbx0=4001, mbx1=0, mbx2=ba8a, cmd=48 Ok, this is what I would have expected with the linus' tree prior to the fix. I just double-checked, the fix in question has yet to make it's way to Linus' tree. It's currently in scsi-misc-2.6: http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=commitdiff;h=a571fdf7caa010e17f6a70c0c52e0992e87af7db which should filter up to linux-2.6.git during Linus' next pull. thanks, av - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/11] qla2xxx: Update version number to 8.02.00-k8.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 2c2f6b4..c5742cc 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -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 -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 09/11] qla2xxx: Access the proper 'physical' port in FC-transport callbacks.
From: 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. Signed-Off-by: Seokmann Ju [EMAIL PROTECTED] Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- 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(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 1dd8591..4894dc8 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -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; diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 6f129da..42500bc 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -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 */ diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 8e3b044..5d1a3f7 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -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 -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 07/11] qla2xxx: Move RISC-interrupt-register modifications to qla2x00_request_irqs().
There'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. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c | 27 ++- drivers/scsi/qla2xxx/qla_os.c | 18 -- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 642a0c3..14e6f22 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -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(reg-isp24.hccr, HCCRX_CLR_HOST_INT); + WRT_REG_DWORD(reg-isp24.hccr, HCCRX_CLR_RISC_INT); + } else { + WRT_REG_WORD(reg-isp.semaphore, 0); + WRT_REG_WORD(reg-isp.hccr, HCCR_CLR_RISC_INT); + WRT_REG_WORD(reg-isp.hccr, HCCR_CLR_HOST_INT); } + spin_unlock_irqrestore(ha-hardware_lock, flags); + ha-isp_ops-enable_intrs(ha); +fail: return ret; } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index f129c69..4b4c32f 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -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(reg-isp24.hccr, HCCRX_CLR_HOST_INT); - WRT_REG_DWORD(reg-isp24.hccr, HCCRX_CLR_RISC_INT); - } else { - WRT_REG_WORD(reg-isp.semaphore, 0); - WRT_REG_WORD(reg-isp.hccr, HCCR_CLR_RISC_INT); - WRT_REG_WORD(reg-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; -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 10/11] qla2xxx: Correct issue where incorrect init-fw mailbox command was used on non-NPIV capable ISPs.
BIT_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. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_mbx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 0c10c0b..99d29ff 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -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; -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/11] qla2xxx: Clear EFT buffer before firmware reinitialization.
To insure that there is no stale data present during EFT re-registration. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 2e51fa8..97063cb 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -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) { -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 03/11] qla2xxx: Cleanup any outstanding SRB resources during shutdown.
Refactor SRB-failure completion codes in the process. Also, signal the DPC routine to complete sooner as backend processing at shutdown-time is superflous. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- 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(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index ba35fc2..193f688 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -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. diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index d0633ca..2e51fa8 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -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_tstatus = 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); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index bbdfd81..e2adfce 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -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); -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 01/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. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_sup.c | 36 +++- 1 files changed, 15 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index b68fb73..26822c8 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -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(reg-gpioe); - gpio_data = RD_REG_WORD_PIO(reg-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(reg-gpioe); gpio_data = RD_REG_WORD(reg-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(reg-gpioe, gpio_enable); + WRT_REG_WORD_PIO(PIO_REG(ha, gpioe), gpio_enable); } else { WRT_REG_WORD(reg-gpioe, gpio_enable); RD_REG_WORD(reg-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(reg-gpiod, gpio_data); + WRT_REG_WORD_PIO(PIO_REG(ha, gpiod), gpio_data); } else { WRT_REG_WORD(reg-gpiod, gpio_data); RD_REG_WORD(reg-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(reg-gpioe); - gpio_data = RD_REG_WORD_PIO(reg-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(reg-gpioe); gpio_data = RD_REG_WORD(reg-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(reg-gpioe, gpio_enable); + WRT_REG_WORD_PIO(PIO_REG(ha, gpioe), gpio_enable); } else { WRT_REG_WORD(reg-gpioe, gpio_enable); RD_REG_WORD(reg-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(reg-gpiod, gpio_data); + WRT_REG_WORD_PIO(PIO_REG(ha, gpiod), gpio_data); } else { WRT_REG_WORD(reg-gpiod, gpio_data); RD_REG_WORD(reg-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(reg-flash_address, (uint16_t)addr); + WRT_REG_WORD_PIO(PIO_REG(ha, flash_address), (uint16_t)addr); do { - data = RD_REG_WORD_PIO(reg-flash_data); + data = RD_REG_WORD_PIO(PIO_REG(ha, flash_data)); barrier(); cpu_relax(); - data2 = RD_REG_WORD_PIO(reg-flash_data); + data2 = RD_REG_WORD_PIO(PIO_REG(ha, flash_data)); } while (data != data2); } else { WRT_REG_WORD(reg-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
[PATCH 0/11] 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 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 06/11] qla2xxx: Consolidate RISC-parity enablement codes.
Collapse duplicate codes called during probe() and RISC-reset into qla2x00_setup_chip(). Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c | 70 +- drivers/scsi/qla2xxx/qla_os.c | 12 --- 2 files changed, 24 insertions(+), 58 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 97063cb..d5c7853 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -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(reg-hccr, (HCCR_ENABLE_PARITY + 0x0)); + RD_REG_WORD(reg-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(reg-hccr, HCCR_ENABLE_PARITY + 0x1); + else + /* SRAM, Instruction RAM and GP RAM parity */ + WRT_REG_WORD(reg-hccr, HCCR_ENABLE_PARITY + 0x7); + RD_REG_WORD(reg-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(reg-hccr, - (HCCR_ENABLE_PARITY + 0x0)); - RD_REG_WORD(reg-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(reg-hccr, - (HCCR_ENABLE_PARITY + 0x1)); - else - /* -* SRAM, Instruction RAM and GP RAM -* parity. -*/ - WRT_REG_WORD(reg-hccr, - (HCCR_ENABLE_PARITY + 0x7)); - RD_REG_WORD(reg-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))) { diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1249545..f129c69 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1773,18 +1773,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) WRT_REG_WORD(reg-isp.semaphore, 0
[PATCH 05/11] qla2xxx: Cleanse memory allocation logic during probe.
- 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. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c | 13 ++ drivers/scsi/qla2xxx/qla_os.c | 330 --- 2 files changed, 112 insertions(+), 231 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index adf9732..1dd8591 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -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) { diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e2adfce..1249545 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -204,10 +204,8 @@ static int qla2x00_do_dpc(void *data); static void qla2x00_rst_aen(scsi_qla_host_t *); -static uint8_t qla2x00_mem_alloc(scsi_qla_host_t *); +static int qla2x00_mem_alloc(scsi_qla_host_t *); static void qla2x00_mem_free(scsi_qla_host_t *ha); -static int qla2x00_allocate_sp_pool( scsi_qla_host_t *ha); -static void qla2x00_free_sp_pool(scsi_qla_host_t *ha); static void qla2x00_sp_free_dma(scsi_qla_host_t *, srb_t *); /* -- */ @@ -2025,196 +2023,109 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha, int defer) * * Returns: * 0 = success. -* 1 = failure. +* !0 = failure. */ -static uint8_t +static int qla2x00_mem_alloc(scsi_qla_host_t *ha) { charname[16]; - uint8_t status = 1; - int retry= 10; - - do { - /* -* This will loop only once if everything goes well, else some -* number of retries will be performed to get around a kernel -* bug where available mem is not allocated until after a -* little delay and a retry. -*/ - ha-request_ring = dma_alloc_coherent(ha-pdev-dev, - (ha-request_q_length + 1) * sizeof(request_t), - ha-request_dma, GFP_KERNEL); - if (ha-request_ring == NULL) { - qla_printk(KERN_WARNING, ha, - Memory Allocation failed - request_ring\n); - - qla2x00_mem_free(ha); - msleep(100); - - continue; - } - - ha-response_ring = dma_alloc_coherent(ha-pdev-dev, - (ha-response_q_length + 1) * sizeof(response_t), - ha-response_dma, GFP_KERNEL); - if (ha-response_ring == NULL) { - qla_printk(KERN_WARNING, ha, - Memory Allocation failed - response_ring\n); - - qla2x00_mem_free(ha); - msleep(100); - - continue; - } - - ha-gid_list = dma_alloc_coherent(ha-pdev-dev, GID_LIST_SIZE, - ha-gid_list_dma, GFP_KERNEL); - if (ha-gid_list == NULL) { - qla_printk(KERN_WARNING, ha, - Memory Allocation failed - gid_list\n); - - qla2x00_mem_free(ha); - msleep(100); - - continue; - } - - /* get consistent memory allocated for init control block */ - ha-init_cb = dma_alloc_coherent(ha-pdev-dev, - ha-init_cb_size, ha-init_cb_dma, GFP_KERNEL); - if (ha-init_cb == NULL) { - qla_printk(KERN_WARNING, ha, - Memory Allocation failed - init_cb\n); - - qla2x00_mem_free(ha); - msleep(100); - - continue; - } - memset(ha-init_cb, 0, ha-init_cb_size); - - snprintf(name, sizeof(name), %s_%ld, QLA2XXX_DRIVER_NAME, - ha-host_no); - ha-s_dma_pool = dma_pool_create(name, ha-pdev-dev
[PATCH 08/11] qla2xxx: Correct issue where vport-state was not updated during an ISP_ABORT_NEEDED requst.
From: 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. Signed-Off-by: Seokmann Ju [EMAIL PROTECTED] Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_os.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 4b4c32f..0b52ee7 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2220,6 +2220,9 @@ qla2x00_do_dpc(void *data) fc_port_t *fcport; uint8_t status; uint16_tnext_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)); } -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 02/11] qla2xxx: Add MODULE_FIRMWARE hint for ISP25XX firmware.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_os.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 3954ed2..bbdfd81 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -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); -- 1.5.4.rc5.5.gab98 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: qla_sup.c: compilation warning
On Thu, 24 Jan 2008, Boaz Harrosh wrote: With gcc 4.1.2 on fedora7 x86_64, cross compiling an i386 kernel i get the following compilation warning: CC [M] drivers/scsi/qla2xxx/qla_sup.o /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c: In function ‘qla2x00_beacon_blink’: /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c:906: warning: cast to pointer from integer of different size /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c: In function ‘qla2x00_beacon_on’: /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c:966: warning: cast to pointer from integer of different size /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c: In function ‘qla2x00_read_flash_byte’: /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c:1247: warning: cast to pointer from integer of different size /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c: In function ‘qla2x00_write_flash_byte’: /usr0/export/dev/bharrosh/git/pub/scsi-misc/drivers/scsi/qla2xxx/qla_sup.c:1307: warning: cast to pointer from integer of different size Perhaps the compiler is right this time ? configured with: make ARCH=i386 allmodconfig 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. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index b68fb73..26822c8 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -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(reg-gpioe); - gpio_data = RD_REG_WORD_PIO(reg-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(reg-gpioe); gpio_data = RD_REG_WORD(reg-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(reg-gpioe, gpio_enable); + WRT_REG_WORD_PIO(PIO_REG(ha, gpioe), gpio_enable); } else { WRT_REG_WORD(reg-gpioe, gpio_enable); RD_REG_WORD(reg-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(reg-gpiod, gpio_data); + WRT_REG_WORD_PIO(PIO_REG(ha, gpiod), gpio_data); } else { WRT_REG_WORD(reg-gpiod, gpio_data); RD_REG_WORD(reg-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(reg-gpioe); - gpio_data = RD_REG_WORD_PIO(reg-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(reg-gpioe); gpio_data = RD_REG_WORD(reg-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(reg-gpioe, gpio_enable); + WRT_REG_WORD_PIO(PIO_REG(ha, gpioe), gpio_enable); } else { WRT_REG_WORD(reg-gpioe, gpio_enable); RD_REG_WORD(reg-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
Re: [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size
On Thu, 17 Jan 2008, Boaz Harrosh wrote: below list of drivers have used SG_ALL as a size to preallocate maximum possible command's sg-count. This is no longer possible since the maximum is not set at compile time but as a run time configuration. A better schema can be advised with a more dynamic allocation. Perhaps from a kmem_cache. Affected drivers/files: drivers/scsi/atari_scsi.[ch] drivers/scsi/eata_pio.c drivers/scsi/ibmvscsi/ibmvscsi.[ch] drivers/scsi/mac53c94.c drivers/scsi/mesh.c drivers/scsi/nsp32.h drivers/scsi/qla1280.c drivers/scsi/qla2xxx/qla_os.c drivers/scsi/qla4xxx/ql4_def.h ... There's no functional change in your patches to qla2xxx and qla4xxx. Perhaps a cut-n-paste typo from qla1280.c (which should be capped): diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 78d1103..e368f38 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -111,6 +111,8 @@ static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); static int qla2x00_change_queue_depth(struct scsi_device *, int); static int qla2x00_change_queue_type(struct scsi_device *, int); +#define QLA2XXX_MAX_SG 255 + struct scsi_host_template qla2x00_driver_template = { .module = THIS_MODULE, .name = QLA2XXX_DRIVER_NAME, diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index accaf69..64cd43b 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h @@ -101,6 +101,7 @@ #define MBOX_AEN_REG_COUNT 5 #define MAX_INIT_RETRIES 5 #define IOCB_HIWAT_CUSHION 16 +#define QLA_MAX_SG 255 I don't forsee any issues with maintaining SG_ALL (~0) usage within qla2xxx and qla4xxx, as the number of unused entries on the HBA's request-queue shall ultimately be the rate-limiting factor. -- av - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/14] qla2xxx: updates for 2.6.24 [8.02.00-k7].
On Thu, 17 Jan 2008, James Bottomley wrote: On Thu, 2008-01-17 at 09:33 -0800, Andrew Vasquez wrote: On Thu, 17 Jan 2008, Andrew Vasquez wrote: This patchset updates the qla2xxx driver to 8.02.00-k7. ... BTW: Small typo in the subject, it's obvious these patches aren't for 2.6.24, instead, meant for the next merge window of 2.6.25... I was just about to ask about that. Your patches are all unnumbered, which makes applying them a pain unless they're all independent; are they? Cazzo! No, sorry about that, there's some ordering required. The order should be: [PATCH 01/14] qla2xxx: Consolidate duplicate sense-data handling codes. [PATCH 02/14] qla2xxx: Retrieve additional HBA port statistics from recent ISPs. [PATCH 03/14] qla2xxx: Fix for 32-bit platforms with 64-bit resources. [PATCH 04/14] qla2xxx: Wait for FLASH write-protection to complete after a write. [PATCH 05/14] qla2xxx: Restrict MSI/MSI-X enablement on select ISP2432-type HBAs. [PATCH 06/14] qla2xxx: Don't schedule the DPC routine to perform an issue-lip request. [PATCH 07/14] qla2xxx: Use completion routines. [PATCH 08/14] qla2xxx: Add a filter to compare port_name against the physical on vport creation. [PATCH 09/14] qla2xxx: Code cleanups. [PATCH 10/14] qla2xxx: Trace-Control naming cleanups. [PATCH 11/14] qla2xxx: Add Fibre Channel Event (FCE) tracing support. [PATCH 12/14] qla2xxx: Correct late-memset() of EFT buffer. [PATCH 13/14] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command. [PATCH 14/14] qla2xxx: Update version number to 8.02.00-k7. I believe git-send-email adjusts the 'seconds' field in the 'Date' header, so hopefully, your threaded email reader maintained the order. If not, if you like, I can resend with the X/Y prefix. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Trace-Control naming cleanups.
In preparation for FCE (Fibre Channel Event) tracing support. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |3 -- drivers/scsi/qla2xxx/qla_fw.h |7 + drivers/scsi/qla2xxx/qla_gbl.h |4 ++- drivers/scsi/qla2xxx/qla_init.c |5 +-- drivers/scsi/qla2xxx/qla_mbx.c | 49 +- drivers/scsi/qla2xxx/qla_os.c |2 +- 6 files changed, 50 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 144f6d0..3f934bd 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -623,9 +623,6 @@ typedef struct { #define MBC_GET_LINK_PRIV_STATS0x6d/* Get link private data. */ #define MBC_SET_VENDOR_ID 0x76/* Set Vendor ID. */ -#define TC_ENABLE 4 -#define TC_DISABLE 5 - /* Firmware return data sizes */ #define FCAL_MAP_SIZE 128 diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index 69a5e31..ef14bcd 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -952,6 +952,13 @@ struct device_reg_24xx { uint32_t iobase_sdata; }; +/* Trace Control */ + +#define TC_AEN_DISABLE 0 + +#define TC_EFT_ENABLE 4 +#define TC_EFT_DISABLE 5 + /* MID Support ***/ #define MIN_MULTI_ID_FABRIC64 /* Must be power-of-2. */ diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index fd75539..2fd31fd 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -228,7 +228,9 @@ extern int qla2x00_stop_firmware(scsi_qla_host_t *); extern int -qla2x00_trace_control(scsi_qla_host_t *, uint16_t, dma_addr_t, uint16_t); +qla2x00_enable_eft_trace(scsi_qla_host_t *, dma_addr_t, uint16_t); +extern int +qla2x00_disable_eft_trace(scsi_qla_host_t *); extern int qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 03444d6..da2cce0 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -766,8 +766,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) goto cont_alloc; } - rval = qla2x00_trace_control(ha, TC_ENABLE, eft_dma, - EFT_NUM_BUFFERS); + rval = qla2x00_enable_eft_trace(ha, eft_dma, EFT_NUM_BUFFERS); if (rval) { qla_printk(KERN_WARNING, ha, Unable to initialize EFT (%d).\n, rval); @@ -3240,7 +3239,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) clear_bit(ISP_ABORT_RETRY, ha-dpc_flags); if (ha-eft) { - rval = qla2x00_trace_control(ha, TC_ENABLE, + rval = qla2x00_enable_eft_trace(ha, ha-eft_dma, EFT_NUM_BUFFERS); if (rval) { qla_printk(KERN_WARNING, ha, diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index ee7899d..7c6aa4e 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -2350,7 +2350,7 @@ qla2x00_stop_firmware(scsi_qla_host_t *ha) } int -qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma, +qla2x00_enable_eft_trace(scsi_qla_host_t *ha, dma_addr_t eft_dma, uint16_t buffers) { int rval; @@ -2363,22 +2363,47 @@ qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma, DEBUG11(printk(%s(%ld): entered.\n, __func__, ha-host_no)); mcp-mb[0] = MBC_TRACE_CONTROL; - mcp-mb[1] = ctrl; - mcp-out_mb = MBX_1|MBX_0; + mcp-mb[1] = TC_EFT_ENABLE; + mcp-mb[2] = LSW(eft_dma); + mcp-mb[3] = MSW(eft_dma); + mcp-mb[4] = LSW(MSD(eft_dma)); + mcp-mb[5] = MSW(MSD(eft_dma)); + mcp-mb[6] = buffers; + 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; - if (ctrl == TC_ENABLE) { - mcp-mb[2] = LSW(eft_dma); - mcp-mb[3] = MSW(eft_dma); - mcp-mb[4] = LSW(MSD(eft_dma)); - mcp-mb[5] = MSW(MSD(eft_dma)); - mcp-mb[6] = buffers; - mcp-mb[7] = 0; - mcp-out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2; - } mcp-tov = 30; mcp-flags = 0; rval = qla2x00_mailbox_command(ha, mcp); + if (rval != QLA_SUCCESS) { + DEBUG2_3_11(printk(%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n, + __func__, ha-host_no, rval, mcp-mb[0], mcp-mb[1
[PATCH] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
From: Seokmann Ju [EMAIL PROTECTED] There is a case where 54xx HBA loads MID firmware as it use 24xx firmware. In this case, the driver should issue MBC_MID_INITIALIZE FIRMWARE even though the HBA doesn't support NPIV. This patch make changes in the driver so that could behave accordingly. Signed-off-by: Seokmann Ju [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c |4 +++- drivers/scsi/qla2xxx/qla_mbx.c |2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 7637fa7..d0633ca 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1193,7 +1193,9 @@ qla2x00_init_rings(scsi_qla_host_t *ha) DEBUG(printk(scsi(%ld): Issue init firmware.\n, ha-host_no)); - mid_init_cb-count = cpu_to_le16(ha-max_npiv_vports); + if (ha-flags.npiv_supported) + mid_init_cb-count = cpu_to_le16(ha-max_npiv_vports); + mid_init_cb-options = __constant_cpu_to_le16(BIT_1); rval = qla2x00_init_firmware(ha, ha-init_cb_size); diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 99d29ff..0c10c0b 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -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-flags.npiv_supported) + if (ha-fw_attributes BIT_2) mcp-mb[0] = MBC_MID_INITIALIZE_FIRMWARE; else mcp-mb[0] = MBC_INITIALIZE_FIRMWARE; -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Code cleanups.
From: Adrian Bunk [EMAIL PROTECTED] - make the following needlessly global code static: - qla_attr.c: qla24xx_vport_delete() - qla_attr.c: qla24xx_vport_disable() - qla_mid.c: qla24xx_allocate_vp_id() - qla_mid.c: qla24xx_find_vhost_by_name() - qla_mid.c: qla2x00_do_dpc_vp() - qla_os.c: struct qla2x00_driver_template - qla_os.c: qla2x00_stop_timer() - qla_os.c: qla2x00_mem_alloc() - qla_os.c: qla2x00_mem_free() - qla_sup.c: qla2x00_lock_nvram_access() - qla_sup.c: qla2x00_unlock_nvram_access() - qla_sup.c: qla2x00_get_nvram_word() - qla_sup.c: qla2x00_write_nvram_word() - #if 0 the following unused global functions: - qla_mbx.c: qla2x00_system_error() - qla_os.c: remove some unneeded function prototypes - removed unused functions: - qla_dbg.c: qla2x00_dump_pkt() - qla_mbx.c: qla2x00_get_serdes_params() - qla_mbx.c: qla2x00_get_idma_speed() - qla_mbx.c: qla24xx_get_vp_database() - qla_mbx.c: qla24xx_get_vp_entry() Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Small modifications and Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |6 +- drivers/scsi/qla2xxx/qla_dbg.c | 15 drivers/scsi/qla2xxx/qla_gbl.h | 25 -- drivers/scsi/qla2xxx/qla_mbx.c | 177 +-- drivers/scsi/qla2xxx/qla_mid.c |6 +- drivers/scsi/qla2xxx/qla_os.c | 20 ++--- drivers/scsi/qla2xxx/qla_sup.c |8 +- 7 files changed, 19 insertions(+), 238 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 22b3868..adf9732 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -9,7 +9,7 @@ #include linux/kthread.h #include linux/vmalloc.h -int qla24xx_vport_disable(struct fc_vport *, bool); +static int qla24xx_vport_disable(struct fc_vport *, bool); /* SYSFS attributes - */ @@ -1129,7 +1129,7 @@ vport_create_failed_2: return FC_VPORT_FAILED; } -int +static int qla24xx_vport_delete(struct fc_vport *fc_vport) { scsi_qla_host_t *ha = shost_priv(fc_vport-shost); @@ -1162,7 +1162,7 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) return 0; } -int +static int qla24xx_vport_disable(struct fc_vport *fc_vport, bool disable) { scsi_qla_host_t *vha = fc_vport-dd_data; diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index eaa04da..796c4ce 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1428,21 +1428,6 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) printk( sp flags=0x%x\n, sp-flags); } -void -qla2x00_dump_pkt(void *pkt) -{ - uint32_t i; - uint8_t *data = (uint8_t *) pkt; - - for (i = 0; i 64; i++) { - if (!(i % 4)) - printk(\n%02x: , i); - - printk(%02x , data[i]); - } - printk(\n); -} - #if defined(QL_DEBUG_ROUTINES) /* * qla2x00_formatted_dump_buffer diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index fa4455f..fd75539 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -70,30 +70,20 @@ extern int qla2x00_loop_reset(scsi_qla_host_t *); /* * Global Functions in qla_mid.c source file. */ -extern struct scsi_host_template qla2x00_driver_template; extern struct scsi_host_template qla24xx_driver_template; extern struct scsi_transport_template *qla2xxx_transport_vport_template; -extern uint8_t qla2x00_mem_alloc(scsi_qla_host_t *); extern void qla2x00_timer(scsi_qla_host_t *); extern void qla2x00_start_timer(scsi_qla_host_t *, void *, unsigned long); -extern void qla2x00_stop_timer(scsi_qla_host_t *); -extern uint32_t qla24xx_allocate_vp_id(scsi_qla_host_t *); extern void qla24xx_deallocate_vp_id(scsi_qla_host_t *); extern int qla24xx_disable_vp (scsi_qla_host_t *); extern int qla24xx_enable_vp (scsi_qla_host_t *); -extern void qla2x00_mem_free(scsi_qla_host_t *); extern int qla24xx_control_vp(scsi_qla_host_t *, int ); extern int qla24xx_modify_vp_config(scsi_qla_host_t *); extern int qla2x00_send_change_request(scsi_qla_host_t *, uint16_t, uint16_t); extern void qla2x00_vp_stop_timer(scsi_qla_host_t *); extern int qla24xx_configure_vhba (scsi_qla_host_t *); -extern int qla24xx_get_vp_entry(scsi_qla_host_t *, uint16_t, int); -extern int qla24xx_get_vp_database(scsi_qla_host_t *, uint16_t); -extern int qla2x00_do_dpc_vp(scsi_qla_host_t *); extern void qla24xx_report_id_acquisition(scsi_qla_host_t *, struct vp_rpt_id_entry_24xx *); -extern scsi_qla_host_t * qla24xx_find_vhost_by_name(scsi_qla_host_t *, -uint8_t *); extern void qla2x00_do_dpc_all_vps(scsi_qla_host_t *); extern int qla24xx_vport_create_req_sanity_check(struct fc_vport *); extern scsi_qla_host_t * qla24xx_create_vhost(struct fc_vport *); @@ -113,7 +103,6 @@ extern void
[PATCH] qla2xxx: Add a filter to compare port_name against the physical on vport creation.
From: Seokmann Ju [EMAIL PROTECTED] During vport creation, there was a possibility to get create a vport with same port_name as pport. A new filter has added to compare given port_name with the port_name of the pport. Signed-Off-by: Seokmann Ju [EMAIL PROTECTED] Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_mid.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 325bdab..dea3768 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -341,6 +341,8 @@ qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport) /* Check up unique WWPN */ u64_to_wwn(fc_vport-port_name, port_name); + if (!memcmp(port_name, ha-port_name, WWN_SIZE)) + return VPCERR_BAD_WWN; vha = qla24xx_find_vhost_by_name(ha, port_name); if (vha) return VPCERR_BAD_WWN; -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Restrict MSI/MSI-X enablement on select ISP2432-type HBAs.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 5d2dc92..22216fe 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1829,6 +1829,18 @@ qla2x00_request_irqs(scsi_qla_host_t *ha) goto skip_msix; } + if (ha-pdev-subsystem_vendor == PCI_VENDOR_ID_HP + (ha-pdev-subsystem_device == 0x7040 || + ha-pdev-subsystem_device == 0x7041 || + ha-pdev-subsystem_device == 0x1705)) { + DEBUG2(qla_printk(KERN_WARNING, ha, + MSI-X: Unsupported ISP2432 SSVID/SSDID (0x%X, 0x%X).\n, + ha-pdev-subsystem_vendor, + ha-pdev-subsystem_device)); + + goto skip_msi; + } + ret = qla24xx_enable_msix(ha); if (!ret) { DEBUG2(qla_printk(KERN_INFO, ha, -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size
On Thu, 17 Jan 2008, Boaz Harrosh wrote: I don't forsee any issues with maintaining SG_ALL (~0) usage within qla2xxx and qla4xxx, as the number of unused entries on the HBA's request-queue shall ultimately be the rate-limiting factor. -- Please forgive me I have forgot to put the use of this constants at body, see patch below. I have seen the use of a device memory at the scsi_for_each_sg loop and was not at all sure what is the size limit for that. So I played it safe, actually I changed nothing. Please give me the OK to remove ql[24]xxx from these patches, I believe that's best, simply remove the qla2xxx/qla4xxx component from your patchset. Thanks, AV - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Wait for FLASH write-protection to complete after a write.
Some flash parts have a slow enable write-protection (WP) operation whereby subsequent FLASH accesses would fail if the WP operation had not completed. Software now polls the SPI's status-register for WP completion. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_sup.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index ad2fa01..af16c55 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -550,7 +550,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, int ret; uint32_t liter, miter; uint32_t sec_mask, rest_addr, conf_addr; - uint32_t fdata, findex ; + uint32_t fdata, findex, cnt; uint8_t man_id, flash_id; struct device_reg_24xx __iomem *reg = ha-iobase-isp24; dma_addr_t optrom_dma; @@ -690,8 +690,14 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, 0xff) | ((fdata 16) 0xff)); } - /* Enable flash write-protection. */ + /* Enable flash write-protection and wait for completion. */ qla24xx_write_flash_dword(ha, flash_conf_to_access_addr(0x101), 0x9c); + for (cnt = 300; cnt + qla24xx_read_flash_dword(ha, + flash_conf_to_access_addr(0x005)) BIT_0; + cnt--) { + udelay(10); + } /* Disable flash write. */ WRT_REG_DWORD(reg-ctrl_status, -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Retrieve additional HBA port statistics from recent ISPs.
HBAs supporting these additional counters include ISP24xx and ISP25xx type boards. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c | 44 -- drivers/scsi/qla2xxx/qla_def.h | 22 ++--- drivers/scsi/qla2xxx/qla_gbl.h |7 ++- drivers/scsi/qla2xxx/qla_mbx.c | 99 ++ 4 files changed, 74 insertions(+), 98 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 745283f..e3bda8f 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -967,35 +967,51 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) { scsi_qla_host_t *ha = shost_priv(shost); int rval; - uint16_t mb_stat[1]; - link_stat_t stat_buf; + struct link_statistics *stats; + dma_addr_t stats_dma; struct fc_host_statistics *pfc_host_stat; - rval = QLA_FUNCTION_FAILED; pfc_host_stat = ha-fc_host_stat; memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics)); + stats = dma_pool_alloc(ha-s_dma_pool, GFP_KERNEL, stats_dma); + if (stats == NULL) { + DEBUG2_3_11(printk(%s(%ld): Failed to allocate memory.\n, + __func__, ha-host_no)); + goto done; + } + memset(stats, 0, DMA_POOL_SIZE); + + rval = QLA_FUNCTION_FAILED; if (IS_FWI2_CAPABLE(ha)) { - rval = qla24xx_get_isp_stats(ha, (uint32_t *)stat_buf, - sizeof(stat_buf) / 4, mb_stat); + rval = qla24xx_get_isp_stats(ha, stats, stats_dma); } else if (atomic_read(ha-loop_state) == LOOP_READY !test_bit(ABORT_ISP_ACTIVE, ha-dpc_flags) !test_bit(ISP_ABORT_NEEDED, ha-dpc_flags) !ha-dpc_active) { /* Must be in a 'READY' state for statistics retrieval. */ - rval = qla2x00_get_link_status(ha, ha-loop_id, stat_buf, - mb_stat); + rval = qla2x00_get_link_status(ha, ha-loop_id, stats, + stats_dma); } if (rval != QLA_SUCCESS) - goto done; + goto done_free; + + pfc_host_stat-link_failure_count = stats-link_fail_cnt; + pfc_host_stat-loss_of_sync_count = stats-loss_sync_cnt; + pfc_host_stat-loss_of_signal_count = stats-loss_sig_cnt; + pfc_host_stat-prim_seq_protocol_err_count = stats-prim_seq_err_cnt; + pfc_host_stat-invalid_tx_word_count = stats-inval_xmit_word_cnt; + pfc_host_stat-invalid_crc_count = stats-inval_crc_cnt; + if (IS_FWI2_CAPABLE(ha)) { + pfc_host_stat-tx_frames = stats-tx_frames; + pfc_host_stat-rx_frames = stats-rx_frames; + pfc_host_stat-dumped_frames = stats-dumped_frames; + pfc_host_stat-nos_count = stats-nos_rcvd; + } - pfc_host_stat-link_failure_count = stat_buf.link_fail_cnt; - pfc_host_stat-loss_of_sync_count = stat_buf.loss_sync_cnt; - pfc_host_stat-loss_of_signal_count = stat_buf.loss_sig_cnt; - pfc_host_stat-prim_seq_protocol_err_count = stat_buf.prim_seq_err_cnt; - pfc_host_stat-invalid_tx_word_count = stat_buf.inval_xmit_word_cnt; - pfc_host_stat-invalid_crc_count = stat_buf.inval_crc_cnt; +done_free: +dma_pool_free(ha-s_dma_pool, stats, stats_dma); done: return pfc_host_stat; } diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index fe8f782..a33d3d5 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -862,14 +862,20 @@ typedef struct { #define GLSO_SEND_RPS BIT_0 #define GLSO_USE_DID BIT_3 -typedef struct { - uint32_tlink_fail_cnt; - uint32_tloss_sync_cnt; - uint32_tloss_sig_cnt; - uint32_tprim_seq_err_cnt; - uint32_tinval_xmit_word_cnt; - uint32_tinval_crc_cnt; -} link_stat_t; +struct link_statistics { + uint32_t link_fail_cnt; + uint32_t loss_sync_cnt; + uint32_t loss_sig_cnt; + uint32_t prim_seq_err_cnt; + uint32_t inval_xmit_word_cnt; + uint32_t inval_crc_cnt; + uint32_t unused1[0x1b]; + uint32_t tx_frames; + uint32_t rx_frames; + uint32_t dumped_frames; + uint32_t unused2[2]; + uint32_t nos_rcvd; +}; /* * NVRAM Command values. diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 09cb2a9..5b381dc 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -222,11 +222,12 @@ extern int qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map); extern int -qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *, -uint16_t *); +qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, struct link_statistics *, +dma_addr_t); extern int -qla24xx_get_isp_stats
[PATCH] qla2xxx: Fix for 32-bit platforms with 64-bit resources.
The driver stores the contents of PCI resources into unsigned long's before ioremapping. This breaks on 32-bit platforms which support 64-bit MMIO resources. Correct code by removing the temporary variables used during MMIO PIO mapping and using resource_size_t where applicable. Also correct a small typo in a printk() where the wrong region number was displayed. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |3 +-- drivers/scsi/qla2xxx/qla_os.c | 22 +++--- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index a33d3d5..d0b78af 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2271,8 +2271,7 @@ typedef struct scsi_qla_host { int bars; device_reg_t __iomem *iobase; /* Base I/O address */ - unsigned long pio_address; - unsigned long pio_length; + resource_size_t pio_address; #define MIN_IOBASE_LEN 0x100 /* ISP ring lock, rings, and indexes */ diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 8ecc047..ab7abe0 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1479,8 +1479,7 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha) static int qla2x00_iospace_config(scsi_qla_host_t *ha) { - unsigned long pio, pio_len, pio_flags; - unsigned long mmio, mmio_len, mmio_flags; + resource_size_t pio; if (pci_request_selected_regions(ha-pdev, ha-bars, QLA2XXX_DRIVER_NAME)) { @@ -1495,10 +1494,8 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) /* We only need PIO for Flash operations on ISP2312 v2 chips. */ pio = pci_resource_start(ha-pdev, 0); - pio_len = pci_resource_len(ha-pdev, 0); - pio_flags = pci_resource_flags(ha-pdev, 0); - if (pio_flags IORESOURCE_IO) { - if (pio_len MIN_IOBASE_LEN) { + if (pci_resource_flags(ha-pdev, 0) IORESOURCE_IO) { + if (pci_resource_len(ha-pdev, 0) MIN_IOBASE_LEN) { qla_printk(KERN_WARNING, ha, Invalid PCI I/O region size (%s)...\n, pci_name(ha-pdev)); @@ -1511,28 +1508,23 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) pio = 0; } ha-pio_address = pio; - ha-pio_length = pio_len; skip_pio: /* Use MMIO operations for all accesses. */ - mmio = pci_resource_start(ha-pdev, 1); - mmio_len = pci_resource_len(ha-pdev, 1); - mmio_flags = pci_resource_flags(ha-pdev, 1); - - if (!(mmio_flags IORESOURCE_MEM)) { + if (!(pci_resource_flags(ha-pdev, 1) IORESOURCE_MEM)) { qla_printk(KERN_ERR, ha, - region #0 not an MMIO resource (%s), aborting\n, + region #1 not an MMIO resource (%s), aborting\n, pci_name(ha-pdev)); goto iospace_error_exit; } - if (mmio_len MIN_IOBASE_LEN) { + if (pci_resource_len(ha-pdev, 1) MIN_IOBASE_LEN) { qla_printk(KERN_ERR, ha, Invalid PCI mem region size (%s), aborting\n, pci_name(ha-pdev)); goto iospace_error_exit; } - ha-iobase = ioremap(mmio, MIN_IOBASE_LEN); + ha-iobase = ioremap(pci_resource_start(ha-pdev, 1), MIN_IOBASE_LEN); if (!ha-iobase) { qla_printk(KERN_ERR, ha, cannot remap MMIO (%s), aborting\n, pci_name(ha-pdev)); -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Don't schedule the DPC routine to perform an issue-lip request.
As the driver depends on the DPC routine to handle bottom-half loop resynchronization in order to recover from the issue-lip request. The issue_lip call is sleeping context capable, so just issue the reset function there. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |2 +- drivers/scsi/qla2xxx/qla_gbl.h |2 ++ drivers/scsi/qla2xxx/qla_os.c |3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index e3bda8f..22b3868 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -958,7 +958,7 @@ qla2x00_issue_lip(struct Scsi_Host *shost) { scsi_qla_host_t *ha = shost_priv(shost); - set_bit(LOOP_RESET_NEEDED, ha-dpc_flags); + qla2x00_loop_reset(ha); return 0; } diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 5b381dc..f6917b9 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -65,6 +65,8 @@ extern int ql2xextended_error_logging; extern int ql2xqfullrampup; extern int num_hosts; +extern int qla2x00_loop_reset(scsi_qla_host_t *); + /* * Global Functions in qla_mid.c source file. */ diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index ab7abe0..bb2d3d6 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -105,7 +105,6 @@ static int qla2xxx_eh_abort(struct scsi_cmnd *); static int qla2xxx_eh_device_reset(struct scsi_cmnd *); static int qla2xxx_eh_bus_reset(struct scsi_cmnd *); static int qla2xxx_eh_host_reset(struct scsi_cmnd *); -static int qla2x00_loop_reset(scsi_qla_host_t *ha); static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); static int qla2x00_change_queue_depth(struct scsi_device *, int); @@ -1060,7 +1059,7 @@ eh_host_reset_lock: * Returns: * 0 = success */ -static int +int qla2x00_loop_reset(scsi_qla_host_t *ha) { int ret; -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Correct late-memset() of EFT buffer.
Original code would clear the buffer after the firmware had already been initialized to use the buffer, thus potentially and inadvertantly clearing data previously DMA'd by the firmware. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index cacfd25..7637fa7 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -766,6 +766,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) goto cont_alloc; } + memset(tc, 0, EFT_SIZE); rval = qla2x00_enable_eft_trace(ha, tc_dma, EFT_NUM_BUFFERS); if (rval) { qla_printk(KERN_WARNING, ha, Unable to initialize @@ -779,7 +780,6 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) EFT_SIZE / 1024); eft_size = EFT_SIZE; - memset(tc, 0, eft_size); ha-eft_dma = tc_dma; ha-eft = tc; -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Update version number to 8.02.00-k7.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 6e3dc40..2c2f6b4 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION 8.02.00-k6 +#define QLA2XXX_VERSION 8.02.00-k7 #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 -- 1.5.4.rc3.14.g44397 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] qla2xxx: Use completion routines.
From: Marcus Barrow [EMAIL PROTECTED] Instead of abusing the semaphore interfaces for mailbox command completions. Additional cleanups and Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |4 +- drivers/scsi/qla2xxx/qla_gbl.h |2 - drivers/scsi/qla2xxx/qla_isr.c |8 +++--- drivers/scsi/qla2xxx/qla_mbx.c | 44 +++ drivers/scsi/qla2xxx/qla_mid.c |5 ++- drivers/scsi/qla2xxx/qla_os.c | 22 ++- 6 files changed, 16 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index d0b78af..144f6d0 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2413,9 +2413,9 @@ typedef struct scsi_qla_host { #define MBX_INTR_WAIT 2 #define MBX_UPDATE_FLASH_ACTIVE3 - struct semaphore mbx_cmd_sem; /* Serialialize mbx access */ struct semaphore vport_sem; /* Virtual port synchronization */ - struct semaphore mbx_intr_sem; /* Used for completion notification */ + struct completion mbx_cmd_comp; /* Serialize mbx access */ + struct completion mbx_intr_comp; /* Used for completion notification */ uint32_tmbx_flags; #define MBX_IN_PROGRESS BIT_0 diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index f6917b9..fa4455f 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -105,8 +105,6 @@ extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int); extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int); -extern int qla2x00_down_timeout(struct semaphore *, unsigned long); - extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *); extern int qla2x00_wait_for_hba_online(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 22216fe..642a0c3 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -104,7 +104,7 @@ qla2100_intr_handler(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return (IRQ_HANDLED); @@ -216,7 +216,7 @@ qla2300_intr_handler(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return (IRQ_HANDLED); @@ -1597,7 +1597,7 @@ qla24xx_intr_handler(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return IRQ_HANDLED; @@ -1734,7 +1734,7 @@ qla24xx_msix_default(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return IRQ_HANDLED; diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 0fc1652..d23d6fc 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -8,19 +8,6 @@ #include linux/delay.h -static void -qla2x00_mbx_sem_timeout(unsigned long data) -{ - struct semaphore*sem_ptr = (struct semaphore *)data; - - DEBUG11(printk(qla2x00_sem_timeout: entered.\n)); - - if (sem_ptr != NULL) { - up(sem_ptr); - } - - DEBUG11(printk(qla2x00_mbx_sem_timeout: exiting.\n)); -} /* * qla2x00_mailbox_command @@ -47,7 +34,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *pvha, mbx_cmd_t *mcp) int rval; unsigned longflags = 0; device_reg_t __iomem *reg; - struct timer_list tmp_intr_timer; uint8_t abort_active; uint8_t io_lock_on; uint16_tcommand; @@ -72,7 +58,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *pvha, mbx_cmd_t *mcp) * non ISP abort time. */ if (!abort_active) { - if (qla2x00_down_timeout(ha-mbx_cmd_sem, mcp-tov * HZ)) { + if (!wait_for_completion_timeout(ha-mbx_cmd_comp, + mcp-tov * HZ)) { /* Timeout occurred. Return error. */ DEBUG2_3_11(printk(%s(%ld): cmd access timeout. Exiting.\n, __func__, ha
[PATCH] qla2xxx: Add Fibre Channel Event (FCE) tracing support.
FCE support enables the firmware to record FC extended link services and basic link services frames which have been transmitted and received by the ISP. This allows for a limited view of the FC traffic through the ISP without using a FC analyzer. This can be useful in situations where a physical connection to the FC bus is not possible. The driver exports this information in two ways -- first, via a debugfs node exported for all supported ISPs under: debugfs_mount_point/qla2xxx/qla2xxx_host_no/fce where a read of the 'fce' file will provide a snapshot of the firmware's FCE buffer; and finally, the FCE buffer will be extracted during a firmware-dump scenario. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/Makefile |2 +- drivers/scsi/qla2xxx/qla_dbg.c | 22 + drivers/scsi/qla2xxx/qla_dbg.h | 19 drivers/scsi/qla2xxx/qla_def.h | 10 ++ drivers/scsi/qla2xxx/qla_dfs.c | 175 +++ drivers/scsi/qla2xxx/qla_fw.h |7 ++ drivers/scsi/qla2xxx/qla_gbl.h | 13 +++ drivers/scsi/qla2xxx/qla_init.c | 73 +--- drivers/scsi/qla2xxx/qla_mbx.c | 87 +++ drivers/scsi/qla2xxx/qla_os.c | 11 +++ 10 files changed, 405 insertions(+), 14 deletions(-) create mode 100644 drivers/scsi/qla2xxx/qla_dfs.c diff --git a/drivers/scsi/qla2xxx/Makefile b/drivers/scsi/qla2xxx/Makefile index 71ddb5d..c51fd1f 100644 --- a/drivers/scsi/qla2xxx/Makefile +++ b/drivers/scsi/qla2xxx/Makefile @@ -1,4 +1,4 @@ qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ - qla_dbg.o qla_sup.o qla_attr.o qla_mid.o + qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 796c4ce..d88e98c 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1051,6 +1051,7 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) struct qla25xx_fw_dump *fw; uint32_text_mem_cnt; void*nxt; + struct qla2xxx_fce_chain *fcec; risc_address = ext_mem_cnt = 0; flags = 0; @@ -1321,10 +1322,31 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (rval != QLA_SUCCESS) goto qla25xx_fw_dump_failed_0; + /* Fibre Channel Trace Buffer. */ nxt = qla2xxx_copy_queues(ha, nxt); if (ha-eft) memcpy(nxt, ha-eft, ntohl(ha-fw_dump-eft_size)); + /* Fibre Channel Event Buffer. */ + if (!ha-fce) + goto qla25xx_fw_dump_failed_0; + + ha-fw_dump-version |= __constant_htonl(DUMP_CHAIN_VARIANT); + + fcec = nxt + ntohl(ha-fw_dump-eft_size); + fcec-type = __constant_htonl(DUMP_CHAIN_FCE | DUMP_CHAIN_LAST); + fcec-chain_size = htonl(sizeof(struct qla2xxx_fce_chain) + + fce_calc_size(ha-fce_bufs)); + fcec-size = htonl(fce_calc_size(ha-fce_bufs)); + fcec-addr_l = htonl(LSD(ha-fce_dma)); + fcec-addr_h = htonl(MSD(ha-fce_dma)); + + iter_reg = fcec-eregs; + for (cnt = 0; cnt 8; cnt++) + *iter_reg++ = htonl(ha-fce_mb[cnt]); + + memcpy(iter_reg, ha-fce, ntohl(fcec-size)); + qla25xx_fw_dump_failed_0: if (rval != QLA_SUCCESS) { qla_printk(KERN_WARNING, ha, diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h index a50ecf0..524598a 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.h +++ b/drivers/scsi/qla2xxx/qla_dbg.h @@ -256,6 +256,25 @@ struct qla25xx_fw_dump { #define EFT_BYTES_PER_BUFFER 0x4000 #define EFT_SIZE ((EFT_BYTES_PER_BUFFER) * (EFT_NUM_BUFFERS)) +#define FCE_NUM_BUFFERS64 +#define FCE_BYTES_PER_BUFFER 0x400 +#define FCE_SIZE ((FCE_BYTES_PER_BUFFER) * (FCE_NUM_BUFFERS)) +#define fce_calc_size(b) ((FCE_BYTES_PER_BUFFER) * (b)) + +struct qla2xxx_fce_chain { + uint32_t type; + uint32_t chain_size; + + uint32_t size; + uint32_t addr_l; + uint32_t addr_h; + uint32_t eregs[8]; +}; + +#define DUMP_CHAIN_VARIANT 0x8000 +#define DUMP_CHAIN_FCE 0x7AF0 +#define DUMP_CHAIN_LAST0x8000 + struct qla2xxx_fw_dump { uint8_t signature[4]; uint32_t version; diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 3f934bd..6f129da 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2156,6 +2156,7 @@ typedef struct scsi_qla_host { uint32_tgpsc_supported :1; uint32_tvsan_enabled:1; uint32_tnpiv_supported :1; + uint32_tfce_enabled :1; } flags; atomic_tloop_state; @@ -2449,6 +2450,15 @@ typedef struct scsi_qla_host
Re: [PATCH 0/14] qla2xxx: updates for 2.6.24 [8.02.00-k7].
On Thu, 17 Jan 2008, Andrew Vasquez wrote: This patchset updates the qla2xxx driver to 8.02.00-k7. ... BTW: Small typo in the subject, it's obvious these patches aren't for 2.6.24, instead, meant for the next merge window of 2.6.25... - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/14] qla2xxx: updates for 2.6.24 [8.02.00-k7].
This patchset updates the qla2xxx driver to 8.02.00-k7. drivers/scsi/qla2xxx/Makefile |2 +- drivers/scsi/qla2xxx/qla_attr.c| 52 +++-- drivers/scsi/qla2xxx/qla_dbg.c | 37 ++-- drivers/scsi/qla2xxx/qla_dbg.h | 19 ++ drivers/scsi/qla2xxx/qla_def.h | 42 +++-- drivers/scsi/qla2xxx/qla_dfs.c | 175 +++ drivers/scsi/qla2xxx/qla_fw.h | 14 ++ drivers/scsi/qla2xxx/qla_gbl.h | 51 ++--- drivers/scsi/qla2xxx/qla_init.c| 80 ++-- drivers/scsi/qla2xxx/qla_isr.c | 105 - drivers/scsi/qla2xxx/qla_mbx.c | 426 drivers/scsi/qla2xxx/qla_mid.c | 13 +- drivers/scsi/qla2xxx/qla_os.c | 80 +++- drivers/scsi/qla2xxx/qla_sup.c | 18 +- drivers/scsi/qla2xxx/qla_version.h |2 +- 15 files changed, 616 insertions(+), 500 deletions(-) here's the commits: - Consolidate duplicate sense-data handling codes. - Retrieve additional HBA port statistics from recent ISPs. - Fix for 32-bit platforms with 64-bit resources. - Wait for FLASH write-protection to complete after a write. - Restrict MSI/MSI-X enablement on select ISP2432-type HBAs. - Don't schedule the DPC routine to perform an issue-lip request. - Use completion routines. - Add a filter to compare port_name against the physical on vport creation. - Code cleanups. - Trace-Control naming cleanups. - Add Fibre Channel Event (FCE) tracing support. - Correct late-memset() of EFT buffer. - Issue correct MBC_INITIALIZE_FIRMWARE command. - Update version number to 8.02.00-k7. Regards, Andrew Vasquez QLogic Corporation - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] qla2xyz: fix section mismatch
On Thu, 10 Jan 2008, Randy Dunlap wrote: From: Randy Dunlap [EMAIL PROTECTED] Fix section mismatch: qla2x00_remove_one() should not be __devexit. WARNING: vmlinux.o(.text+0xb014f5): Section mismatch: reference to .exit.text: (between 'qla2xxx_pci_error_detected' and 'qla2xxx_pci_mmio_enabled') Signed-off-by: Randy Dunlap [EMAIL PROTECTED] Adriann B. posted this fix already: http://article.gmane.org/gmane.linux.scsi/36387 I was expecting it to be carried in the -mm tree since it was acked: http://article.gmane.org/gmane.linux.scsi/36516 I can add it to the patch queue if necessary. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Number of devices that SCSI can support
On Wed, 09 Jan 2008, Matthew Wilcox wrote: On Wed, Jan 09, 2008 at 09:05:52AM -0600, James Bottomley wrote: On Tue, 2008-01-08 at 19:22 -0700, Matthew Wilcox wrote: On Tue, Jan 08, 2008 at 04:55:46PM -0800, Vinay Venkataraghavan wrote: Is there a limit on the number of devices that SCSI supports. In other words, I have a QLogic HBA card, and I am connecting to a SAN which has 64 targets. I've personally had over five hundred LUNs. You shouldn't be hitting a limit here. I believe the largest test that's been run was the old OSDL CGL workgroup ... they went up to 4096. However, LUN support depends on the driver and HBA parameters as well (some choose to have arbitrary limits). I was using a qlogic HBA for my tests, so I don't think this is the problem -- although the original poster claims to have 64 targets, and I had only one target with 128 luns (attached 4 times). -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. Not sure what's going on as well, perhaps some logs could help... But the inbox qla2xxx driver in RHEL4 set's an HBA's scsi_host-max_id count to 512 (also verified with several test rings), so there shouldn't be a problem handling 64 distinct targets (FC ports). - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 18/30] scsi/qla2xxx/: possible cleanups
On Fri, 21 Dec 2007, Andrew Morton wrote: On Fri, 14 Dec 2007 10:20:04 -0800 Andrew Vasquez [EMAIL PROTECTED] wrote: It is, though, not widely publicized: git://avgit01.qlogic.com/qla2xxx-upstream The repo is torndown and rebased on frequent a basis, and is meant to provide a snapshot of where qla2xxx is at any given time. Currently it's comprised of linux-2.6.git with scsi-misc-2.6.git merged and a dozen or so patches queued for the next merge window (2.6.25). That should be OK. Sometimes ugly things can happen if James syncs with Linus and you don't: when I ask git to generate the james-you diff, it will generate a patch which reverts the Linus changes which are in James's tree but which aren't in yours. I have an alternative pull-git-trees script which tries to fix that but not very successfully. But whatever, we'll see. One slight problem though: fatal: Unable to look up avgit01.qlogic.com (port 9418) (Name or service not known) I think I might need to be [EMAIL PROTECTED] to get at that? Hmm, my mistake, turns out the external name is git.qlogic.com. This worked for me from an external line. $ git clone git://git.qlogic.com/qla2xxx-upstream Thanks, AV - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] drivers/scsi/: Spelling fixes
On Mon, 17 Dec 2007, Joe Perches wrote: Signed-off-by: Joe Perches [EMAIL PROTECTED] --- drivers/scsi/NCR53C9x.h |2 +- drivers/scsi/aic7xxx/aic79xx_inline.h |2 +- drivers/scsi/aic7xxx/aic79xx_osm.c|2 +- drivers/scsi/aic7xxx/aic79xx_pci.c|4 ++-- drivers/scsi/aic7xxx/aic7xxx_inline.h |2 +- drivers/scsi/aic7xxx/aic7xxx_osm.c|2 +- drivers/scsi/ipr.c|2 +- drivers/scsi/ips.c|2 +- drivers/scsi/iscsi_tcp.c |4 ++-- drivers/scsi/lpfc/lpfc.h |2 +- drivers/scsi/lpfc/lpfc_mbox.c |2 +- drivers/scsi/megaraid/megaraid_mbox.c | 10 +- drivers/scsi/psi240i.c|2 +- drivers/scsi/qla2xxx/qla_gs.c |2 +- qla2xxx bits: Acked-by: Andrew Vasquez [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/4] qla2xxx: fixes for 2.6.24 [8.02.00-k6].
This patchset contains fixes for 2.6.24. drivers/scsi/qla2xxx/qla_attr.c|2 +- drivers/scsi/qla2xxx/qla_def.h | 10 +- drivers/scsi/qla2xxx/qla_fw.h | 16 ++-- drivers/scsi/qla2xxx/qla_init.c| 19 +++ drivers/scsi/qla2xxx/qla_isr.c | 11 +-- drivers/scsi/qla2xxx/qla_mbx.c |4 ++-- drivers/scsi/qla2xxx/qla_mid.c | 33 - drivers/scsi/qla2xxx/qla_version.h |2 +- 8 files changed, 39 insertions(+), 58 deletions(-) here's the commits: - Don't explicitly read mbx registers while processing a system-error. - Correct NPIV support for recent ISPs. - Properly handle Vport state-change-notifications. - Update version number to 8.02.00-k6. Regards, Andrew Vasquez QLogic Corporation - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] qla2xxx: Don't explicitly read mbx registers while processing a system-error.
Callers of qla2x00_async_event() already populate the mb[] array upon invocation, doing so via the appropriate mailbox register accessors. The stale codes removed are leftover-bits kept during the FWI2 transition. Though relatively benign, the extra-reads are not valid for FWI2 boards (ISP24xx and above) and peek into the incorrect regions of registers. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 1104bd2..343af39 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -347,10 +347,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) break; case MBA_SYSTEM_ERR:/* System Error */ - mb[1] = RD_MAILBOX_REG(ha, reg, 1); - mb[2] = RD_MAILBOX_REG(ha, reg, 2); - mb[3] = RD_MAILBOX_REG(ha, reg, 3); - qla_printk(KERN_INFO, ha, ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n, mb[1], mb[2], mb[3]); -- 1.5.3.5.643.g40e25 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/4] qla2xxx: Properly handle Vport state-change-notifications.
From: Shyam Sundar [EMAIL PROTECTED] Drivers do SCRs for each Vport. When something changes in the fabric, firmware generates one interrupt for each RSCN. Based on the current implementation, in each case, we make recursive calls to handle RSCN for physical and each subsequent virtual ports. The fix is to also take into consideration the vp_idx, which is set by the firmware to indicate the vport the RSCN was meant for. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 343af39..798b7e8 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -575,12 +575,15 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) /* 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; DEBUG2(printk(scsi(%ld): Asynchronous RSCR UPDATE.\n, ha-host_no)); DEBUG(printk(KERN_INFO - scsi(%ld): RSCN database changed -- %04x %04x.\n, - ha-host_no, mb[1], mb[2])); + scsi(%ld): RSCN database changed -- %04x %04x %04x.\n, + ha-host_no, mb[1], mb[2], mb[3])); rscn_entry = (mb[1] 16) | mb[2]; host_pid = (ha-d_id.b.domain 16) | (ha-d_id.b.area 8) | -- 1.5.3.5.643.g40e25 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/4] qla2xxx: Update version number to 8.02.00-k6.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index ae6f7a2..6e3dc40 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION 8.02.00-k5 +#define QLA2XXX_VERSION 8.02.00-k6 #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 -- 1.5.3.5.643.g40e25 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/4] qla2xxx: Correct NPIV support for recent ISPs.
Firmware will export to software the maximum number of vports supported for any given firmware version and ISP type. Use this information rather than the current hardcoding of limitations within the driver. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |2 +- drivers/scsi/qla2xxx/qla_def.h | 10 +- drivers/scsi/qla2xxx/qla_fw.h | 16 ++-- drivers/scsi/qla2xxx/qla_init.c | 19 +++ drivers/scsi/qla2xxx/qla_mbx.c |4 ++-- drivers/scsi/qla2xxx/qla_mid.c | 33 - 6 files changed, 33 insertions(+), 51 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index fb388b8..745283f 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1124,7 +1124,7 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) down(ha-vport_sem); ha-cur_vport_count--; - clear_bit(vha-vp_idx, (unsigned long *)ha-vp_idx_map); + clear_bit(vha-vp_idx, ha-vp_idx_map); up(ha-vport_sem); kfree(vha-node_name); diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 04e8cbc..fe8f782 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2116,14 +2116,6 @@ struct qla_msix_entry { #defineWATCH_INTERVAL 1 /* number of seconds */ -/* NPIV */ -#define MAX_MULTI_ID_LOOP 126 -#define MAX_MULTI_ID_FABRIC64 -#define MAX_NUM_VPORT_LOOP (MAX_MULTI_ID_LOOP - 1) -#define MAX_NUM_VPORT_FABRIC(MAX_MULTI_ID_FABRIC - 1) -#define MAX_NUM_VHBA_LOOP (MAX_MULTI_ID_LOOP - 1) -#define MAX_NUM_VHBA_FABRIC (MAX_MULTI_ID_FABRIC - 1) - /* * Linux Host Adapter structure */ @@ -2507,7 +2499,7 @@ typedef struct scsi_qla_host { struct list_headvp_list;/* list of VP */ struct fc_vport *fc_vport; /* holds fc_vport * for each vport */ - uint8_t vp_idx_map[16]; + unsigned long vp_idx_map[(MAX_MULTI_ID_FABRIC / 8) / sizeof(unsigned long)]; uint16_tnum_vhosts; /* number of vports created */ uint16_tnum_vsans; /* number of vsan created */ uint16_tvp_idx; /* vport ID */ diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index 25364b1..69a5e31 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -954,7 +954,15 @@ struct device_reg_24xx { /* MID Support ***/ -#define MAX_MID_VPS125 +#define MIN_MULTI_ID_FABRIC64 /* Must be power-of-2. */ +#define MAX_MULTI_ID_FABRIC256 /* ... */ + +#define for_each_mapped_vp_idx(_ha, _idx) \ + for (_idx = find_next_bit((_ha)-vp_idx_map,\ + (_ha)-max_npiv_vports + 1, 1); \ + _idx = (_ha)-max_npiv_vports; \ + _idx = find_next_bit((_ha)-vp_idx_map, \ + (_ha)-max_npiv_vports + 1, _idx + 1)) \ struct mid_conf_entry_24xx { uint16_t reserved_1; @@ -982,7 +990,7 @@ struct mid_init_cb_24xx { uint16_t count; uint16_t options; - struct mid_conf_entry_24xx entries[MAX_MID_VPS]; + struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC]; }; @@ -1002,10 +1010,6 @@ struct mid_db_entry_24xx { uint8_t reserved_1; }; -struct mid_db_24xx { - struct mid_db_entry_24xx entries[MAX_MID_VPS]; -}; - /* * Virtual Fabric ID type definition. */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 191dafd..03444d6 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -922,9 +922,9 @@ qla2x00_setup_chip(scsi_qla_host_t *ha) ha-flags.npiv_supported = 1; if ((!ha-max_npiv_vports) || ((ha-max_npiv_vports + 1) % - MAX_MULTI_ID_FABRIC)) + MIN_MULTI_ID_FABRIC)) ha-max_npiv_vports = - MAX_NUM_VPORT_FABRIC; + MIN_MULTI_ID_FABRIC - 1; } if (ql2xallocfwdump) @@ -1162,7 +1162,8 @@ qla2x00_init_rings(scsi_qla_host_t *ha) DEBUG(printk(scsi(%ld): Issue init firmware.\n, ha-host_no)); - mid_init_cb-count = ha-max_npiv_vports; + mid_init_cb-count = cpu_to_le16(ha-max_npiv_vports); + mid_init_cb-options = __constant_cpu_to_le16(BIT_1); rval = qla2x00_init_firmware(ha, ha-init_cb_size); if (rval
[PATCH 8/8] qla2xxx: Update version number to 8.02.00-k5.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 2d551a3..ae6f7a2 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION 8.02.00-k4 +#define QLA2XXX_VERSION 8.02.00-k5 #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 -- 1.5.3.4.206.g58ba4 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/8] qla2xxx: Correct display of ISP serial-number.
The original serial-number calculations based on WWPN no longer apply to newer ISPs (ISP24xx and ISP25xx). These newer board's serial number reside in the VPD. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 2f0bd5a..fb388b8 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -538,6 +538,9 @@ qla2x00_serial_num_show(struct class_device *cdev, char *buf) scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev)); uint32_t sn; + if (IS_FWI2_CAPABLE(ha)) + return snprintf(buf, PAGE_SIZE, \n); + sn = ((ha-serial0 0x1f) 16) | (ha-serial2 8) | ha-serial1; return snprintf(buf, PAGE_SIZE, %c%05d\n, 'A' + sn / 10, sn % 10); -- 1.5.3.4.206.g58ba4 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/8] qla2xxx: Correct residual-count handling discrepancies during UNDERRUN handling.
For recent ISPs, software during CS_UNDERRUN handling must determine if the two residuals, firmware-calculated and FCP_RSP, are different to recognize if a frame has been dropped. Update the driver to catch this condition, and clear the SS_RESIDUAL_UNDER and lscsi_status bits. This logic is consistent with what earlier firmwares did by explicitly cracking open the FCP_RSP statuses and clearing SS_RESIDUAL_UNDER. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index c4768c4..1104bd2 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1012,8 +1012,14 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) case CS_DATA_UNDERRUN: resid = resid_len; /* Use F/W calculated residual length. */ - if (IS_FWI2_CAPABLE(ha)) + if (IS_FWI2_CAPABLE(ha)) { + if (scsi_status SS_RESIDUAL_UNDER + resid != fw_resid_len) { + scsi_status = ~SS_RESIDUAL_UNDER; + lscsi_status = 0; + } resid = fw_resid_len; + } if (scsi_status SS_RESIDUAL_UNDER) { scsi_set_resid(cp, resid); -- 1.5.3.4.206.g58ba4 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/8] qla2xxx: Handle unaligned sector writes during NVRAM/VPD updates.
Since both NVRAM and VPD regions of the flash reside on unaligned sector boundaries, during update, the driver must perform a read-modify-write operation to the composite NVRAM/VPD region. This affects ISP25xx type boards only. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |6 -- drivers/scsi/qla2xxx/qla_sup.c | 23 +-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 05fa779..2f0bd5a 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -114,7 +114,6 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, { struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); - unsigned long flags; uint16_tcnt; if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha-nvram_size) @@ -144,11 +143,9 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, } /* Write NVRAM. */ - spin_lock_irqsave(ha-hardware_lock, flags); ha-isp_ops-write_nvram(ha, (uint8_t *)buf, ha-nvram_base, count); ha-isp_ops-read_nvram(ha, (uint8_t *)ha-nvram, ha-nvram_base, count); - spin_unlock_irqrestore(ha-hardware_lock, flags); set_bit(ISP_ABORT_NEEDED, ha-dpc_flags); @@ -397,16 +394,13 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, { struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); - unsigned long flags; if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha-vpd_size) return 0; /* Write NVRAM. */ - spin_lock_irqsave(ha-hardware_lock, flags); ha-isp_ops-write_nvram(ha, (uint8_t *)buf, ha-vpd_base, count); ha-isp_ops-read_nvram(ha, (uint8_t *)ha-vpd, ha-vpd_base, count); - spin_unlock_irqrestore(ha-hardware_lock, flags); return count; } diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 40b059f..b3faff0 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -7,6 +7,7 @@ #include qla_def.h #include linux/delay.h +#include linux/vmalloc.h #include asm/uaccess.h static uint16_t qla2x00_nvram_request(scsi_qla_host_t *, uint32_t); @@ -745,9 +746,11 @@ qla2x00_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr, int ret, stat; uint32_t i; uint16_t *wptr; + unsigned long flags; ret = QLA_SUCCESS; + spin_lock_irqsave(ha-hardware_lock, flags); qla2x00_lock_nvram_access(ha); /* Disable NVRAM write-protection. */ @@ -764,6 +767,7 @@ qla2x00_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr, qla2x00_set_nvram_protection(ha, stat); qla2x00_unlock_nvram_access(ha); + spin_unlock_irqrestore(ha-hardware_lock, flags); return ret; } @@ -776,9 +780,11 @@ qla24xx_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr, uint32_t i; uint32_t *dwptr; struct device_reg_24xx __iomem *reg = ha-iobase-isp24; + unsigned long flags; ret = QLA_SUCCESS; + spin_lock_irqsave(ha-hardware_lock, flags); /* Enable flash write. */ WRT_REG_DWORD(reg-ctrl_status, RD_REG_DWORD(reg-ctrl_status) | CSRX_FLASH_ENABLE); @@ -812,6 +818,7 @@ qla24xx_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr, WRT_REG_DWORD(reg-ctrl_status, RD_REG_DWORD(reg-ctrl_status) ~CSRX_FLASH_ENABLE); RD_REG_DWORD(reg-ctrl_status);/* PCI Posting. */ + spin_unlock_irqrestore(ha-hardware_lock, flags); return ret; } @@ -836,8 +843,20 @@ int qla25xx_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr, uint32_t bytes) { - return qla24xx_write_flash_data(ha, (uint32_t *)buf, - FA_VPD_NVRAM_ADDR | naddr, bytes 2); +#define RMW_BUFFER_SIZE(64 * 1024) + uint8_t *dbuf; + + dbuf = vmalloc(RMW_BUFFER_SIZE); + if (!dbuf) + return QLA_MEMORY_ALLOC_FAILED; + ha-isp_ops-read_optrom(ha, dbuf, FA_VPD_NVRAM_ADDR 2, + RMW_BUFFER_SIZE); + memcpy(dbuf + (naddr 2), buf, bytes); + ha-isp_ops-write_optrom(ha, dbuf, FA_VPD_NVRAM_ADDR 2, + RMW_BUFFER_SIZE); + vfree(dbuf); + + return QLA_SUCCESS; } static inline void -- 1.5.3.4.206.g58ba4 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/8] qla2xxx: Defer explicit interrupt-polling processing to init-time scenarios.
As the intermixing may cause issues where HCCR bits could be cleared inappropriately during MSI/MSI-X interrupt handling. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_iocb.c |2 +- drivers/scsi/qla2xxx/qla_mbx.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 7f6a89b..024c662 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -525,7 +525,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha) /* Check for pending interrupts. */ /* During init we issue marker directly */ - if (!ha-marker_needed) + if (!ha-marker_needed !ha-flags.init_done) qla2x00_poll(ha); spin_lock_irq(ha-hardware_lock); diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index c53ec67..ccd662a 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -252,7 +252,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *pvha, mbx_cmd_t *mcp) /* Clean up */ ha-mcp = NULL; - if (!abort_active) { + if (abort_active || !io_lock_on) { DEBUG11(printk(%s(%ld): checking for additional resp interrupt.\n, __func__, ha-host_no)); -- 1.5.3.4.206.g58ba4 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/8] qla2xxx: Resync with latest HBA SSID specification -- 2.2u.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_devtbl.h |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_devtbl.h b/drivers/scsi/qla2xxx/qla_devtbl.h index dd43541..d78d35e 100644 --- a/drivers/scsi/qla2xxx/qla_devtbl.h +++ b/drivers/scsi/qla2xxx/qla_devtbl.h @@ -1,4 +1,4 @@ -#define QLA_MODEL_NAMES0x57 +#define QLA_MODEL_NAMES0x5C /* * Adapter model names and descriptions. @@ -91,4 +91,9 @@ static char *qla2x00_model_name[QLA_MODEL_NAMES*2] = { , ,/* 0x154 */ QLE220, PCI-Express to 4Gb FC, Single Channel,/* 0x155 */ QLE220, PCI-Express to 4Gb FC, Single Channel,/* 0x156 */ +, ,/* 0x157 */ +, ,/* 0x158 */ +, ,/* 0x159 */ +, ,/* 0x15a */ + QME2472, Dell BS PCI-Express to 4Gb FC, Dual Channel, /* 0x15b */ }; -- 1.5.3.4.206.g58ba4 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/8] qla2xxx: Driver updates for 2.6.24 [8.02.00-k5].
This patchset updates the qla2xxx driver to 8.02.00-k5 drivers/scsi/qla2xxx/qla_attr.c|9 ++ drivers/scsi/qla2xxx/qla_def.h |1 + drivers/scsi/qla2xxx/qla_devtbl.h |7 - drivers/scsi/qla2xxx/qla_iocb.c|2 +- drivers/scsi/qla2xxx/qla_isr.c |8 +- drivers/scsi/qla2xxx/qla_mbx.c |2 +- drivers/scsi/qla2xxx/qla_os.c | 50 +-- drivers/scsi/qla2xxx/qla_sup.c | 25 -- drivers/scsi/qla2xxx/qla_version.h |2 +- 9 files changed, 72 insertions(+), 34 deletions(-) here's the commits: - Resync with latest HBA SSID specification -- 2.2u. - Defer explicit interrupt-polling processing to init-time scenarios. - Handle unaligned sector writes during NVRAM/VPD updates. - Fix issue where final flash-segment updates were falling into the slow-path write handler. - Make driver (mostly) legacy I/O port free. - Correct residual-count handling discrepancies during UNDERRUN handling. - Correct display of ISP serial-number. - Update version number to 8.02.00-k5. Regards, Andrew Vasquez QLogic Corporation - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/8] qla2xxx: Fix issue where final flash-segment updates were falling into the slow-path write handler.
Original implementation would not use the burst-write mechanisms for requests equal to OPTROM_BURST_DWORDS transfer dwords. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_sup.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index b3faff0..0a35f87 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -643,7 +643,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, } /* Go with burst-write. */ - if (optrom (liter + OPTROM_BURST_DWORDS) dwords) { + if (optrom (liter + OPTROM_BURST_DWORDS) = dwords) { /* Copy data to DMA'ble buffer. */ for (miter = 0, s = optrom, d = dwptr; miter OPTROM_BURST_DWORDS; miter++, s++, d++) -- 1.5.3.4.206.g58ba4 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/8] qla2xxx: Make driver (mostly) legacy I/O port free.
Recent ISPs need only the single MMIO BAR to manipulate HW registers. Unfortunately, ISP21xx, ISP22xx, ISP23xx, and ISP63xx type cards still require the I/O mapped region to manipulate the FLASH via the two HW flash-registers (flash_address and flash_data). Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |1 + drivers/scsi/qla2xxx/qla_os.c | 50 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 1900fbf..04e8cbc 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2271,6 +2271,7 @@ typedef struct scsi_qla_host { spinlock_t hardware_lock cacheline_aligned; + int bars; device_reg_t __iomem *iobase; /* Base I/O address */ unsigned long pio_address; unsigned long pio_length; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 0351d38..a5bcf1f 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1482,6 +1482,17 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) unsigned long pio, pio_len, pio_flags; unsigned long mmio, mmio_len, mmio_flags; + if (pci_request_selected_regions(ha-pdev, ha-bars, + QLA2XXX_DRIVER_NAME)) { + qla_printk(KERN_WARNING, ha, + Failed to reserve PIO/MMIO regions (%s)\n, + pci_name(ha-pdev)); + + goto iospace_error_exit; + } + if (!(ha-bars 1)) + goto skip_pio; + /* We only need PIO for Flash operations on ISP2312 v2 chips. */ pio = pci_resource_start(ha-pdev, 0); pio_len = pci_resource_len(ha-pdev, 0); @@ -1499,7 +1510,10 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) pci_name(ha-pdev)); pio = 0; } + ha-pio_address = pio; + ha-pio_length = pio_len; +skip_pio: /* Use MMIO operations for all accesses. */ mmio = pci_resource_start(ha-pdev, 1); mmio_len = pci_resource_len(ha-pdev, 1); @@ -1518,16 +1532,6 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) goto iospace_error_exit; } - if (pci_request_regions(ha-pdev, QLA2XXX_DRIVER_NAME)) { - qla_printk(KERN_WARNING, ha, - Failed to reserve PIO/MMIO regions (%s)\n, - pci_name(ha-pdev)); - - goto iospace_error_exit; - } - - ha-pio_address = pio; - ha-pio_length = pio_len; ha-iobase = ioremap(mmio, MIN_IOBASE_LEN); if (!ha-iobase) { qla_printk(KERN_ERR, ha, @@ -1579,21 +1583,26 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) char pci_info[30]; char fw_str[30]; struct scsi_host_template *sht; + int bars; - if (pci_enable_device(pdev)) - goto probe_out; - - if (pci_find_aer_capability(pdev)) - if (pci_enable_pcie_error_reporting(pdev)) - goto probe_out; - + bars = pci_select_bars(pdev, IORESOURCE_MEM | IORESOURCE_IO); 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_ISP5422 || pdev-device == PCI_DEVICE_ID_QLOGIC_ISP5432 || - pdev-device == PCI_DEVICE_ID_QLOGIC_ISP2532) + pdev-device == PCI_DEVICE_ID_QLOGIC_ISP2532) { + bars = pci_select_bars(pdev, IORESOURCE_MEM); sht = qla24xx_driver_template; + } + + if (pci_enable_device_bars(pdev, bars)) + goto probe_out; + + if (pci_find_aer_capability(pdev)) + if (pci_enable_pcie_error_reporting(pdev)) + goto probe_out; + host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); if (host == NULL) { printk(KERN_WARNING @@ -1610,6 +1619,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha-host_no = host-host_no; sprintf(ha-host_str, %s_%ld, QLA2XXX_DRIVER_NAME, ha-host_no); ha-parent = NULL; + ha-bars = bars; /* Set ISP-type information. */ qla2x00_set_isp_flags(ha); @@ -1880,7 +1890,7 @@ qla2x00_free_device(scsi_qla_host_t *ha) /* release io space registers */ if (ha-iobase) iounmap(ha-iobase); - pci_release_regions(ha-pdev); + pci_release_selected_regions(ha-pdev, ha-bars); } static inline void @@ -2890,7 +2900,7 @@ qla2xxx_pci_slot_reset(struct pci_dev *pdev) pci_ers_result_t ret = PCI_ERS_RESULT_DISCONNECT; scsi_qla_host_t *ha = pci_get_drvdata(pdev); - if (pci_enable_device(pdev)) { + if (pci_enable_device_bars
Re: [patch 3/7] qla2xxx printk fixes
On Tue, 16 Oct 2007, [EMAIL PROTECTED] wrote: From: Andrew Morton [EMAIL PROTECTED] drivers/scsi/qla2xxx/qla_sup.c: In function 'qla24xx_write_flash_data': drivers/scsi/qla2xxx/qla_sup.c:655: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t' drivers/scsi/qla2xxx/qla_sup.c: In function 'qla25xx_read_optrom_data': drivers/scsi/qla2xxx/qla_sup.c:1853: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t' Cc: James Bottomley [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Acked-by: Andrew Vasquez [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] aic94xx: Use request_firmware() to provide SAS address if the adapter lacks one
On Tue, 09 Oct 2007, James Smart wrote: Why do you prefer request_firmware() vs something over sysfs ? Does environments like the kdump kernel also have access to data needed by request_firmware() ? There's already much in the way of automation and infrastructure present in supporting the request_firwmare() interfaces (perhaps not the best of names) which can provide for a level of flexibility beyond a basic 'soft_port_name' interface. Though I don't see why both can't coexist cleanly -- I take it the use case you are considering is: software recognizes no valid WWPN available, query via request_firmware() fails, software halts initialization (rather than fail), and awaits the admin to poke '0x123456.. /sys/.../fc_host/soft_port_name', causing a ping to the driver and continuation of initialization with requested portname? - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] aic94xx: Use request_firmware() to provide SAS address if the adapter lacks one
On Mon, 08 Oct 2007, Darrick J. Wong wrote: If the aic94xx chip doesn't have a SAS address in the chip's flash memory, use the request_firmware() interface to get one from userspace. This way, there's no debate as to who or how an address gets generated--it's totally up to the administrator to provide it if the card doesn't have one. So how about factoring that out to a transport-level interface. How about something along the lines of the following patch, whereby the software driver upon detecting no valid WWPN, makes an upcall to each interface's 'request_wwn()'. The data passed in from shost_gendev should be enough for some helper script to cull relevent device bits and perhaps offer some level of persistence... Off base? Darrick, forgive the FC example, I don't do SAS... -- av -- diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 7a7cfe5..5e0d953 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -35,6 +35,7 @@ #include linux/netlink.h #include net/netlink.h #include scsi/scsi_netlink_fc.h +#include linux/firmware.h #include scsi_priv.h #include scsi_transport_fc_internal.h @@ -3251,6 +3252,30 @@ fc_vport_sched_delete(struct work_struct *work) vport-channel, stat); } +int +fc_request_wwn(struct Scsi_Host *shost, u64 *wwn) +{ + const struct firmware *fw; + int stat; + + stat = request_firmware(fw, fc_addr, shost-shost_gendev); + if (stat) + return stat; + + if (fw-size 16) { + stat = -EINVAL; + goto out; + } + + stat = fc_parse_wwn(fw-data, wwn); + if (stat) + return stat; + +out: + release_firmware(fw); + return stat; +} +EXPORT_SYMBOL(fc_request_wwn); /* Original Author: Martin Hicks */ MODULE_AUTHOR(James Smart); diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index e466d88..e80c36c 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h @@ -734,4 +734,6 @@ void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, */ int fc_vport_terminate(struct fc_vport *vport); +int fc_request_wwn(struct Scsi_Host *, u64 *); + #endif /* SCSI_TRANSPORT_FC_H */ - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] aic94xx: Use request_firmware() to provide SAS address if the adapter lacks one
On Mon, 08 Oct 2007, Darrick J. Wong wrote: On Mon, Oct 08, 2007 at 03:48:32PM -0700, Andrew Vasquez wrote: So how about factoring that out to a transport-level interface. How about something along the lines of the following patch, whereby the software driver upon detecting no valid WWPN, makes an upcall to each interface's 'request_wwn()'. The data passed in from shost_gendev should be enough for some helper script to cull relevent device bits and perhaps offer some level of persistence... Off base? Hrm... jejb made a remark that it might be better to pass the scsi_host's device into request_firmware() as your example does, so I'll pitch in a patch to do likewise with libsas--the scsi_host knows the actual device it's coming from, and userland can sort that all out later anyway via DEVPATH. I suppose one could also have multiple scsi_hosts per PCI device, which means that my first patch would stumble horribly in more than a few cases. This is done already in the FC case -- NPIV. Though with that interface, the administrator is already responsible for assigning proper WWNN/WWPN during creation. Darrick, forgive the FC example, I don't do SAS... That's ok, I don't do FC. :) Looks mostly good to me... -- av - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/19] qla2xxx: Driver update [8.02.00-k4].
This patchset updates the qla2xxx driver to 8.02.00-k4 drivers/scsi/qla2xxx/qla_attr.c| 200 +++-- drivers/scsi/qla2xxx/qla_dbg.c | 1846 +++- drivers/scsi/qla2xxx/qla_dbg.h |2 + drivers/scsi/qla2xxx/qla_def.h | 15 +- drivers/scsi/qla2xxx/qla_fw.h |6 +- drivers/scsi/qla2xxx/qla_gbl.h |9 +- drivers/scsi/qla2xxx/qla_gs.c |6 +- drivers/scsi/qla2xxx/qla_init.c| 26 +- drivers/scsi/qla2xxx/qla_iocb.c|4 +- drivers/scsi/qla2xxx/qla_isr.c | 88 ++- drivers/scsi/qla2xxx/qla_mbx.c | 62 ++- drivers/scsi/qla2xxx/qla_mid.c | 40 +- drivers/scsi/qla2xxx/qla_os.c | 140 +++- drivers/scsi/qla2xxx/qla_sup.c | 221 -- drivers/scsi/qla2xxx/qla_version.h |2 +- 15 files changed, 1189 insertions(+), 1478 deletions(-) here's the commits: - Collapse and simplify ISP2XXX firmware dump routines. - Add flash burst-read/write support. - Limit iIDMA speed adjustments. - Allow region-based flash-part accesses. - Add PCI error recovery support. - Query additional RISC information during a pause. - Correct staging of RISC while attempting to pause. - Query additional RISC registers during ISP25XX firmware dump. - Correct infinite-login-retry issue. - Set correct attribute count during FDMI RPA. - Use the correct pointer-address during NVRAM writes. - Retrieve max-NPIV support capabilities from FW. - Remove unused member (list) from srb_t structure. - Use shost_priv(). - Cleanup several 'sparse' warnings. - Sparse cleanups in qla_mid.c - Clear options-flags while staging firmware-execution. - Rework MSI-X handlers. - Update version number to 8.02.00-k4. Regards, Andrew Vasquez QLogic Corporation - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 03/19] qla2xxx: Limit iIDMA speed adjustments.
Do not adjust the iIDMA speed on ports which have a faster link-speed than the HBA itself. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c | 10 ++ 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 083997c..45da947 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -2126,15 +2126,9 @@ qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) if (!IS_IIDMA_CAPABLE(ha)) return; - if (fcport-fp_speed == PORT_SPEED_UNKNOWN) { - DEBUG2(printk(scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- - unsupported FM port operating speed.\n, - ha-host_no, fcport-port_name[0], fcport-port_name[1], - fcport-port_name[2], fcport-port_name[3], - fcport-port_name[4], fcport-port_name[5], - fcport-port_name[6], fcport-port_name[7])); + if (fcport-fp_speed == PORT_SPEED_UNKNOWN || + fcport-fp_speed ha-link_data_rate) return; - } rval = qla2x00_set_idma_speed(ha, fcport-loop_id, fcport-fp_speed, mb); -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 18/19] qla2xxx: Rework MSI-X handlers.
Since MSI-X vectors do not require a clearing handshake from the system perspective, and the registered handler will not be called more than once for one occurrence of receipt of a vector, there is no requirement to flush the risc register write clearing the interrupt condition in the risc. Also, since the msi-x registered handlers are optimised for a particular vector, it is preferable to handle the one vector received per invocation of the handler. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index f61c2fe..c4768c4 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1679,7 +1679,6 @@ qla24xx_msix_rsp_q(int irq, void *dev_id) qla24xx_process_response_queue(ha); WRT_REG_DWORD(reg-hccr, HCCRX_CLR_RISC_INT); - RD_REG_DWORD_RELAXED(reg-hccr); spin_unlock_irqrestore(ha-hardware_lock, flags); @@ -1693,7 +1692,6 @@ qla24xx_msix_default(int irq, void *dev_id) struct device_reg_24xx __iomem *reg; int status; unsigned long flags; - unsigned long iter; uint32_tstat; uint32_thccr; uint16_tmb[4]; @@ -1703,7 +1701,7 @@ qla24xx_msix_default(int irq, void *dev_id) status = 0; spin_lock_irqsave(ha-hardware_lock, flags); - for (iter = 50; iter--; ) { + do { stat = RD_REG_DWORD(reg-host_status); if (stat HSRX_RISC_PAUSED) { if (pci_channel_offline(ha-pdev)) @@ -1748,8 +1746,7 @@ qla24xx_msix_default(int irq, void *dev_id) break; } WRT_REG_DWORD(reg-hccr, HCCRX_CLR_RISC_INT); - RD_REG_DWORD_RELAXED(reg-hccr); - } + } while (0); spin_unlock_irqrestore(ha-hardware_lock, flags); if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 02/19] qla2xxx: Add flash burst-read/write support.
Newer ISPs support a mechanism to read and write flash-memory via the firmware LOAD/DUMP memory mailbox command routines. When supported, utilizing these mechanisms significantly reduces overall access times. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_gbl.h |5 + drivers/scsi/qla2xxx/qla_mbx.c | 48 + drivers/scsi/qla2xxx/qla_os.c |2 +- drivers/scsi/qla2xxx/qla_sup.c | 221 ++-- 4 files changed, 220 insertions(+), 56 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index aa1e411..e8122e8 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -134,6 +134,9 @@ extern int qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); extern int +qla2x00_dump_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); + +extern int qla2x00_execute_fw(scsi_qla_host_t *, uint32_t); extern void @@ -302,6 +305,8 @@ extern uint8_t *qla24xx_read_optrom_data(struct scsi_qla_host *, uint8_t *, uint32_t, uint32_t); extern int qla24xx_write_optrom_data(struct scsi_qla_host *, uint8_t *, uint32_t, uint32_t); +extern uint8_t *qla25xx_read_optrom_data(struct scsi_qla_host *, uint8_t *, +uint32_t, uint32_t); extern int qla2x00_get_flash_version(scsi_qla_host_t *, void *); extern int qla24xx_get_flash_version(scsi_qla_host_t *, void *); diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index d3746ec..e4f4b1f 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -2980,3 +2980,51 @@ qla2x00_send_change_request(scsi_qla_host_t *ha, uint16_t format, return rval; } + +int +qla2x00_dump_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t addr, +uint32_t size) +{ + int rval; + mbx_cmd_t mc; + mbx_cmd_t *mcp = mc; + + DEBUG11(printk(%s(%ld): entered.\n, __func__, ha-host_no)); + + if (MSW(addr) || IS_FWI2_CAPABLE(ha)) { + mcp-mb[0] = MBC_DUMP_RISC_RAM_EXTENDED; + mcp-mb[8] = MSW(addr); + mcp-out_mb = MBX_8|MBX_0; + } else { + mcp-mb[0] = MBC_DUMP_RISC_RAM; + mcp-out_mb = MBX_0; + } + mcp-mb[1] = LSW(addr); + mcp-mb[2] = MSW(req_dma); + mcp-mb[3] = LSW(req_dma); + mcp-mb[6] = MSW(MSD(req_dma)); + mcp-mb[7] = LSW(MSD(req_dma)); + mcp-out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1; + if (IS_FWI2_CAPABLE(ha)) { + mcp-mb[4] = MSW(size); + mcp-mb[5] = LSW(size); + mcp-out_mb |= MBX_5|MBX_4; + } else { + mcp-mb[4] = LSW(size); + mcp-out_mb |= MBX_4; + } + + mcp-in_mb = MBX_0; + mcp-tov = 30; + mcp-flags = 0; + rval = qla2x00_mailbox_command(ha, mcp); + + if (rval != QLA_SUCCESS) { + DEBUG2_3_11(printk(%s(%ld): failed=%x mb[0]=%x.\n, __func__, + ha-host_no, rval, mcp-mb[0])); + } else { + DEBUG11(printk(%s(%ld): done.\n, __func__, ha-host_no)); + } + + return rval; +} diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index acca898..2a03400 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1384,7 +1384,7 @@ static struct isp_operations qla25xx_isp_ops = { .beacon_on = qla24xx_beacon_on, .beacon_off = qla24xx_beacon_off, .beacon_blink = qla24xx_beacon_blink, - .read_optrom= qla24xx_read_optrom_data, + .read_optrom= qla25xx_read_optrom_data, .write_optrom = qla24xx_write_optrom_data, .get_flash_version = qla24xx_get_flash_version, }; diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index a925a3f..ad3d1de 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -425,6 +425,9 @@ qla2x00_set_nvram_protection(scsi_qla_host_t *ha, int stat) /* Flash Manipulation Routines */ /*/ +#define OPTROM_BURST_SIZE 0x1000 +#define OPTROM_BURST_DWORDS(OPTROM_BURST_SIZE / 4) + static inline uint32_t flash_conf_to_access_addr(uint32_t faddr) { @@ -544,41 +547,59 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, uint32_t dwords) { int ret; - uint32_t liter; - uint32_t sec_mask, rest_addr, conf_addr, sec_end_mask; + uint32_t liter, miter; + uint32_t sec_mask, rest_addr, conf_addr; uint32_t fdata, findex ; uint8_t man_id, flash_id; struct device_reg_24xx __iomem *reg = ha-iobase-isp24; + dma_addr_t optrom_dma; + void *optrom = NULL; + uint32_t *s, *d; ret = QLA_SUCCESS; + /* Prepare
[PATCH 19/19] qla2xxx: Update version number to 8.02.00-k4.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 18095b9..2d551a3 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION 8.02.00-k3 +#define QLA2XXX_VERSION 8.02.00-k4 #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/19] qla2xxx: Allow region-based flash-part accesses.
From: Joe Carnuccio [EMAIL PROTECTED] Additional cleanups and Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c | 108 --- drivers/scsi/qla2xxx/qla_def.h |2 + drivers/scsi/qla2xxx/qla_fw.h |2 + drivers/scsi/qla2xxx/qla_sup.c |4 +- 4 files changed, 96 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 0f2a9f5..8e7e00c 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -175,10 +175,10 @@ qla2x00_sysfs_read_optrom(struct kobject *kobj, if (ha-optrom_state != QLA_SREADING) return 0; - if (off ha-optrom_size) + if (off ha-optrom_region_size) return 0; - if (off + count ha-optrom_size) - count = ha-optrom_size - off; + if (off + count ha-optrom_region_size) + count = ha-optrom_region_size - off; memcpy(buf, ha-optrom_buffer[off], count); @@ -195,10 +195,10 @@ qla2x00_sysfs_write_optrom(struct kobject *kobj, if (ha-optrom_state != QLA_SWRITING) return -EINVAL; - if (off ha-optrom_size) + if (off ha-optrom_region_size) return -ERANGE; - if (off + count ha-optrom_size) - count = ha-optrom_size - off; + if (off + count ha-optrom_region_size) + count = ha-optrom_region_size - off; memcpy(ha-optrom_buffer[off], buf, count); @@ -222,12 +222,16 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, { struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct device, kobj))); - int val; + uint32_t start = 0; + uint32_t size = ha-optrom_size; + int val, valid; if (off) return 0; - if (sscanf(buf, %d, val) != 1) + if (sscanf(buf, %d:%x:%x, val, start, size) 1) + return -EINVAL; + if (start ha-optrom_size) return -EINVAL; switch (val) { @@ -237,6 +241,11 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, break; ha-optrom_state = QLA_SWAITING; + + DEBUG2(qla_printk(KERN_INFO, ha, + Freeing flash region allocation -- 0x%x bytes.\n, + ha-optrom_region_size)); + vfree(ha-optrom_buffer); ha-optrom_buffer = NULL; break; @@ -244,44 +253,107 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, if (ha-optrom_state != QLA_SWAITING) break; + if (start 0xfff) { + qla_printk(KERN_WARNING, ha, + Invalid start region 0x%x/0x%x.\n, start, size); + return -EINVAL; + } + + ha-optrom_region_start = start; + ha-optrom_region_size = start + size ha-optrom_size ? + ha-optrom_size - start : size; + ha-optrom_state = QLA_SREADING; - ha-optrom_buffer = (uint8_t *)vmalloc(ha-optrom_size); + ha-optrom_buffer = vmalloc(ha-optrom_region_size); if (ha-optrom_buffer == NULL) { qla_printk(KERN_WARNING, ha, Unable to allocate memory for optrom retrieval - (%x).\n, ha-optrom_size); + (%x).\n, ha-optrom_region_size); ha-optrom_state = QLA_SWAITING; return count; } - memset(ha-optrom_buffer, 0, ha-optrom_size); - ha-isp_ops-read_optrom(ha, ha-optrom_buffer, 0, - ha-optrom_size); + DEBUG2(qla_printk(KERN_INFO, ha, + Reading flash region -- 0x%x/0x%x.\n, + ha-optrom_region_start, ha-optrom_region_size)); + + memset(ha-optrom_buffer, 0, ha-optrom_region_size); + ha-isp_ops-read_optrom(ha, ha-optrom_buffer, + ha-optrom_region_start, ha-optrom_region_size); break; case 2: if (ha-optrom_state != QLA_SWAITING) break; + /* +* We need to be more restrictive on which FLASH regions are +* allowed to be updated via user-space. Regions accessible +* via this method include: +* +* ISP21xx/ISP22xx/ISP23xx type boards: +* +* 0x00 - 0x02 -- Boot code. +* +* ISP2322/ISP24xx type boards: +* +* 0x00 - 0x07 -- Boot code. +* 0x08 - 0x0f -- Firmware. +* +* ISP25xx type boards
[PATCH 05/19] qla2xxx: Add PCI error recovery support.
From: Seokmann Ju [EMAIL PROTECTED] Additional cleanups and Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |1 + drivers/scsi/qla2xxx/qla_isr.c | 28 +- drivers/scsi/qla2xxx/qla_os.c | 114 3 files changed, 142 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index e1e3428..75ab898 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -23,6 +23,7 @@ #include linux/interrupt.h #include linux/workqueue.h #include linux/firmware.h +#include linux/aer.h #include asm/semaphore.h #include scsi/scsi.h diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index eecae99..dcfb24b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -34,6 +34,7 @@ qla2100_intr_handler(int irq, void *dev_id) int status; unsigned long flags; unsigned long iter; + uint16_thccr; uint16_tmb[4]; ha = (scsi_qla_host_t *) dev_id; @@ -48,7 +49,23 @@ qla2100_intr_handler(int irq, void *dev_id) spin_lock_irqsave(ha-hardware_lock, flags); for (iter = 50; iter--; ) { - if ((RD_REG_WORD(reg-istatus) ISR_RISC_INT) == 0) + hccr = RD_REG_WORD(reg-hccr); + if (hccr HCCR_RISC_PAUSE) { + if (pci_channel_offline(ha-pdev)) + break; + + /* +* Issue a HARD reset in order for the RISC interrupt +* bit to be cleared. Schedule a big hammmer to get +* out of the RISC PAUSED state. +*/ + WRT_REG_WORD(reg-hccr, HCCR_RESET_RISC); + RD_REG_WORD(reg-hccr); + + ha-isp_ops-fw_dump(ha, 1); + set_bit(ISP_ABORT_NEEDED, ha-dpc_flags); + break; + } else if ((RD_REG_WORD(reg-istatus) ISR_RISC_INT) == 0) break; if (RD_REG_WORD(reg-semaphore) BIT_0) { @@ -127,6 +144,9 @@ qla2300_intr_handler(int irq, void *dev_id) for (iter = 50; iter--; ) { stat = RD_REG_DWORD(reg-u.isp2300.host_status); if (stat HSR_RISC_PAUSED) { + if (pci_channel_offline(ha-pdev)) + break; + hccr = RD_REG_WORD(reg-hccr); if (hccr (BIT_15 | BIT_13 | BIT_11 | BIT_8)) qla_printk(KERN_INFO, ha, Parity error -- @@ -1499,6 +1519,9 @@ qla24xx_intr_handler(int irq, void *dev_id) for (iter = 50; iter--; ) { stat = RD_REG_DWORD(reg-host_status); if (stat HSRX_RISC_PAUSED) { + if (pci_channel_offline(ha-pdev)) + break; + hccr = RD_REG_DWORD(reg-hccr); qla_printk(KERN_INFO, ha, RISC paused -- HCCR=%x, @@ -1633,6 +1656,9 @@ qla24xx_msix_default(int irq, void *dev_id) for (iter = 50; iter--; ) { stat = RD_REG_DWORD(reg-host_status); if (stat HSRX_RISC_PAUSED) { + if (pci_channel_offline(ha-pdev)) + break; + hccr = RD_REG_DWORD(reg-hccr); qla_printk(KERN_INFO, ha, RISC paused -- HCCR=%x, diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 2a03400..a8ab2d3 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -385,6 +385,11 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) srb_t *sp; int rval; + if (unlikely(pci_channel_offline(ha-pdev))) { + cmd-result = DID_REQUEUE 16; + goto qc_fail_command; + } + rval = fc_remote_port_chkready(rport); if (rval) { cmd-result = rval; @@ -447,6 +452,11 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) int rval; scsi_qla_host_t *pha = to_qla_parent(ha); + if (unlikely(pci_channel_offline(ha-pdev))) { + cmd-result = DID_REQUEUE 16; + goto qc24_fail_command; + } + rval = fc_remote_port_chkready(rport); if (rval) { cmd-result = rval; @@ -1571,6 +1581,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) if (pci_enable_device(pdev)) goto probe_out; + if (pci_find_aer_capability(pdev)) + if (pci_enable_pcie_error_reporting(pdev)) + goto probe_out; + sht = qla2x00_driver_template; if (pdev-device
[PATCH 06/19] qla2xxx: Query additional RISC information during a pause.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_fw.h |4 ++- drivers/scsi/qla2xxx/qla_isr.c | 53 2 files changed, 56 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index d5344d7..db63386 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -942,7 +942,9 @@ struct device_reg_24xx { uint16_t mailbox31; uint32_t iobase_window; - uint32_t unused_4[8]; /* Gap. */ + uint32_t unused_4; /* Gap. */ + uint32_t iobase_c8; + uint32_t unused_4_1[6]; /* Gap. */ uint32_t iobase_q; uint32_t unused_5[2]; /* Gap. */ uint32_t iobase_select; diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index dcfb24b..f61c2fe 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -6,6 +6,7 @@ */ #include qla_def.h +#include linux/delay.h #include scsi/scsi_tcq.h static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t); @@ -1484,6 +1485,52 @@ qla24xx_process_response_queue(struct scsi_qla_host *ha) WRT_REG_DWORD(reg-rsp_q_out, ha-rsp_ring_index); } +static void +qla2xxx_check_risc_status(scsi_qla_host_t *ha) +{ + int rval; + uint32_t cnt; + struct device_reg_24xx __iomem *reg = ha-iobase-isp24; + + if (!IS_QLA25XX(ha)) + return; + + rval = QLA_SUCCESS; + WRT_REG_DWORD(reg-iobase_addr, 0x7C00); + RD_REG_DWORD(reg-iobase_addr); + WRT_REG_DWORD(reg-iobase_window, 0x0001); + for (cnt = 1; (RD_REG_DWORD(reg-iobase_window) BIT_0) == 0 + rval == QLA_SUCCESS; cnt--) { + if (cnt) { + WRT_REG_DWORD(reg-iobase_window, 0x0001); + udelay(10); + } else + rval = QLA_FUNCTION_TIMEOUT; + } + if (rval == QLA_SUCCESS) + goto next_test; + + WRT_REG_DWORD(reg-iobase_window, 0x0003); + for (cnt = 100; (RD_REG_DWORD(reg-iobase_window) BIT_0) == 0 + rval == QLA_SUCCESS; cnt--) { + if (cnt) { + WRT_REG_DWORD(reg-iobase_window, 0x0003); + udelay(10); + } else + rval = QLA_FUNCTION_TIMEOUT; + } + if (rval != QLA_SUCCESS) + goto done; + +next_test: + if (RD_REG_DWORD(reg-iobase_c8) BIT_3) + qla_printk(KERN_INFO, ha, Additional code -- 0x55AA.\n); + +done: + WRT_REG_DWORD(reg-iobase_window, 0x); + RD_REG_DWORD(reg-iobase_window); +} + /** * qla24xx_intr_handler() - Process interrupts for the ISP23xx and ISP63xx. * @irq: @@ -1526,6 +1573,9 @@ qla24xx_intr_handler(int irq, void *dev_id) qla_printk(KERN_INFO, ha, RISC paused -- HCCR=%x, Dumping firmware!\n, hccr); + + qla2xxx_check_risc_status(ha); + ha-isp_ops-fw_dump(ha, 1); set_bit(ISP_ABORT_NEEDED, ha-dpc_flags); break; @@ -1663,6 +1713,9 @@ qla24xx_msix_default(int irq, void *dev_id) qla_printk(KERN_INFO, ha, RISC paused -- HCCR=%x, Dumping firmware!\n, hccr); + + qla2xxx_check_risc_status(ha); + ha-isp_ops-fw_dump(ha, 1); set_bit(ISP_ABORT_NEEDED, ha-dpc_flags); break; -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 07/19] qla2xxx: Correct staging of RISC while attempting to pause.
There's no need to reset the RISC prior to pausing. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_dbg.c | 23 ++- 1 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index b52fa89..2defe0c 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -172,19 +172,16 @@ qla24xx_pause_risc(struct device_reg_24xx __iomem *reg) int rval = QLA_SUCCESS; uint32_t cnt; - if ((RD_REG_DWORD(reg-hccr) HCCRX_RISC_PAUSE) == 0) { - WRT_REG_DWORD(reg-hccr, HCCRX_SET_RISC_RESET | - HCCRX_CLR_HOST_INT); - RD_REG_DWORD(reg-hccr); /* PCI Posting. */ - WRT_REG_DWORD(reg-hccr, HCCRX_SET_RISC_PAUSE); - for (cnt = 3; - (RD_REG_DWORD(reg-hccr) HCCRX_RISC_PAUSE) == 0 - rval == QLA_SUCCESS; cnt--) { - if (cnt) - udelay(100); - else - rval = QLA_FUNCTION_TIMEOUT; - } + if (RD_REG_DWORD(reg-hccr) HCCRX_RISC_PAUSE) + return rval; + + WRT_REG_DWORD(reg-hccr, HCCRX_SET_RISC_PAUSE); + for (cnt = 3; (RD_REG_DWORD(reg-hccr) HCCRX_RISC_PAUSE) == 0 + rval == QLA_SUCCESS; cnt--) { + if (cnt) + udelay(100); + else + rval = QLA_FUNCTION_TIMEOUT; } return rval; -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 08/19] qla2xxx: Query additional RISC registers during ISP25XX firmware dump.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_dbg.c | 18 ++ drivers/scsi/qla2xxx/qla_dbg.h |2 ++ drivers/scsi/qla2xxx/qla_fw.h |2 +- 3 files changed, 21 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 2defe0c..ca7f70d 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1072,6 +1072,7 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) } fw = ha-fw_dump-isp.isp25; qla2xxx_prep_dump(ha, ha-fw_dump); + ha-fw_dump-version = __constant_htonl(2); fw-host_status = htonl(RD_REG_DWORD(reg-host_status)); @@ -1080,6 +1081,23 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (rval != QLA_SUCCESS) goto qla25xx_fw_dump_failed_0; + /* Host/Risc registers. */ + iter_reg = fw-host_risc_reg; + iter_reg = qla24xx_read_window(reg, 0x7000, 16, iter_reg); + qla24xx_read_window(reg, 0x7010, 16, iter_reg); + + /* PCIe registers. */ + WRT_REG_DWORD(reg-iobase_addr, 0x7C00); + RD_REG_DWORD(reg-iobase_addr); + WRT_REG_DWORD(reg-iobase_window, 0x01); + dmp_reg = reg-iobase_c4; + fw-pcie_regs[0] = htonl(RD_REG_DWORD(dmp_reg++)); + fw-pcie_regs[1] = htonl(RD_REG_DWORD(dmp_reg++)); + fw-pcie_regs[2] = htonl(RD_REG_DWORD(dmp_reg)); + fw-pcie_regs[3] = htonl(RD_REG_DWORD(reg-iobase_window)); + WRT_REG_DWORD(reg-iobase_window, 0x00); + RD_REG_DWORD(reg-iobase_window); + /* Host interface registers. */ dmp_reg = reg-flash_addr; for (cnt = 0; cnt sizeof(fw-host_reg) / 4; cnt++) diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h index cca4b0d..a50ecf0 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.h +++ b/drivers/scsi/qla2xxx/qla_dbg.h @@ -215,6 +215,8 @@ struct qla24xx_fw_dump { struct qla25xx_fw_dump { uint32_t host_status; + uint32_t host_risc_reg[32]; + uint32_t pcie_regs[4]; uint32_t host_reg[32]; uint32_t shadow_reg[11]; uint32_t risc_io_reg; diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index db63386..25364b1 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -942,7 +942,7 @@ struct device_reg_24xx { uint16_t mailbox31; uint32_t iobase_window; - uint32_t unused_4; /* Gap. */ + uint32_t iobase_c4; uint32_t iobase_c8; uint32_t unused_4_1[6]; /* Gap. */ uint32_t iobase_q; -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 09/19] qla2xxx: Correct infinite-login-retry issue.
From: Ravi Anand [EMAIL PROTECTED] Where the DPC logic would get jammed into continuously reloging-into a port. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_os.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index a8ab2d3..4314f94 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2437,7 +2437,6 @@ qla2x00_do_dpc(void *data) if (atomic_read(fcport-state) != FCS_ONLINE fcport-login_retry) { - fcport-login_retry--; if (fcport-flags FCF_FABRIC_DEVICE) { if (fcport-flags FCF_TAPE_PRESENT) @@ -2453,6 +2452,7 @@ qla2x00_do_dpc(void *data) qla2x00_local_device_login( ha, fcport); + fcport-login_retry--; if (status == QLA_SUCCESS) { fcport-old_loop_id = fcport-loop_id; @@ -2470,6 +2470,8 @@ qla2x00_do_dpc(void *data) } else { fcport-login_retry = 0; } + if (fcport-login_retry == 0) + fcport-loop_id = FC_NO_LOOP_ID; } if (test_bit(LOOP_RESYNC_NEEDED, ha-dpc_flags)) break; -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 10/19] qla2xxx: Set correct attribute count during FDMI RPA.
Also remove legacy '/proc' name during OS_DEVICE_NAME registration. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |2 +- drivers/scsi/qla2xxx/qla_gs.c |6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 75ab898..511e3cd 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1705,7 +1705,7 @@ struct ct_fdmi_hba_attributes { /* * Port attribute types. */ -#define FDMI_PORT_ATTR_COUNT 5 +#define FDMI_PORT_ATTR_COUNT 6 #define FDMI_PORT_FC4_TYPES1 #define FDMI_PORT_SUPPORT_SPEED2 #define FDMI_PORT_CURRENT_SPEED3 diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index a7e2358..eb0784c 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -1517,7 +1517,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha) /* Attributes */ ct_req-req.rpa.attrs.count = - __constant_cpu_to_be32(FDMI_PORT_ATTR_COUNT); + __constant_cpu_to_be32(FDMI_PORT_ATTR_COUNT - 1); entries = ct_req-req.rpa.port_name; /* FC4 types. */ @@ -1600,7 +1600,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha) /* OS device name. */ eiter = (struct ct_fdmi_port_attr *) (entries + size); eiter-type = __constant_cpu_to_be16(FDMI_PORT_OS_DEVICE_NAME); - sprintf(eiter-a.os_dev_name, /proc/scsi/qla2xxx/%ld, ha-host_no); + strcpy(eiter-a.os_dev_name, QLA2XXX_DRIVER_NAME); alen = strlen(eiter-a.os_dev_name); alen += (alen 3) ? (4 - (alen 3)) : 4; eiter-len = cpu_to_be16(4 + alen); @@ -1611,6 +1611,8 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha) /* Hostname. */ if (strlen(fc_host_system_hostname(ha-host))) { + ct_req-req.rpa.attrs.count = + __constant_cpu_to_be32(FDMI_PORT_ATTR_COUNT); eiter = (struct ct_fdmi_port_attr *) (entries + size); eiter-type = __constant_cpu_to_be16(FDMI_PORT_HOST_NAME); snprintf(eiter-a.host_name, sizeof(eiter-a.host_name), -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/19] qla2xxx: Use the correct pointer-address during NVRAM writes.
Original code, incorrectly passed the address-of a pointer rather than the pointer value itself. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 8e7e00c..445d583 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -146,7 +146,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, /* Write NVRAM. */ spin_lock_irqsave(ha-hardware_lock, flags); ha-isp_ops-write_nvram(ha, (uint8_t *)buf, ha-nvram_base, count); - ha-isp_ops-read_nvram(ha, (uint8_t *)ha-nvram, ha-nvram_base, + ha-isp_ops-read_nvram(ha, (uint8_t *)ha-nvram, ha-nvram_base, count); spin_unlock_irqrestore(ha-hardware_lock, flags); -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 16/19] qla2xxx: Sparse cleanups in qla_mid.c
Make several needlessly global functions static: - qla2x00_mark_vp_devices_dead() - qla24xx_configure_vp() Remove unused function qla24xx_modify_vport(). Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_mid.c | 34 ++ 1 files changed, 2 insertions(+), 32 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 1a2cdcd..821ee74 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -104,7 +104,7 @@ qla24xx_find_vhost_by_name(scsi_qla_host_t *ha, uint8_t *port_name) * * Context: */ -void +static void qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha) { fc_port_t *fcport; @@ -179,37 +179,7 @@ enable_failed: return 1; } -/** - * qla24xx_modify_vport() - Modifies the virtual fabric port's configuration - * @ha: HA context - * @vp: pointer to buffer of virtual port parameters. - * @ret_code: return error code: - * - * Returns the virtual port id, or MAX_VSAN_ID, if couldn't create. - */ -uint32_t -qla24xx_modify_vhba(scsi_qla_host_t *ha, vport_params_t *vp, uint32_t *vp_id) -{ - scsi_qla_host_t *vha; - - vha = qla24xx_find_vhost_by_name(ha, vp-port_name); - if (!vha) { - *vp_id = MAX_NUM_VPORT_LOOP; - return VP_RET_CODE_WWPN; - } - - if (qla24xx_enable_vp(vha)) { - scsi_host_put(vha-host); - qla2x00_mem_free(vha); - *vp_id = MAX_NUM_VPORT_LOOP; - return VP_RET_CODE_RESOURCES; - } - - *vp_id = vha-vp_idx; - return VP_RET_CODE_OK; -} - -void +static void qla24xx_configure_vp(scsi_qla_host_t *vha) { struct fc_vport *fc_vport; -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 15/19] qla2xxx: Cleanup several 'sparse' warnings.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_iocb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 3a5e78c..7f6a89b 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -308,7 +308,7 @@ qla2x00_start_scsi(srb_t *sp) handle++; if (handle == MAX_OUTSTANDING_COMMANDS) handle = 1; - if (ha-outstanding_cmds[handle] == 0) + if (!ha-outstanding_cmds[handle]) break; } if (index == MAX_OUTSTANDING_COMMANDS) @@ -711,7 +711,7 @@ qla24xx_start_scsi(srb_t *sp) handle++; if (handle == MAX_OUTSTANDING_COMMANDS) handle = 1; - if (ha-outstanding_cmds[handle] == 0) + if (!ha-outstanding_cmds[handle]) break; } if (index == MAX_OUTSTANDING_COMMANDS) -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 13/19] qla2xxx: Remove unused member (list) from srb_t structure.
This change reduces by as much as 16% the memory footprint for each allocated sbr_t structure requested from the mempool. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 1396f4d..b928e31 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -185,8 +185,6 @@ * SCSI Request Block */ typedef struct srb { - struct list_head list; - struct scsi_qla_host *ha; /* HA the SP is queued on */ struct fc_port *fcport; -- 1.5.3.2.80.g077d6f - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 12/19] qla2xxx: Retrieve max-NPIV support capabilities from FW.
From: Seokmann Ju [EMAIL PROTECTED] Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |2 +- drivers/scsi/qla2xxx/qla_def.h |2 +- drivers/scsi/qla2xxx/qla_gbl.h |4 ++-- drivers/scsi/qla2xxx/qla_init.c | 16 +++- drivers/scsi/qla2xxx/qla_mbx.c | 11 +++ 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 445d583..c90dc59 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1250,6 +1250,6 @@ qla2x00_init_host_attr(scsi_qla_host_t *ha) 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) = MAX_NUM_VPORT_FABRIC; + fc_host_max_npiv_vports(ha-host) = ha-max_npiv_vports;; fc_host_npiv_vports_inuse(ha-host) = ha-cur_vport_count; } diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 511e3cd..1396f4d 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2534,7 +2534,7 @@ typedef struct scsi_qla_host { #define VP_ERR_FAB_NORESOURCES 3 #define VP_ERR_FAB_LOGOUT 4 #define VP_ERR_ADAP_NORESOURCES5 - int max_npiv_vports;/* 63 or 125 per topoloty */ + uint16_tmax_npiv_vports;/* 63 or 125 per topoloty */ int cur_vport_count; } scsi_qla_host_t; diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index e8122e8..09cb2a9 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -215,8 +215,8 @@ extern int qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *); extern int -qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, -uint16_t *); +qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, +uint16_t *, uint16_t *, uint16_t *); extern int qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 45da947..191dafd 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -849,7 +849,8 @@ qla2x00_resize_request_q(scsi_qla_host_t *ha) return; /* Retrieve IOCB counts available to the firmware. */ - rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, fw_iocb_cnt); + rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, fw_iocb_cnt, + ha-max_npiv_vports); if (rval) return; /* No point in continuing if current settings are sufficient. */ @@ -916,9 +917,15 @@ qla2x00_setup_chip(scsi_qla_host_t *ha) ha-fw_attributes, ha-fw_memory_size); qla2x00_resize_request_q(ha); ha-flags.npiv_supported = 0; - if (IS_QLA24XX(ha) - (ha-fw_attributes BIT_2)) + if ((IS_QLA24XX(ha) || IS_QLA25XX(ha)) + (ha-fw_attributes BIT_2)) { ha-flags.npiv_supported = 1; + if ((!ha-max_npiv_vports) || + ((ha-max_npiv_vports + 1) % + MAX_MULTI_ID_FABRIC)) + ha-max_npiv_vports = + MAX_NUM_VPORT_FABRIC; + } if (ql2xallocfwdump) qla2x00_alloc_fw_dump(ha); @@ -1155,8 +1162,7 @@ qla2x00_init_rings(scsi_qla_host_t *ha) DEBUG(printk(scsi(%ld): Issue init firmware.\n, ha-host_no)); - mid_init_cb-count = MAX_NUM_VPORT_FABRIC; - ha-max_npiv_vports = MAX_NUM_VPORT_FABRIC; + mid_init_cb-count = ha-max_npiv_vports; rval = qla2x00_init_firmware(ha, ha-init_cb_size); if (rval) { diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index e4f4b1f..ec48871 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -1919,7 +1919,8 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma, */ int qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, -uint16_t *orig_xchg_cnt, uint16_t *cur_iocb_cnt, uint16_t *orig_iocb_cnt) +uint16_t *orig_xchg_cnt, uint16_t *cur_iocb_cnt, +uint16_t *orig_iocb_cnt, uint16_t *max_npiv_vports) { int rval; mbx_cmd_t mc; @@ -1929,7 +1930,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, mcp-mb[0
[PATCH 14/19] qla2xxx: Use shost_priv().
Drop usage of legacy to_qla_host() macro. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c | 88 +++--- drivers/scsi/qla2xxx/qla_dbg.c |2 +- drivers/scsi/qla2xxx/qla_def.h |2 - drivers/scsi/qla2xxx/qla_mid.c |6 +- drivers/scsi/qla2xxx/qla_os.c | 20 5 files changed, 58 insertions(+), 60 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index c90dc59..05fa779 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -18,7 +18,7 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); char *rbuf = (char *)ha-fw_dump; @@ -39,7 +39,7 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); int reading; @@ -89,7 +89,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); int size = ha-nvram_size; char*nvram_cache = ha-nvram; @@ -112,7 +112,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); unsigned long flags; uint16_tcnt; @@ -170,7 +170,7 @@ qla2x00_sysfs_read_optrom(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); if (ha-optrom_state != QLA_SREADING) @@ -190,7 +190,7 @@ qla2x00_sysfs_write_optrom(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); if (ha-optrom_state != QLA_SWRITING) @@ -220,7 +220,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); uint32_t start = 0; uint32_t size = ha-optrom_size; @@ -372,7 +372,7 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); int size = ha-vpd_size; char *vpd_cache = ha-vpd; @@ -395,7 +395,7 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); unsigned long flags; @@ -426,7 +426,7 @@ qla2x00_sysfs_read_sfp(struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { - struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, + struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, struct device, kobj))); uint16_t iter, addr, offset; int rval; @@ -531,7
Re: [PATCH 4/5] qla2xxx: add target mode support
On Sat, 01 Sep 2007, FUJITA Tomonori wrote: This adds target mode support to qla2xxx. With set ql2enable_target_mode module parameter to 1, the driver runs in target mode. By default, ql2enable_target_mode is set to 0, and the driver should work in initiator mode as before. The driver could support dual-mode in the future but it doesn't at the moment (we need to add dual-mode support tgt first). It is based on scst qla2xxx target mode driver. Mike converted the driver to use tgt long ago. I changed it to use the latest (mainline) version of qla2xxx driver and tgt, and also converted it to use fc transport class. Thanks for doing this. Some initial comments before a full review is complete, As was seen from the initiator updates needed for 24xx support, there are comparable changes needed in the area of target-mode support for 4gb and 8gb parts. Also, which ISPs and firmwares were exercised with this code? -- av - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[CORRECTED PATCH 4/6] qla2xxx: Correct 8GB iIDMA support.
Original implementation manipulated the FC_GS values for port-speed. Transition the codes to use the driver's own internal representations as this makes for a reduction in duplicate 'conversion' codes throughout the driver. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- James, Sorry, original patch was incomplete. Please use the corrected one. Thanks, Andrew Vasquez drivers/scsi/qla2xxx/qla_def.h |1 - drivers/scsi/qla2xxx/qla_gs.c | 28 --- drivers/scsi/qla2xxx/qla_init.c | 45 +- 3 files changed, 30 insertions(+), 44 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 27ae3a5..c196486 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1502,7 +1502,6 @@ typedef struct { uint8_t node_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE]; uint8_t fabric_port_name[WWN_SIZE]; - uint16_t fp_speeds; uint16_t fp_speed; } sw_info_t; diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index b06cbb8..a7e2358 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -295,6 +295,8 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list) list[i].d_id.b.domain = gid_data-port_id[0]; list[i].d_id.b.area = gid_data-port_id[1]; list[i].d_id.b.al_pa = gid_data-port_id[2]; + memset(list[i].fabric_port_name, 0, WWN_SIZE); + list[i].fp_speed = PORT_SPEED_UNKNOWN; /* Last one exit. */ if (gid_data-control_byte BIT_7) { @@ -1707,8 +1709,6 @@ qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list) for (i = 0; i MAX_FIBRE_DEVICES; i++) { /* Issue GFPN_ID */ - memset(list[i].fabric_port_name, 0, WWN_SIZE); - /* Prepare common MS IOCB */ ms_pkt = ha-isp_ops-prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, GFPN_ID_RSP_SIZE); @@ -1821,8 +1821,6 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) for (i = 0; i MAX_FIBRE_DEVICES; i++) { /* Issue GFPN_ID */ - list[i].fp_speeds = list[i].fp_speed = 0; - /* Prepare common MS IOCB */ ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE, GPSC_RSP_SIZE); @@ -1858,9 +1856,21 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) } rval = QLA_FUNCTION_FAILED; } else { - /* Save portname */ - list[i].fp_speeds = ct_rsp-rsp.gpsc.speeds; - list[i].fp_speed = ct_rsp-rsp.gpsc.speed; + /* Save port-speed */ + switch (be16_to_cpu(ct_rsp-rsp.gpsc.speed)) { + case BIT_15: + list[i].fp_speed = PORT_SPEED_1GB; + break; + case BIT_14: + list[i].fp_speed = PORT_SPEED_2GB; + break; + case BIT_13: + list[i].fp_speed = PORT_SPEED_4GB; + break; + case BIT_11: + list[i].fp_speed = PORT_SPEED_8GB; + break; + } DEBUG2_3(printk(scsi(%ld): GPSC ext entry - fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x @@ -1873,8 +1883,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) list[i].fabric_port_name[5], list[i].fabric_port_name[6], list[i].fabric_port_name[7], - be16_to_cpu(list[i].fp_speeds), - be16_to_cpu(list[i].fp_speed))); + be16_to_cpu(ct_rsp-rsp.gpsc.speeds), + be16_to_cpu(ct_rsp-rsp.gpsc.speed))); } /* Last device exit. */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 8da0586..1a058ec 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -2079,17 +2079,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha) } /* Base iIDMA settings on HBA port speed. */ - switch (ha-link_data_rate) { - case PORT_SPEED_1GB: - fcport-fp_speed = cpu_to_be16(BIT_15); - break; - case PORT_SPEED_2GB: - fcport-fp_speed = cpu_to_be16(BIT_14); - break; - case PORT_SPEED_4GB: - fcport
[PATCH 0/6] qla2xxx: fixes for 2.6.23 [8.02.00-k3].
This patchset contains fixes for 2.6.23. drivers/scsi/qla2xxx/qla_dbg.c | 21 ++ drivers/scsi/qla2xxx/qla_def.h |1 - drivers/scsi/qla2xxx/qla_gs.c | 24 drivers/scsi/qla2xxx/qla_init.c| 51 ++- drivers/scsi/qla2xxx/qla_isr.c |1 + drivers/scsi/qla2xxx/qla_os.c |2 +- drivers/scsi/qla2xxx/qla_version.h |2 +- 7 files changed, 45 insertions(+), 57 deletions(-) here's the commits: - Allocate enough space for the full PCI descriptor. - Don't modify parity bits during ISP25XX restart. - Correct management-server login-state synchronization issue. - Correct 8GB iIDMA support. - Correct mailbox register dump for FWI2 capable ISPs. - Update version number to 8.02.00-k3. Regards, Andrew Vasquez QLogic Corporation - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/6] qla2xxx: Allocate enough space for the full PCI descriptor.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_os.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 93c0c7e..acca898 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1564,7 +1564,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) struct Scsi_Host *host; scsi_qla_host_t *ha; unsigned long flags = 0; - char pci_info[20]; + char pci_info[30]; char fw_str[30]; struct scsi_host_template *sht; -- 1.5.3.rc4.41.g7efe - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/6] qla2xxx: Don't modify parity bits during ISP25XX restart.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 374abe1..8da0586 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3354,7 +3354,8 @@ qla2x00_restart_isp(scsi_qla_host_t *ha) spin_lock_irqsave(ha-hardware_lock, flags); - if (!IS_QLA24XX(ha) !IS_QLA54XX(ha)) { + if (!IS_QLA24XX(ha) !IS_QLA54XX(ha) + !IS_QLA25XX(ha)) { /* * Disable SRAM, Instruction RAM and GP RAM * parity. @@ -3370,7 +3371,8 @@ qla2x00_restart_isp(scsi_qla_host_t *ha) spin_lock_irqsave(ha-hardware_lock, flags); - if (!IS_QLA24XX(ha) !IS_QLA54XX(ha)) { + if (!IS_QLA24XX(ha) !IS_QLA54XX(ha) + !IS_QLA25XX(ha)) { /* Enable proper parity */ if (IS_QLA2300(ha)) /* SRAM parity */ -- 1.5.3.rc4.41.g7efe - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/6] qla2xxx: Correct management-server login-state synchronization issue.
Transitioning link-state via NOS/OLS requires a relogin to a fabric's Management Server. Request relogin when the firmware issues a point-to-point asynchronous event (0x8030). Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 50539da..eecae99 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -490,6 +490,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) set_bit(REGISTER_FC4_NEEDED, ha-dpc_flags); ha-flags.gpsc_supported = 1; + ha-flags.management_server_logged_in = 0; break; case MBA_CHG_IN_CONNECTION: /* Change in connection mode */ -- 1.5.3.rc4.41.g7efe - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/6] qla2xxx: Correct mailbox register dump for FWI2 capable ISPs.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_dbg.c | 21 + 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 563d18f..c668034 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -2050,21 +2050,18 @@ qla25xx_fw_dump_failed: void qla2x00_dump_regs(scsi_qla_host_t *ha) { + int i; struct device_reg_2xxx __iomem *reg = ha-iobase-isp; + struct device_reg_24xx __iomem *reg24 = ha-iobase-isp24; + uint16_t __iomem *mbx_reg; + + mbx_reg = IS_FWI2_CAPABLE(ha) ? reg24-mailbox0: + MAILBOX_REG(ha, reg, 0); printk(Mailbox registers:\n); - printk(scsi(%ld): mbox 0 0x%04x \n, - ha-host_no, RD_MAILBOX_REG(ha, reg, 0)); - printk(scsi(%ld): mbox 1 0x%04x \n, - ha-host_no, RD_MAILBOX_REG(ha, reg, 1)); - printk(scsi(%ld): mbox 2 0x%04x \n, - ha-host_no, RD_MAILBOX_REG(ha, reg, 2)); - printk(scsi(%ld): mbox 3 0x%04x \n, - ha-host_no, RD_MAILBOX_REG(ha, reg, 3)); - printk(scsi(%ld): mbox 4 0x%04x \n, - ha-host_no, RD_MAILBOX_REG(ha, reg, 4)); - printk(scsi(%ld): mbox 5 0x%04x \n, - ha-host_no, RD_MAILBOX_REG(ha, reg, 5)); + for (i = 0; i 6; i++) + printk(scsi(%ld): mbox %d 0x%04x \n, ha-host_no, i, + RD_REG_WORD(mbx_reg++)); } -- 1.5.3.rc4.41.g7efe - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/6] qla2xxx: Update version number to 8.02.00-k3.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index dd1f8ce..18095b9 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION 8.02.00-k2 +#define QLA2XXX_VERSION 8.02.00-k3 #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 -- 1.5.3.rc4.41.g7efe - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 64] drivers/scsi/qla2xxx/qla_init.c: mostly kmalloc + memset conversion to k[cz]alloc
On Tue, 31 Jul 2007, Mariusz Kozlowski wrote: Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED] drivers/scsi/qla2xxx/qla_init.c | 107445 - 107327 (-118 bytes) drivers/scsi/qla2xxx/qla_init.o | 237540 - 237424 (-116 bytes) drivers/scsi/qla2xxx/qla_init.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) Acked-by: Andrew Vasquez [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/9] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
On Sun, 22 Jul 2007, Boaz Harrosh wrote: From: Boaz Harrosh [EMAIL PROTECTED] Date: Sun, 22 Jul 2007 17:24:18 +0300 Subject: [PATCH] qla2xxx: Data accessors Cleanup of last merge - Left overs from last code merges of qla2xxx Sign-off-by: Boaz Harrosh [EMAIL PROTECTED] Thanks for catching that. If need be: Acked-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index b8f226a..50539da 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1068,7 +1068,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) * values. */ if (resid - ((unsigned)(cp-request_bufflen - resid) + ((unsigned)(scsi_bufflen(cp) - resid) cp-underflow)) { DEBUG2(qla_printk(KERN_INFO, ha, scsi(%ld:%d:%d:%d): Mid-layer underflow @@ -1076,7 +1076,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) error status.\n, ha-host_no, cp-device-channel, cp-device-id, cp-device-lun, resid, - cp-request_bufflen)); + scsi_bufflen(cp))); cp-result = DID_ERROR 16 | lscsi_status; } -- 1.5.2.2.249.g45fd - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/9] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |8 drivers/scsi/qla2xxx/qla_gs.c | 29 - 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index d505c04..f98eb63 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1711,6 +1711,14 @@ struct ct_fdmi_hba_attributes { #define FDMI_PORT_OS_DEVICE_NAME 5 #define FDMI_PORT_HOST_NAME6 +#define FDMI_PORT_SPEED_1GB0x1 +#define FDMI_PORT_SPEED_2GB0x2 +#define FDMI_PORT_SPEED_10GB 0x4 +#define FDMI_PORT_SPEED_4GB0x8 +#define FDMI_PORT_SPEED_8GB0x10 +#define FDMI_PORT_SPEED_16GB 0x20 +#define FDMI_PORT_SPEED_UNKNOWN0x8000 + struct ct_fdmi_port_attr { uint16_t type; uint16_t len; diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 9be3123..301279a 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -1528,11 +1528,15 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha) eiter-type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED); eiter-len = __constant_cpu_to_be16(4 + 4); if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) - eiter-a.sup_speed = __constant_cpu_to_be32(4); + eiter-a.sup_speed = __constant_cpu_to_be32( + FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB| + FDMI_PORT_SPEED_4GB); else if (IS_QLA23XX(ha)) - eiter-a.sup_speed = __constant_cpu_to_be32(2); + eiter-a.sup_speed =__constant_cpu_to_be32( + FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB); else - eiter-a.sup_speed = __constant_cpu_to_be32(1); + eiter-a.sup_speed = __constant_cpu_to_be32( + FDMI_PORT_SPEED_1GB); size += 4 + 4; DEBUG13(printk(%s(%ld): SUPPORTED_SPEED=%x.\n, __func__, ha-host_no, @@ -1543,14 +1547,21 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha) eiter-type = __constant_cpu_to_be16(FDMI_PORT_CURRENT_SPEED); eiter-len = __constant_cpu_to_be16(4 + 4); switch (ha-link_data_rate) { - case 0: - eiter-a.cur_speed = __constant_cpu_to_be32(1); + case PORT_SPEED_1GB: + eiter-a.cur_speed = + __constant_cpu_to_be32(FDMI_PORT_SPEED_1GB); break; - case 1: - eiter-a.cur_speed = __constant_cpu_to_be32(2); + case PORT_SPEED_2GB: + eiter-a.cur_speed = + __constant_cpu_to_be32(FDMI_PORT_SPEED_2GB); break; - case 3: - eiter-a.cur_speed = __constant_cpu_to_be32(4); + case PORT_SPEED_4GB: + eiter-a.cur_speed = + __constant_cpu_to_be32(FDMI_PORT_SPEED_4GB); + break; + default: + eiter-a.cur_speed = + __constant_cpu_to_be32(FDMI_PORT_SPEED_UNKNOWN); break; } size += 4 + 4; -- 1.5.3.rc2.4.g726f9 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/9] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
From: Shyam Sundar [EMAIL PROTECTED] Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index fa21cd8..4a50b93 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1062,6 +1062,25 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) cp-device-id, cp-device-lun, cp, cp-serial_number)); + /* +* In case of a Underrun condition, set both the lscsi +* status and the completion status to appropriate +* values. +*/ + if (resid + ((unsigned)(cp-request_bufflen - resid) +cp-underflow)) { + DEBUG2(qla_printk(KERN_INFO, ha, + scsi(%ld:%d:%d:%d): Mid-layer underflow + detected (%x of %x bytes)...returning + error status.\n, ha-host_no, + cp-device-channel, cp-device-id, + cp-device-lun, resid, + cp-request_bufflen)); + + cp-result = DID_ERROR 16 | lscsi_status; + } + if (sense_len) DEBUG5(qla2x00_dump_buffer(cp-sense_buffer, CMD_ACTUAL_SNSLEN(cp))); -- 1.5.3.rc2.4.g726f9 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/9] qla2xxx: Re-factor isp_operations to static structures.
In preparation for new ISP types. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c | 23 ++-- drivers/scsi/qla2xxx/qla_def.h|2 +- drivers/scsi/qla2xxx/qla_gs.c | 33 +++-- drivers/scsi/qla2xxx/qla_init.c | 54 drivers/scsi/qla2xxx/qla_inline.h |2 +- drivers/scsi/qla2xxx/qla_iocb.c |4 +- drivers/scsi/qla2xxx/qla_isr.c| 10 +- drivers/scsi/qla2xxx/qla_os.c | 300 + drivers/scsi/qla2xxx/qla_sup.c| 12 +- 9 files changed, 244 insertions(+), 196 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index e406eae..362353d 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -98,7 +98,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, /* Read NVRAM. */ spin_lock_irqsave(ha-hardware_lock, flags); - ha-isp_ops.read_nvram(ha, (uint8_t *)buf, ha-nvram_base, + ha-isp_ops-read_nvram(ha, (uint8_t *)buf, ha-nvram_base, ha-nvram_size); spin_unlock_irqrestore(ha-hardware_lock, flags); @@ -143,7 +143,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, /* Write NVRAM. */ spin_lock_irqsave(ha-hardware_lock, flags); - ha-isp_ops.write_nvram(ha, (uint8_t *)buf, ha-nvram_base, count); + ha-isp_ops-write_nvram(ha, (uint8_t *)buf, ha-nvram_base, count); spin_unlock_irqrestore(ha-hardware_lock, flags); set_bit(ISP_ABORT_NEEDED, ha-dpc_flags); @@ -252,7 +252,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, } memset(ha-optrom_buffer, 0, ha-optrom_size); - ha-isp_ops.read_optrom(ha, ha-optrom_buffer, 0, + ha-isp_ops-read_optrom(ha, ha-optrom_buffer, 0, ha-optrom_size); break; case 2: @@ -275,7 +275,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, if (ha-optrom_state != QLA_SWRITING) break; - ha-isp_ops.write_optrom(ha, ha-optrom_buffer, 0, + ha-isp_ops-write_optrom(ha, ha-optrom_buffer, 0, ha-optrom_size); break; } @@ -305,7 +305,8 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, /* Read NVRAM. */ spin_lock_irqsave(ha-hardware_lock, flags); - ha-isp_ops.read_nvram(ha, (uint8_t *)buf, ha-vpd_base, ha-vpd_size); + ha-isp_ops-read_nvram(ha, (uint8_t *)buf, ha-vpd_base, + ha-vpd_size); spin_unlock_irqrestore(ha-hardware_lock, flags); return ha-vpd_size; @@ -325,7 +326,7 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, /* Write NVRAM. */ spin_lock_irqsave(ha-hardware_lock, flags); - ha-isp_ops.write_nvram(ha, (uint8_t *)buf, ha-vpd_base, count); + ha-isp_ops-write_nvram(ha, (uint8_t *)buf, ha-vpd_base, count); spin_unlock_irqrestore(ha-hardware_lock, flags); return count; @@ -437,7 +438,7 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha) } if (ha-beacon_blink_led == 1) - ha-isp_ops.beacon_off(ha); + ha-isp_ops-beacon_off(ha); } /* Scsi_Host attributes. */ @@ -455,7 +456,7 @@ qla2x00_fw_version_show(struct class_device *cdev, char *buf) char fw_str[30]; return snprintf(buf, PAGE_SIZE, %s\n, - ha-isp_ops.fw_version_str(ha, fw_str)); + ha-isp_ops-fw_version_str(ha, fw_str)); } static ssize_t @@ -507,7 +508,7 @@ qla2x00_pci_info_show(struct class_device *cdev, char *buf) char pci_info[30]; return snprintf(buf, PAGE_SIZE, %s\n, - ha-isp_ops.pci_info_str(ha, pci_info)); + ha-isp_ops-pci_info_str(ha, pci_info)); } static ssize_t @@ -652,9 +653,9 @@ qla2x00_beacon_store(struct class_device *cdev, const char *buf, return -EINVAL; if (val) - rval = ha-isp_ops.beacon_on(ha); + rval = ha-isp_ops-beacon_on(ha); else - rval = ha-isp_ops.beacon_off(ha); + rval = ha-isp_ops-beacon_off(ha); if (rval != QLA_SUCCESS) count = 0; diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index f98eb63..27a2396 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2286,7 +2286,7 @@ typedef struct scsi_qla_host { uint16_trsp_ring_index; /* Current index. */ uint16_tresponse_q_length; - struct isp_operations isp_ops; + struct isp_operations *isp_ops; /* Outstandings ISP commands. */ srb_t *outstanding_cmds[MAX_OUTSTANDING_COMMANDS]; diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 301279a..e393c84 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -180,7 +180,8 @@ qla2x00_ga_nxt
[PATCH] dm-mpath-rdac: don't stomp on a request's transfer bit.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- On Thu, 12 Jul 2007, Mike Anderson wrote: Copying this mail to linux-scsi and Ccing Andrew Vasquez to possibly provide input on the Qlogic behavior. ... Jul 12 17:11:15 jimbo kernel: qla2xxx :02:01.1: ISP System Error - mbx1=0h mbx2=8012h mbx3=8002h. Jul 12 17:11:15 jimbo kernel: qla2xxx :02:01.1: Firmware has been previously dumped (c2000171d000) -- ignoring request... Jul 12 17:11:16 jimbo kernel: qla2xxx :02:01.1: Performing ISP error recovery - ha= 81007e85c530. So what's happening here is the firmware is detecting a Xfer-ready from the storage when in fact the data-direction for a mode-select should be a write (DATA_OUT). The following patch fixes the problem (typo). Verified by Brian, as well. diff --git a/drivers/md/dm-mpath-rdac.c b/drivers/md/dm-mpath-rdac.c index 8b776b8..16b1613 100644 --- a/drivers/md/dm-mpath-rdac.c +++ b/drivers/md/dm-mpath-rdac.c @@ -292,7 +292,7 @@ static struct request *get_rdac_req(struct rdac_handler *h, rq-end_io_data = h; rq-timeout = h-timeout; rq-cmd_type = REQ_TYPE_BLOCK_PC; - rq-cmd_flags = REQ_FAILFAST | REQ_NOMERGE; + rq-cmd_flags |= REQ_FAILFAST | REQ_NOMERGE; return rq; } - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] qla4xxx: allow hba to be online when initiator ip address is uninitialized
On Thu, 14 Jun 2007, David Somayajulu wrote: On Thu, 2007-06-14 at 01:54 -0400, Mike Christie wrote: David C Somayajulu wrote: It looks ok, but creating the status variable and setting it like this, just to quiet the compile warning, and never doing anything else with it doesn't seem nice. I don't like it either. I tried with (void)pci_set_mwi(ha-pdev); and this is what I see I was hoping that Randy's proposal for pci_try_set_mwi() was accepted: http://article.gmane.org/gmane.linux.scsi/31230/ that way drivers could safely ignore the return (if necessary). - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: qla2xxx errors? (2.6.19)
On Sun, 10 Jun 2007, Csillag Tamas wrote: The university I work at has 4 Blade HS20 servers connected to a IBM DS400 storage via Fibre Channel. The fibre channel module is: 06:01.0 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 02) 06:01.1 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 02) # lsmod Module Size Used by ... qla2xxx 143584 1 # l /lib/firmware total 244 lrwxrwxrwx 1 root root 21 2007-05-05 22:02 ql2300_fw.bin - ql2300_fw.bin.3.03.18 With recent kernels filesystem corruption occurs under high disk I/O. I have just tried 2.6.19 and I got the same, but kernel 2.6.18 and before looks safe. Could you load the driver with the ql2xextended_error_logging module parameter enabled: $ echo 6 4 1 7 /proc/sys/kernel/printk $ insmod qla2xxx.ko ql2xextended_error_logging=1 and forward over the resultant messages file beginning with the load of the driver to the point at which the File-system failure occurs. The test I use is the following: I first checkout the kernel's git tree: # git-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6.git Then # for i in {100..400}; do; rsync -a linux-2.6.git/ c2_$i done waiting for finish # for i in {100..400}; do; rsync -a linux-2.6.git/ c3_$i done waiting for finish # for i in {100..400}; do; rsync -a linux-2.6.git/ c4_$i done Some error messages: ReiserFS: warning: is_tree_node: node level 32010 does not match to the expected one 1 ReiserFS: sdb1: warning: vs-5150: search_by_key: invalid format found in block 8093723. Fsck? ReiserFS: sdb1: warning: vs-13070: reiserfs_read_locked_inode: i/o failure occurred trying to find stat data of [961831 1064427 0x0 SD] I can setup somthing similar locally, I take it you are writing directly some some lun exported off the DS400, and not using DM? I am able to reproduce this errors. With other filesystems I get similar errors. Just curious, what are those errors? I suspect a bug in qla2xxx, but I am not sure. Can you help me how to track down this problem? Please also provide the output of: $ cat /proc/scsi/scsi $ lspci -vvx and your .config file. Regards, Andrew Vasquez - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Patch added to scsi-pending-2.6: [SCSI] qla2xxx: convert to use the data buffer accessors
On Thu, 31 May 2007, James Bottomley wrote: Your commit: [SCSI] qla2xxx: convert to use the data buffer accessors - remove the unnecessary map_single path. - convert to use the new accessors for the sg lists and the parameters. Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED] Cc: Andrew Vasquez [EMAIL PROTECTED] Signed-off-by: James Bottomley [EMAIL PROTECTED] has been added to the pending SCSI tree Acked-by: Andrew Vasquez [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 14/25] SCSI: use irq_handler_t where appropriate
On Wed, 23 May 2007, [EMAIL PROTECTED] wrote: Subject: [patch 14/25] SCSI: use irq_handler_t where appropriate Message-Id: [EMAIL PROTECTED] From: Jeff Garzik [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/scsi/aacraid/aacraid.h |2 +- drivers/scsi/qla2xxx/qla_isr.c |2 +- ACK -- the qla2xxx changes. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Scst-devel] Problems with SCST and QLA 2432 FC Cards
On Sat, 19 May 2007, Johan Kragsterman wrote: Andrew Vasquez [EMAIL PROTECTED] Skrev: QLogic doesn't formally release target-mode drivers for their ISP chips. Matthew J. has done a great job at providing a community available souce-base from which to draw ideas and code from. Regards, Andrew Vasquez So, Andrew, do you officially represent Qlogic? If so, your point of view here is interesting, since you seem to consider that: Matthew J. has done a great job at providing a community available souce-base from which to draw ideas and code from. Matthew's driver works on a variety of *nix platforms which QLogic does not provide drivers for -- *BSD varients, etc. He also has a fine target-mode driver which others can reference. In what way is Qlogic interested in helping the community with providing open firmware, We've worked with various members of the open-source community to address some of licensing issues. At this stage we provide firmware-blobs for all our ISPs under the (3 clause) BSD license: ftp://ftp.qlogic.com/outgoing/linux/firmware/ Firmware specifications are still tightly circulated. drivers and tools? If there's some specific OS's and 'tools' you'd like to see more work on from QLogic, then I can forward your request up-the-chain. -- Andrew Vasquez - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Scst-devel] Problems with SCST and QLA 2432 FC Cards
On Fri, 18 May 2007, Johan Kragsterman wrote: Most probably, the driver by link sent by Matthew Jacob will be a good starting point, where you can see examples how to work with the card, so you can add it to the qla2x00t driver. Also you will need a manual the firmware interface specification for 2400 series of the cards. It is under NDA, but you maybe lucky to get one from QLogic. Feel free to ask me any SCST or qla2x00t driver related questions. I have adequate experience of programming in the SCSI domain, however i am not much conversant with the QLA driver code. That´s a very nice initiativ! Though I believe the most important target driver to develope is one for a PCI-Express HBA. I believe QLA24xx stands for PCI-X, doesn´t it? And the PCI-Express HBA is called QLE-something? But maybe with this driver we will come closer to a PCI-Express HBA target driver? QLogic doesn't formally release target-mode drivers for their ISP chips. Matthew J. has done a great job at providing a community available souce-base from which to draw ideas and code from. Regards, Andrew Vasquez - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/6] qla2xxx: updates for 2.6.22 [8.01.07-k7].
This patchset updates the qla2xxx driver to 8.01.07-k7. drivers/scsi/qla2xxx/qla_init.c| 33 - drivers/scsi/qla2xxx/qla_isr.c | 15 ++- drivers/scsi/qla2xxx/qla_os.c |6 ++ drivers/scsi/qla2xxx/qla_version.h |2 +- 4 files changed, 33 insertions(+), 23 deletions(-) here's the commits: - Error-out during probe() if we're unable to complete HBA initialization. - Honor NVRAM port-down-retry-count settings. - Attempt to stop firmware only if it had been previously executed. - Correct pci_set_msi() usage semantics. - Add MSI support. - Update version number to 8.01.07-k7. Regards, Andrew Vasquez QLogic Corporation - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/6] qla2xxx: Error-out during probe() if we're unable to complete HBA initialization.
Remove a stale check against ha-device_flags (DFLG_NO_CABLE) as topology scanning is performed within the DPC-thread context. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_os.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b78919a..0a36912 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1577,9 +1577,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto probe_failed; } - if (qla2x00_initialize_adapter(ha) - !(ha-device_flags DFLG_NO_CABLE)) { - + if (qla2x00_initialize_adapter(ha)) { qla_printk(KERN_WARNING, ha, Failed to initialize adapter\n); -- 1.5.2.rc1.9.g6644 - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html