]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-pci: Use PCI p2pmem subsystem to manage the CMB
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 4 Oct 2018 21:27:43 +0000 (15:27 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 17 Oct 2018 17:18:21 +0000 (12:18 -0500)
commit2e23650f56f41143da3a74127b454f67be178bcf
tree9f8640a038ba227ba7db1b7ccb0fe9cbf410a982
parenta3309f46472d0fb4b6b149909c0679fb7f0d6f47
nvme-pci: Use PCI p2pmem subsystem to manage the CMB

Register the CMB buffer as p2pmem and use the appropriate allocation
functions to create and destroy the IO submission queues.

If the CMB supports WDS and RDS, publish it for use as P2P memory by other
devices.

Kernels without CONFIG_PCI_P2PDMA will also no longer support NVMe CMB.
However, seeing the main use-cases for the CMB is P2P operations, this
seems like a reasonable dependency.

We drop the __iomem safety on the buffer seeing that, by convention, it's
safe to directly access memory mapped by memremap()/devm_memremap_pages().
Architectures where this is not safe will not be supported by memremap()
and therefore will not support PCI P2P and have no support for CMB.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c