PCI/P2PDMA: Allow P2P DMA between any devices under AMD ZEN Root Complex
authorChristian König <ckoenig.leichtzumerken@gmail.com>
Thu, 18 Apr 2019 11:58:59 +0000 (13:58 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 1 May 2019 21:53:39 +0000 (16:53 -0500)
commit0f97da83102610db886e8b688b9029e080e6d511
treef76f4b8095249e8266ca231ff82c5aceaa530477
parent9e98c678c2d6ae3a17cb2de55d17f69dddaa231b
PCI/P2PDMA: Allow P2P DMA between any devices under AMD ZEN Root Complex

The PCI specs say that peer-to-peer DMA should be supported between any two
devices that have a common upstream PCI-to-PCI bridge.  But devices under
different Root Ports don't share a common upstream bridge, and PCIe r4.0,
sec 1.3.1, says routing peer-to-peer transactions between Root Ports in the
same Root Complex is optional.

Many Root Complexes, including AMD ZEN, *do* support peer-to-peer DMA even
between Root Ports.  Add a whitelist and allow peer-to-peer DMA if both
participants are attached to a Root Complex known to support it.

Link: https://lore.kernel.org/linux-pci/20190418115859.2394-1-christian.koenig@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
drivers/pci/p2pdma.c