Skip to contentSkip to conversation

qla2xxx: fixes for 2.6.25.

PATCH New Andrew Vasquez 1 participant 5 messages Feb 28, 2008

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

James,

Here's s small handful of fixes for qla2xxx.

- Correct needless clean-up resets during shutdown.
- Correct discrepancies during OVERRUN handling on FWI2-capable cards.
- Correct usage of inconsistent timeout values while issuing ELS commands.
- Update version number to 8.02.00-k9.

Please apply.

Regards,
Andrew Vasquez

#2 lore raw

PATCH 2/4 qla2xxx: Correct discrepancies during OVERRUN handling on FWI2-capable cards.

For recent ISPs, software must detect OVERRUN conditions by checking the SS_RESIDUAL_OVER bit during CS_COMPLETE handling. Update the driver to perform this check, which is consistent with what earlier firmwares did by explicitly cracking open the FCP_RSP statuses and returning an CS_DATA_OVERRUN.

---
 drivers/scsi/qla2xxx/qla_isr.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +5 -0
index 14e6f22..f033703 100644
@@ -958,6 +958,11 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
 		}
 	}
 
+	/* Check for overrun. */
+	if (IS_FWI2_CAPABLE(ha) && comp_status == CS_COMPLETE &&
+	    scsi_status & SS_RESIDUAL_OVER)
+		comp_status = CS_DATA_OVERRUN;
+
 	/*
 	 * Based on Host and scsi status generate status code for Linux
 	 */
Signature · 1 line
1.5.4.3.230.g2db511
#3 lore raw

PATCH 3/4 qla2xxx: Correct usage of inconsistent timeout values while issuing ELS commands.

In reply to Andrew Vasquez

The original code would incorrectly hardcode ELS timeout values rather than using the traditional '2 * r_a_tov' value. In some cases, the hardcoded values would be larger than the mailbox-command-timeout and result in a needless BIG_HAMMER (ISP reset), the typical recovery mechanism employed in such cases.

The second defect in the original code was in the assignment of the default 'ha->r_a_tov' to twice the traditional value. Correct this by setting the value to 10 seconds.

---
 drivers/scsi/qla2xxx/qla_gs.c   |   10 +++++-----
 drivers/scsi/qla2xxx/qla_init.c |    8 ++++----
 drivers/scsi/qla2xxx/qla_mbx.c  |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)
drivers/scsi/qla2xxx/qla_gs.c +5 -5
index 6226d88..c180876 100644
@@ -39,7 +39,7 @@ qla2x00_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size)
 	ms_pkt->entry_count = 1;
 	SET_TARGET_ID(ha, ms_pkt->loop_id, SIMPLE_NAME_SERVER);
 	ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG);
-	ms_pkt->timeout = __constant_cpu_to_le16(25);
+	ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
 	ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
 	ms_pkt->total_dsd_count = __constant_cpu_to_le16(2);
 	ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size);
@@ -75,7 +75,7 @@ qla24xx_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size)
 	ct_pkt->entry_type = CT_IOCB_TYPE;
 	ct_pkt->entry_count = 1;
 	ct_pkt->nport_handle = __constant_cpu_to_le16(NPH_SNS);
-	ct_pkt->timeout = __constant_cpu_to_le16(25);
+	ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
 	ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
 	ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
 	ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
@@ -1144,7 +1144,7 @@ qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *ha, uint32_t req_size,
 	ms_pkt->entry_count = 1;
 	SET_TARGET_ID(ha, ms_pkt->loop_id, ha->mgmt_svr_loop_id);
 	ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG);
-	ms_pkt->timeout = __constant_cpu_to_le16(59);
+	ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
 	ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
 	ms_pkt->total_dsd_count = __constant_cpu_to_le16(2);
 	ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size);
@@ -1181,7 +1181,7 @@ qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *ha, uint32_t req_size,
 	ct_pkt->entry_type = CT_IOCB_TYPE;
 	ct_pkt->entry_count = 1;
 	ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id);
-	ct_pkt->timeout = __constant_cpu_to_le16(59);
+	ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
 	ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
 	ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
 	ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
@@ -1761,7 +1761,7 @@ qla24xx_prep_ms_fm_iocb(scsi_qla_host_t *ha, uint32_t req_size,
 	ct_pkt->entry_type = CT_IOCB_TYPE;
 	ct_pkt->entry_count = 1;
 	ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id);
-	ct_pkt->timeout = __constant_cpu_to_le16(59);
+	ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
 	ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
 	ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
 	ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
drivers/scsi/qla2xxx/qla_init.c +4 -4
index 4897663..364be7d 100644
@@ -1733,8 +1733,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
 	ha->login_timeout = nv->login_timeout;
 	icb->login_timeout = nv->login_timeout;
 
-	/* Set minimum RATOV to 200 tenths of a second. */
-	ha->r_a_tov = 200;
+	/* Set minimum RATOV to 100 tenths of a second. */
+	ha->r_a_tov = 100;
 
 	ha->loop_reset_delay = nv->reset_delay;
 
@@ -3645,8 +3645,8 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
 	ha->login_timeout = le16_to_cpu(nv->login_timeout);
 	icb->login_timeout = cpu_to_le16(nv->login_timeout);
 
-	/* Set minimum RATOV to 200 tenths of a second. */
-	ha->r_a_tov = 200;
+	/* Set minimum RATOV to 100 tenths of a second. */
+	ha->r_a_tov = 100;
 
 	ha->loop_reset_delay = nv->reset_delay;
 
drivers/scsi/qla2xxx/qla_mbx.c +1 -1
index 99d29ff..bb10358 100644
@@ -2206,7 +2206,7 @@ qla24xx_abort_target(fc_port_t *fcport)
 	tsk->p.tsk.entry_type = TSK_MGMT_IOCB_TYPE;
 	tsk->p.tsk.entry_count = 1;
 	tsk->p.tsk.nport_handle = cpu_to_le16(fcport->loop_id);
-	tsk->p.tsk.timeout = __constant_cpu_to_le16(25);
+	tsk->p.tsk.timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
 	tsk->p.tsk.control_flags = __constant_cpu_to_le32(TCF_TARGET_RESET);
 	tsk->p.tsk.port_id[0] = fcport->d_id.b.al_pa;
 	tsk->p.tsk.port_id[1] = fcport->d_id.b.area;
Signature · 1 line
1.5.4.3.230.g2db511
#1 lore raw

PATCH 1/4 qla2xxx: Correct needless clean-up resets during shutdown.

In reply to Andrew Vasquez

There's no point in hitting the RISC with what will most assuredly be an unsucessful reset of the RISC hardware if the initial stop-firmware mailbox command fails with a time-out status. Instead, to avoid what could amount to a lengthy stop-firmware/detect-failure/reset-risc loop, continue with driver unloading and discard the stop-firmware requirement.

---
 drivers/scsi/qla2xxx/qla_init.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +2 -1
index d5c7853..4897663 100644
@@ -4022,7 +4022,8 @@ qla2x00_try_to_stop_firmware(scsi_qla_host_t *ha)
 		return;
 
 	ret = qla2x00_stop_firmware(ha);
-	for (retries = 5; ret != QLA_SUCCESS && retries ; retries--) {
+	for (retries = 5; ret != QLA_SUCCESS && ret != QLA_FUNCTION_TIMEOUT &&
+	    retries ; retries--) {
 		qla2x00_reset_chip(ha);
 		if (qla2x00_chip_diag(ha) != QLA_SUCCESS)
 			continue;
Signature · 1 line
1.5.4.3.230.g2db511
#4 lore raw

PATCH 4/4 qla2xxx: Update version number to 8.02.00-k9.

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 c5742cc..ea08a12 100644
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.02.00-k8"
+#define QLA2XXX_VERSION      "8.02.00-k9"
 
 #define QLA_DRIVER_MAJOR_VER	8
 #define QLA_DRIVER_MINOR_VER	2
Signature · 1 line
1.5.4.3.230.g2db511