Skip to contentSkip to conversation

qla2xxx: Driver updates for 2.6.24 [8.02.00-k5].

PATCH New Andrew Vasquez 1 participant 9 messages Oct 19, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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

#1 lore raw

PATCH 1/8 qla2xxx: Resync with latest HBA SSID specification -- 2.2u.

---
 drivers/scsi/qla2xxx/qla_devtbl.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_devtbl.h +6 -1
index dd43541..d78d35e 100644
@@ -1,4 +1,4 @@
-#define QLA_MODEL_NAMES		0x57
+#define QLA_MODEL_NAMES		0x5C
 
 /*
  * 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 */
 };
Signature · 1 line
1.5.3.4.206.g58ba4
#2 lore raw

PATCH 2/8 qla2xxx: Defer explicit interrupt-polling processing to init-time scenarios.

In reply to Andrew Vasquez

As the intermixing may cause issues where HCCR bits could be cleared inappropriately during MSI/MSI-X interrupt handling.

---
 drivers/scsi/qla2xxx/qla_iocb.c |    2 +-
 drivers/scsi/qla2xxx/qla_mbx.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_iocb.c +1 -1
index 7f6a89b..024c662 100644
@@ -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);
drivers/scsi/qla2xxx/qla_mbx.c +1 -1
index c53ec67..ccd662a 100644
@@ -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));
 
Signature · 1 line
1.5.3.4.206.g58ba4
#3 lore raw

PATCH 3/8 qla2xxx: Handle unaligned sector writes during NVRAM/VPD updates.

In reply to Andrew Vasquez

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.

---
 drivers/scsi/qla2xxx/qla_attr.c |    6 ------
 drivers/scsi/qla2xxx/qla_sup.c  |   23 +++++++++++++++++++++--
 2 files changed, 21 insertions(+), 8 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -6
index 05fa779..2f0bd5a 100644
@@ -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_t	cnt;
 
 	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;
 }
drivers/scsi/qla2xxx/qla_sup.c +21 -2
index 40b059f..b3faff0 100644
@@ -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
Signature · 1 line
1.5.3.4.206.g58ba4
#4 lore raw

PATCH 4/8 qla2xxx: Fix issue where final flash-segment updates were falling into the slow-path write handler.

In reply to Andrew Vasquez

Original implementation would not use the burst-write mechanisms for requests equal to OPTROM_BURST_DWORDS transfer dwords.

---
 drivers/scsi/qla2xxx/qla_sup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_sup.c +1 -1
index b3faff0..0a35f87 100644
@@ -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++)
Signature · 1 line
1.5.3.4.206.g58ba4
#6 lore raw

PATCH 6/8 qla2xxx: Correct residual-count handling discrepancies during UNDERRUN handling.

In reply to Andrew Vasquez

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.

---
 drivers/scsi/qla2xxx/qla_isr.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +7 -1
index c4768c4..1104bd2 100644
@@ -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);
Signature · 1 line
1.5.3.4.206.g58ba4
#5 lore raw

PATCH 5/8 qla2xxx: Make driver (mostly) legacy I/O port free.

In reply to Andrew Vasquez

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).

---
 drivers/scsi/qla2xxx/qla_def.h |    1 +
 drivers/scsi/qla2xxx/qla_os.c  |   50 ++++++++++++++++++++++++----------------
 2 files changed, 31 insertions(+), 20 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +1 -0
index 1900fbf..04e8cbc 100644
@@ -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;
drivers/scsi/qla2xxx/qla_os.c +30 -20

100 lines not on this page · raw message

Signature · 1 line
1.5.3.4.206.g58ba4
#7 lore raw

PATCH 7/8 qla2xxx: Correct display of ISP serial-number.

In reply to Andrew Vasquez

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.

---
 drivers/scsi/qla2xxx/qla_attr.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +3 -0
index 2f0bd5a..fb388b8 100644
@@ -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 / 100000,
 	    sn % 100000);
Signature · 1 line
1.5.3.4.206.g58ba4
#8 lore raw

PATCH 8/8 qla2xxx: Update version number to 8.02.00-k5.

In reply to Andrew Vasquez
---
 drivers/scsi/qla2xxx/qla_version.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +1 -1
index 2d551a3..ae6f7a2 100644
@@ -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
Signature · 1 line
1.5.3.4.206.g58ba4