mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 12:52:29 -04:00
scsi: qla2xxx: Use memset_io() to clear QLAFX00 request ring slot
For QLAFX00 the request ring is ioremapped device I/O memory
(ha->iobase + req_que_off), not DMA-coherent RAM, which is why the rest
of the FX00 path accesses it through memcpy_toio() and the wrt_reg_*
helpers. __qla2x00_alloc_iocbs() however zeroed the producer slot with a
plain memset(). On architectures such as ARM64 a regular memset() may
emit unaligned or block-zeroing instructions (e.g. DC ZVA) that are
invalid on Device memory, leading to a synchronous external abort.
Use memset_io() to clear the slot for QLAFX00, matching the I/O
accessors used elsewhere on this ring. Other adapters keep the plain
memset() on their DMA-coherent rings. The zero-fill is retained for FX00
because its IOCB builders (e.g. qlafx00_fxdisc_iocb()) copy only part of
the entry and rely on the unused tail being pre-zeroed.
Fixes: 8ae6d9c7eb ("[SCSI] qla2xxx: Enhancements to support ISPFx00.")
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-12-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
53298efcbb
commit
626e44f3d8
@@ -2530,11 +2530,13 @@ __qla2x00_alloc_iocbs(struct qla_qpair *qpair, srb_t *sp)
|
||||
*/
|
||||
req->cnt -= req_cnt;
|
||||
pkt = qla_req_ring_slot(ha, req);
|
||||
memset(pkt, 0, qla_req_entry_size(ha));
|
||||
if (IS_QLAFX00(ha)) {
|
||||
memset_io((void __iomem __force *)pkt, 0,
|
||||
qla_req_entry_size(ha));
|
||||
wrt_reg_byte((u8 __force __iomem *)&pkt->entry_count, req_cnt);
|
||||
wrt_reg_dword((__le32 __force __iomem *)&pkt->handle, handle);
|
||||
} else {
|
||||
memset(pkt, 0, qla_req_entry_size(ha));
|
||||
pkt->entry_count = req_cnt;
|
||||
pkt->handle = handle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user