From 49dc5834ad14bacbdcd08a8d50c802c1e8a8ca3a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brucker Date: Sat, 29 May 2021 07:03:13 +0000 Subject: [PATCH] PCI/ATS: Add PRI stubs maillist inclusion category: feature bugzilla: 51855 CVE: NA Reference: https://jpbrucker.net/git/linux/commit/?h=sva/2021-03-01&id=f61a8d9eceb10611c5f0bb151ad3dbc754bc6467 --------------------------------------------- The SMMUv3 driver, which can be built without CONFIG_PCI, will soon gain support for PRI. Partially revert commit c6e9aefbf9db ("PCI/ATS: Remove unused PRI and PASID stubs") to re-introduce the PRI stubs, and avoid adding more #ifdefs to the SMMU driver. Acked-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Jean-Philippe Brucker Signed-off-by: Lijun Fang Reviewed-by: Weilong Chen Signed-off-by: Zheng Zengkai --- include/linux/pci-ats.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index df54cd5b15db..ccfca09fd232 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h @@ -30,6 +30,13 @@ int pci_reset_pri(struct pci_dev *pdev); int pci_prg_resp_pasid_required(struct pci_dev *pdev); bool pci_pri_supported(struct pci_dev *pdev); #else +static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs) +{ return -ENODEV; } +static inline void pci_disable_pri(struct pci_dev *pdev) { } +static inline int pci_reset_pri(struct pci_dev *pdev) +{ return -ENODEV; } +static inline int pci_prg_resp_pasid_required(struct pci_dev *pdev) +{ return 0; } static inline bool pci_pri_supported(struct pci_dev *pdev) { return false; } #endif /* CONFIG_PCI_PRI */ -- GitLab