[PATCH v3 2/2] scsi: qla4xxx: advance the reset-sequence array cursor in poll_read_list
From: Yehyeong Lee
Date: Sun Oct 11 2026 - 12:06:49 EST
qla4_83xx_poll_read_list() stores each polled register value into
ha->reset_tmplt.array at ha->reset_tmplt.array_index, but it only wrote
the cursor back when it wrapped at QLA83XX_MAX_RESET_SEQ_ENTRIES. The
cursor starts at zero and the wrap is never reached, so it stays at zero
and every read overwrites array[0].
array[0] is the slot qla4_83xx_rmw_crb_reg() treats as "read the register
directly" rather than "read array[index_a]", so the polled values never
reach the slots a read-modify-write entry refers to; those read back as
the zero the array was initialised with.
Write the cursor back after every read and start it at one, so the polled
values fill array[1] onward and a read-modify-write entry sees them. Slot
zero stays reserved as the direct-read marker. qla4_83xx_process_stop_seq()
already restarts seq_index for each reset but left the array cursor alone,
so reset it there too and the array refills from the start each time.
Fixes: 6e7b429259fc ("[SCSI] qla4xxx: Added support for ISP83XX")
Signed-off-by: Yehyeong Lee <yhlee@xxxxxxxxxxxxxxxxxx>
---
drivers/scsi/qla4xxx/ql4_83xx.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index c68500280168b..ed72040e905ae 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -1122,14 +1122,18 @@ static void qla4_83xx_poll_read_list(struct scsi_qla_host *ha,
__func__, i,
ha->reset_tmplt.seq_index));
} else {
+ /* array[0] is the rmw sentinel; slots are 1-based */
index = ha->reset_tmplt.array_index;
+ if (index == 0)
+ index = 1;
qla4_83xx_rd_reg_indirect(ha,
le32_to_cpu(p_entry->dr_addr),
&value);
ha->reset_tmplt.array[index++] = value;
if (index == QLA83XX_MAX_RESET_SEQ_ENTRIES)
- ha->reset_tmplt.array_index = 1;
+ index = 1;
+ ha->reset_tmplt.array_index = index;
}
}
}
@@ -1256,6 +1260,7 @@ static void qla4_83xx_process_reset_template(struct scsi_qla_host *ha,
static void qla4_83xx_process_stop_seq(struct scsi_qla_host *ha)
{
ha->reset_tmplt.seq_index = 0;
+ ha->reset_tmplt.array_index = 1;
qla4_83xx_process_reset_template(ha, ha->reset_tmplt.stop_offset);
if (ha->reset_tmplt.seq_end != 1)
--
2.43.0