nvme: clear the prp2 field of the nvme command.
PATCH 1/1 nvme: clear the prp2 field of the nvme command.
If the prp2 field is not filled in nvme_setup_prp_simple(), the prp2 field is garbage data. According to nvme spec, the prp2 is reserved if the data transfer does not cross a memory page boundary. Writing a reserved coded value into a controller property field produces undefined results, so it needs to be cleared in nvme_setup_prp_simple().
Signed-off-by Lei Rao <[email protected]>
--- drivers/nvme/host/pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/pci.c +2 -0
@@ -797,6 +797,8 @@ static blk_status_t nvme_setup_prp_simple(struct nvme_dev *dev, cmnd->dptr.prp1 =cpu_to_le64 (iod->first_dma);if (bv->bv_len > first_prp_len) cmnd->dptr.prp2 =cpu_to_le64 (iod->first_dma + first_prp_len); +else + cmnd->dptr.prp2 =0 ;return BLK_STS_OK ; }
Signature · 1 line
2.34.1
Thanks,
I've applied the patch with a slightly update commit message to the nvme-6.1 tree.