mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
nvme: Fix PRP list pointer arithmetic for chained transfers
The PRP setup code advances prp_pool using u64 pointer
arithmetic:
prp_pool += page_size;
This increments the pointer by page_size * sizeof(u64)
bytes instead of page_size bytes, resulting in invalid
PRP list addresses when multiple PRP list pages are
required.
The issue becomes visible for large transfers, typically
above 2 MiB when MDTS > 9.
Fix it by using byte-wise pointer arithmetic when
advancing to the next PRP list page.
Signed-off-by: Prashant Kamble <prashant.kamble223@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260518022535.17197-1-prashant.kamble223@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This commit is contained in:
committed by
Neil Armstrong
parent
4e91d9ff33
commit
4f51050598
@@ -94,7 +94,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
|
||||
*(prp_pool + i) = cpu_to_le64((ulong)prp_pool +
|
||||
page_size);
|
||||
i = 0;
|
||||
prp_pool += page_size;
|
||||
prp_pool = (u64 *)((uintptr_t)prp_pool + page_size);
|
||||
}
|
||||
*(prp_pool + i++) = cpu_to_le64(dma_addr);
|
||||
dma_addr += page_size;
|
||||
|
||||
Reference in New Issue
Block a user