]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-pci: use dma memory for the host memory buffer descriptors
authorChristoph Hellwig <hch@lst.de>
Mon, 28 Aug 2017 08:47:18 +0000 (10:47 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 30 Aug 2017 12:46:16 +0000 (14:46 +0200)
commitfd725e8038da05ff1599c5e5b0537856a12b476b
tree81f7218bdd10c02f383032eee9dd923b0c5e89ce
parent15212497d305e04d5b55d9cd087731f109fd6484
nvme-pci: use dma memory for the host memory buffer descriptors

The NVMe 1.3 specification says in section 5.21.1.13:

"After a successful completion of a Set Features enabling the host memory
 buffer, the host shall not write to the associated host memory region,
 buffer size, or descriptor list until the host memory buffer has been
 disabled."

While this doesn't state that the descriptor list must remain accessible
to the device it certainly implies it must remaing readable by the device.

So switch to a dma coherent allocation for the descriptor list just to be
safe - it's not like the cost for it matters compared to the actual
memory buffers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 110ce3c2ba74 ("nvme-pci: implement host memory buffer support")
drivers/nvme/host/pci.c