summaryrefslogtreecommitdiff
path: root/drivers/pci/ats.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-02-06 14:17:38 +0000
committerLinus Torvalds <torvalds@linux-foundation.org>2020-02-06 14:17:38 +0000
commit9e6c535c64adf6155e4a11fe8d63b384fe3452f8 (patch)
tree883332728a374df76a7315309b66a0faa4cb49fc /drivers/pci/ats.c
parent750ce8ccd8a875ed9410fab01a3f468dab692eb4 (diff)
parent2e34673be0bd6bb0c6c496a861cbc3f7431e7ce3 (diff)
Merge tag 'pci-v5.6-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: - Define to_pci_sysdata() always to fix build breakage when !CONFIG_PCI (Jason A. Donenfeld) - Use PF PASID for VFs to fix VF IOMMU bind failures (Kuppuswamy Sathyanarayanan) * tag 'pci-v5.6-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI/ATS: Use PF PASID for VFs x86/PCI: Define to_pci_sysdata() even when !CONFIG_PCI
Diffstat (limited to 'drivers/pci/ats.c')
-rw-r--r--drivers/pci/ats.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
index dcbcf1331bb2..3ef0bb281e7c 100644
--- a/drivers/pci/ats.c
+++ b/drivers/pci/ats.c
@@ -426,11 +426,12 @@ void pci_restore_pasid_state(struct pci_dev *pdev)
int pci_pasid_features(struct pci_dev *pdev)
{
u16 supported;
- int pasid = pdev->pasid_cap;
+ int pasid;
if (pdev->is_virtfn)
pdev = pci_physfn(pdev);
+ pasid = pdev->pasid_cap;
if (!pasid)
return -EINVAL;
@@ -453,11 +454,12 @@ int pci_pasid_features(struct pci_dev *pdev)
int pci_max_pasids(struct pci_dev *pdev)
{
u16 supported;
- int pasid = pdev->pasid_cap;
+ int pasid;
if (pdev->is_virtfn)
pdev = pci_physfn(pdev);
+ pasid = pdev->pasid_cap;
if (!pasid)
return -EINVAL;