Skip to contentSkip to conversation

qla2xxx: fixes for 2.6.21 [8.01.07-k6].

PATCH New Andrew Vasquez 1 participant 7 messages Mar 12, 2007

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

cover qla2xxx: fixes for 2.6.21 [8.01.07-k6].

This patchset updates the qla2xxx driver to 8.01.07-k6.

 drivers/scsi/qla2xxx/qla_def.h     |   13 ++++++++-----
 drivers/scsi/qla2xxx/qla_os.c      |    4 +++-
 drivers/scsi/qla2xxx/qla_sup.c     |   11 +++++------
 drivers/scsi/qla2xxx/qla_version.h |    2 +-
 4 files changed, 17 insertions(+), 13 deletions(-)

here's the commits:

- fix RSCN handling on big-endian systems
- Add scan_[start|finish]() callbacks for ISP24xx HBAs.
- Add cond_resched() calls during HBA flash manipulation.
- Drop acquisition of hardware_lock during flash manipulations.
- Allow the extended-error-logging flag to be dynamic.
- Update version number to 8.01.07-k6.

Regards,
Andrew Vasquez
QLogic Corporation

#1 lore raw

PATCH 1/6 qla2xxx: fix RSCN handling on big-endian systems

From: [email protected] <[email protected]>

qla2xxx driver fails to handle RSCN events affecting area or domain due to an endian issue on big endian systems. This fixes the port_id_t structure on big endian systems.

---
 drivers/scsi/qla2xxx/qla_def.h |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +8 -5
index 05f4f2a..e8948b6 100644
@@ -1478,14 +1478,17 @@ typedef union {
 	uint32_t b24 : 24;
 
 	struct {
-		uint8_t d_id[3];
-		uint8_t rsvd_1;
-	} r;
-
-	struct {
+#ifdef __BIG_ENDIAN
+		uint8_t domain;
+		uint8_t area;
+		uint8_t al_pa;
+#elif __LITTLE_ENDIAN
 		uint8_t al_pa;
 		uint8_t area;
 		uint8_t domain;
+#else
+#error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined!"
+#endif
 		uint8_t rsvd_1;
 	} b;
 } port_id_t;
Signature · 1 line
1.5.0.3.382.g34572
#2 lore raw

PATCH 2/6 qla2xxx: Add scan_[start|finish]() callbacks for ISP24xx HBAs.

In reply to Andrew Vasquez
---
 drivers/scsi/qla2xxx/qla_os.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +2 -0
index 68f5d24..f67ef38 100644
@@ -157,6 +157,8 @@ static struct scsi_host_template qla24xx_driver_template = {
 
 	.slave_alloc		= qla2xxx_slave_alloc,
 	.slave_destroy		= qla2xxx_slave_destroy,
+	.scan_finished		= qla2xxx_scan_finished,
+	.scan_start		= qla2xxx_scan_start,
 	.change_queue_depth	= qla2x00_change_queue_depth,
 	.change_queue_type	= qla2x00_change_queue_type,
 	.this_id		= -1,
Signature · 1 line
1.5.0.3.382.g34572
#3 lore raw

PATCH 3/6 qla2xxx: Add cond_resched() calls during HBA flash manipulation.

In reply to Andrew Vasquez

We're observing soft lockups during HBA FLASH retrieval and update. Add cond_resched() each time around the tight-loops during flash read()s/write()s.

---
 drivers/scsi/qla2xxx/qla_sup.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_sup.c +5 -0
index ff1dd41..362d041 100644
@@ -466,6 +466,7 @@ qla24xx_read_flash_dword(scsi_qla_host_t *ha, uint32_t addr)
 			udelay(10);
 		else
 			rval = QLA_FUNCTION_TIMEOUT;
+		cond_resched();
 	}
 
 	/* TODO: What happens if we time out? */
@@ -508,6 +509,7 @@ qla24xx_write_flash_dword(scsi_qla_host_t *ha, uint32_t addr, uint32_t data)
 			udelay(10);
 		else
 			rval = QLA_FUNCTION_TIMEOUT;
+		cond_resched();
 	}
 	return rval;
 }
@@ -1255,6 +1257,7 @@ qla2x00_poll_flash(scsi_qla_host_t *ha, uint32_t addr, uint8_t poll_data,
 		}
 		udelay(10);
 		barrier();
+		cond_resched();
 	}
 	return status;
 }
@@ -1403,6 +1406,7 @@ qla2x00_read_flash_data(scsi_qla_host_t *ha, uint8_t *tmp_buf, uint32_t saddr,
 		if (saddr % 100)
 			udelay(10);
 		*tmp_buf = data;
+		cond_resched();
 	}
 }
 
@@ -1689,6 +1693,7 @@ update_flash:
 				rval = QLA_FUNCTION_FAILED;
 				break;
 			}
+			cond_resched();
 		}
 	} while (0);
 	qla2x00_flash_disable(ha);
Signature · 1 line
1.5.0.3.382.g34572
#4 lore raw

PATCH 4/6 qla2xxx: Drop acquisition of hardware_lock during flash manipulations.

In reply to Andrew Vasquez

There's no need given, I/O has been quiesced, RISC interrupts have been disabled, and finally the RISC has been paused. Flash manipulation on ISP21xx, ISP22xx, and ISP23xx parts requires the RISC to go through a full reset to recover.

---
 drivers/scsi/qla2xxx/qla_sup.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/scsi/qla2xxx/qla_sup.c +0 -6
index 362d041..206bda0 100644
@@ -1453,7 +1453,6 @@ uint8_t *
 qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
     uint32_t offset, uint32_t length)
 {
-	unsigned long flags;
 	uint32_t addr, midpoint;
 	uint8_t *data;
 	struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
@@ -1462,7 +1461,6 @@ qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
 	qla2x00_suspend_hba(ha);
 
 	/* Go with read. */
-	spin_lock_irqsave(&ha->hardware_lock, flags);
 	midpoint = ha->optrom_size / 2;
 
 	qla2x00_flash_enable(ha);
@@ -1477,7 +1475,6 @@ qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
 		*data = qla2x00_read_flash_byte(ha, addr);
 	}
 	qla2x00_flash_disable(ha);
-	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
 	/* Resume HBA. */
 	qla2x00_resume_hba(ha);
@@ -1491,7 +1488,6 @@ qla2x00_write_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
 {
 
 	int rval;
-	unsigned long flags;
 	uint8_t man_id, flash_id, sec_number, data;
 	uint16_t wd;
 	uint32_t addr, liter, sec_mask, rest_addr;
@@ -1504,7 +1500,6 @@ qla2x00_write_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
 	sec_number = 0;
 
 	/* Reset ISP chip. */
-	spin_lock_irqsave(&ha->hardware_lock, flags);
 	WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
 	pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
 
@@ -1697,7 +1692,6 @@ update_flash:
 		}
 	} while (0);
 	qla2x00_flash_disable(ha);
-	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
 	/* Resume HBA. */
 	qla2x00_resume_hba(ha);
Signature · 1 line
1.5.0.3.382.g34572
#5 lore raw

PATCH 5/6 qla2xxx: Allow the extended-error-logging flag to be dynamic.

In reply to Andrew Vasquez

The module parameter, ql2xextended_error_logging, can now be set dynamically by writing to the following sysfs entry:

/sys/module/qla2xxx/parameters/ql2xextended_error_logging

This alleviates the need for the driver to be unloaded and reloaded in order to enable logging.

---
 drivers/scsi/qla2xxx/qla_os.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +1 -1
index f67ef38..b6c96a8 100644
@@ -62,7 +62,7 @@ MODULE_PARM_DESC(ql2xallocfwdump,
 		"vary by ISP type.  Default is 1 - allocate memory.");
 
 int ql2xextended_error_logging;
-module_param(ql2xextended_error_logging, int, S_IRUGO|S_IRUSR);
+module_param(ql2xextended_error_logging, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xextended_error_logging,
 		"Option to enable extended error logging, "
 		"Default is 0 - no logging. 1 - log errors.");
Signature · 1 line
1.5.0.3.382.g34572
#6 lore raw

PATCH 6/6 qla2xxx: Update version number to 8.01.07-k6.

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 61347ae..dc85495 100644
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.01.07-k5"
+#define QLA2XXX_VERSION      "8.01.07-k6"
 
 #define QLA_DRIVER_MAJOR_VER	8
 #define QLA_DRIVER_MINOR_VER	1
Signature · 1 line
1.5.0.3.382.g34572