From 736d8b150f8611af0c4d0bdf6b3273a7a0e2b1c2 Mon Sep 17 00:00:00 2001 From: Reza Arbab Date: Wed, 1 Aug 2018 15:01:18 -0500 Subject: npu2: Add support for relaxed-ordering mode Some device drivers support out of order access to GPU memory. This does not affect the CPU view of memory but it does affect the GPU view of memory. It should only be enabled if the GPU driver has requested it. Add OPAL APIs allowing the driver to query relaxed ordering state or request it to be set for a device. Current hardware only allows relaxed ordering to be enabled per PCIe root port. So the code here doesn't enable relaxed ordering until it has been explicitly requested for every device on the port. Signed-off-by: Alistair Popple [arbab@linux.ibm.com: Rebase/refactor original changes] Signed-off-by: Reza Arbab Reviewed-By: Alistair Popple Signed-off-by: Stewart Smith --- include/pci.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/pci.h') diff --git a/include/pci.h b/include/pci.h index c6aa664..0516561 100644 --- a/include/pci.h +++ b/include/pci.h @@ -111,6 +111,14 @@ struct pci_device { uint32_t pcrf_end; struct list_head pcrf; + /* + * Relaxed ordering is a feature which allows PCIe devices accessing GPU + * memory to bypass the normal PCIe ordering rules to increase + * performance. It is enabled on a per-PEC basis so every device on a + * PEC must support it before we can enable it. + */ + bool allow_relaxed_ordering; + struct dt_node *dn; struct pci_slot *slot; struct pci_device *parent; -- cgit v1.1