]> git.ipfire.org Git - thirdparty/linux.git/commit - include/linux/pci.h
PCI: Add pci_enable_atomic_ops_to_root()
authorJay Cornwall <Jay.Cornwall@amd.com>
Fri, 5 Jan 2018 00:44:59 +0000 (19:44 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 23 Jan 2018 20:46:50 +0000 (14:46 -0600)
commit430a23689dea2e36ae5a0fc75a67301fd46b18bf
tree9e69138e3790ea06d9f1d6711364c35e0cb41ee1
parentd57f0b8c81393e7105331ac037fa465d5a45c65f
PCI: Add pci_enable_atomic_ops_to_root()

The Atomic Operations feature (PCIe r4.0, sec 6.15) allows atomic
transctions to be requested by, routed through and completed by PCIe
components. Routing and completion do not require software support.
Component support for each is detectable via the DEVCAP2 register.

A Requester may use AtomicOps only if its PCI_EXP_DEVCTL2_ATOMIC_REQ is
set. This should be set only if the Completer and all intermediate routing
elements support AtomicOps.

A concrete example is the AMD Fiji-class GPU (which is capable of making
AtomicOp requests), below a PLX 8747 switch (advertising AtomicOp routing)
with a Haswell host bridge (advertising AtomicOp completion support).

Add pci_enable_atomic_ops_to_root() for per-device control over AtomicOp
requests. This checks to be sure the Root Port supports completion of the
desired AtomicOp sizes and the path to the Root Port supports routing the
AtomicOps.

Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
[bhelgaas: changelog, comments, whitespace]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c
include/linux/pci.h
include/uapi/linux/pci_regs.h