nvme: check the PRINFO bit before deciding the host buffer length
authorRevanth Rajashekar <revanth.rajashekar@intel.com>
Fri, 15 Jan 2021 01:55:07 +0000 (18:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2021 14:37:15 +0000 (15:37 +0100)
commit57f26d9d09d64e0b31bedffdd0de460215675ca9
tree3f8530837ae165d7436743a3480b0f542732b4c0
parenta9fd4ef6e50c22a303afaa9ebfd7e0fea0d5d1ff
nvme: check the PRINFO bit before deciding the host buffer length

[ Upstream commit 4d6b1c95b974761c01cbad92321b82232b66d2a2 ]

According to NVMe spec v1.4, section 8.3.1, the PRINFO bit and
the metadata size play a vital role in deteriming the host buffer size.

If PRIFNO bit is set and MS==8, the host doesn't add the metadata buffer,
instead the controller adds it.

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c