mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
scsi: qla2xxx: Fix soft lockup polling continuation IOCB signature
qla27xx_copy_multiple_pkt() and qla27xx_copy_fpin_pkt() poll
rsp_q->ring_ptr->signature for RESPONSE_PROCESSED (0xDEADDEAD) to decide
whether the next continuation IOCB has arrived, spinning on cpu_relax()
without advancing the ring or decrementing the entry count while it has
not. response_t::signature lives at byte offset 60, but a continuation
IOCB (sts_cont_entry_t / struct sts_cont_entry_ext) carries raw FC frame
payload at that offset (data[56..59]). A received frame whose payload
bytes happen to equal 0xDEADDEAD is therefore misread as "not yet
arrived", and the loop spins forever in interrupt/DPC context, causing a
CPU soft lockup.
The poll is also unnecessary: callers of qla27xx_copy_multiple_pkt()
(PT_LS4_UNSOL and the NVMe purls path) already gate on
qla_chk_cont_iocb_avail(), which guarantees all entry_count IOCBs are
present before copying begins. The sibling helper
__qla_copy_purex_to_buffer() already drops the signature poll and relies
on the entry_type == STATUS_CONT_TYPE guard instead.
Remove the signature busy-wait from both helpers, keeping the entry_type
guard, and gate the FPIN path with qla_chk_cont_iocb_avail() so it defers
and re-processes on the next interrupt once all continuation IOCBs have
arrived, mirroring the ELS_AUTH_ELS and PT_LS4_UNSOL arms. With this the
signature field is never read on a continuation IOCB, eliminating the
payload-aliasing lockup.
Fixes: 9f2475fe74 ("scsi: qla2xxx: SAN congestion management implementation")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-dev@google.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://patch.msgid.link/20260730155838.2119230-15-njavali@marvell.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
committed by
Martin K. Petersen (Oracle)
parent
3ba019bdd8
commit
d7e3fa7d06
@@ -1002,14 +1002,6 @@ qla27xx_copy_multiple_pkt(struct scsi_qla_host *vha, void **pkt,
|
||||
|
||||
do {
|
||||
while ((total_bytes > 0) && (entry_count_remaining > 0)) {
|
||||
if (rsp_q->ring_ptr->signature == RESPONSE_PROCESSED) {
|
||||
ql_dbg(ql_dbg_async, vha, 0x5084,
|
||||
"Ran out of IOCBs, partial data 0x%x\n",
|
||||
buffer_copy_offset);
|
||||
cpu_relax();
|
||||
continue;
|
||||
}
|
||||
|
||||
*pkt = rsp_q->ring_ptr;
|
||||
data = ((sts_cont_entry_t *)*pkt)->data;
|
||||
data_sz = qla_sts_cont_data_size(ha);
|
||||
@@ -1299,14 +1291,6 @@ qla27xx_copy_fpin_pkt(struct scsi_qla_host *vha, void **pkt,
|
||||
|
||||
do {
|
||||
while ((total_bytes > 0) && (entry_count_remaining > 0)) {
|
||||
if (rsp_q->ring_ptr->signature == RESPONSE_PROCESSED) {
|
||||
ql_dbg(ql_dbg_async, vha, 0x5084,
|
||||
"Ran out of IOCBs, partial data 0x%x\n",
|
||||
buffer_copy_offset);
|
||||
cpu_relax();
|
||||
continue;
|
||||
}
|
||||
|
||||
*pkt = rsp_q->ring_ptr;
|
||||
data = ((sts_cont_entry_t *)*pkt)->data;
|
||||
data_sz = qla_sts_cont_data_size(ha);
|
||||
@@ -4272,9 +4256,24 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
|
||||
"SCM not active for this port\n");
|
||||
break;
|
||||
}
|
||||
if (qla_chk_cont_iocb_avail(vha, rsp,
|
||||
(response_t *)pkt, rsp_in)) {
|
||||
/*
|
||||
* ring_ptr and ring_index were
|
||||
* pre-incremented above. Reset them
|
||||
* back to current. Wait for next
|
||||
* interrupt with all IOCBs to arrive
|
||||
* and re-process.
|
||||
*/
|
||||
qla_rsp_ring_rewind_to(rsp,
|
||||
(response_t *)pkt, cur_ring_index);
|
||||
|
||||
ql_dbg(ql_dbg_init, vha, 0x5095,
|
||||
"Defer processing FPIN...\n");
|
||||
return;
|
||||
}
|
||||
pure_item = qla27xx_copy_fpin_pkt(vha,
|
||||
(void **)&pkt, &rsp);
|
||||
__update_rsp_in(is_shadow_hba, rsp, rsp_in);
|
||||
if (!pure_item)
|
||||
break;
|
||||
qla24xx_queue_purex_item(vha, pure_item,
|
||||
|
||||
Reference in New Issue
Block a user