Re: [PATCH] nvme: clear the prp2 field of the nvme command.

From: Christoph Hellwig
Date: Tue Nov 29 2022 - 03:42:28 EST


On Tue, Nov 29, 2022 at 09:47:11AM +0800, Lei Rao wrote:
> 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_rw().

But this is not the right place to clear it, that needs to be done
in the place that sets up the PRPs, і.e. nvme_setup_prp_simple.