Skip to content

Commit 6585a1a

Browse files
committed
Merge branch 'pci/virtualization'
- Remove redundant variable init in xen (Colin Ian King) - Add pci_pri_supported() to check device or associated PF for PRI support (Ashok Raj) - Mark AMD Navi10 GPU rev 0x00 ATS as broken (Kai-Heng Feng) - Release IVRS table in AMD ACS quirk (Hanjun Guo) * pci/virtualization: PCI: Release IVRS table in AMD ACS quirk PCI: Mark AMD Navi10 GPU rev 0x00 ATS as broken PCI/ATS: Add pci_pri_supported() to check device or associated PF xen: Remove redundant initialization of irq
2 parents 4f7adb6 + 090688f commit 6585a1a

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

arch/x86/pci/xen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev)
6262
#ifdef CONFIG_ACPI
6363
static int xen_register_pirq(u32 gsi, int triggering, bool set_pirq)
6464
{
65-
int rc, pirq = -1, irq = -1;
65+
int rc, pirq = -1, irq;
6666
struct physdev_map_pirq map_irq;
6767
int shareable = 0;
6868
char *name;

drivers/iommu/intel/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
25542554
}
25552555

25562556
if (info->ats_supported && ecap_prs(iommu->ecap) &&
2557-
pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI))
2557+
pci_pri_supported(pdev))
25582558
info->pri_supported = 1;
25592559
}
25602560
}

drivers/pci/ats.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,21 @@ int pci_prg_resp_pasid_required(struct pci_dev *pdev)
325325

326326
return pdev->pasid_required;
327327
}
328+
329+
/**
330+
* pci_pri_supported - Check if PRI is supported.
331+
* @pdev: PCI device structure
332+
*
333+
* Returns true if PRI capability is present, false otherwise.
334+
*/
335+
bool pci_pri_supported(struct pci_dev *pdev)
336+
{
337+
/* VFs share the PF PRI */
338+
if (pci_physfn(pdev)->pri_cap)
339+
return true;
340+
return false;
341+
}
342+
EXPORT_SYMBOL_GPL(pci_pri_supported);
328343
#endif /* CONFIG_PCI_PRI */
329344

330345
#ifdef CONFIG_PCI_PASID

drivers/pci/quirks.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4409,6 +4409,8 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)
44094409
if (ACPI_FAILURE(status))
44104410
return -ENODEV;
44114411

4412+
acpi_put_table(header);
4413+
44124414
/* Filter out flags not applicable to multifunction */
44134415
acs_flags &= (PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_EC | PCI_ACS_DT);
44144416

@@ -5192,7 +5194,8 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0422, quirk_no_ext_tags);
51925194
*/
51935195
static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
51945196
{
5195-
if (pdev->device == 0x7340 && pdev->revision != 0xc5)
5197+
if ((pdev->device == 0x7312 && pdev->revision != 0x00) ||
5198+
(pdev->device == 0x7340 && pdev->revision != 0xc5))
51965199
return;
51975200

51985201
pci_info(pdev, "disabling ATS\n");
@@ -5203,6 +5206,8 @@ static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
52035206
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x98e4, quirk_amd_harvest_no_ats);
52045207
/* AMD Iceland dGPU */
52055208
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x6900, quirk_amd_harvest_no_ats);
5209+
/* AMD Navi10 dGPU */
5210+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7312, quirk_amd_harvest_no_ats);
52065211
/* AMD Navi14 dGPU */
52075212
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7340, quirk_amd_harvest_no_ats);
52085213
#endif /* CONFIG_PCI_ATS */

include/linux/pci-ats.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
2828
void pci_disable_pri(struct pci_dev *pdev);
2929
int pci_reset_pri(struct pci_dev *pdev);
3030
int pci_prg_resp_pasid_required(struct pci_dev *pdev);
31+
bool pci_pri_supported(struct pci_dev *pdev);
32+
#else
33+
static inline bool pci_pri_supported(struct pci_dev *pdev)
34+
{ return false; }
3135
#endif /* CONFIG_PCI_PRI */
3236

3337
#ifdef CONFIG_PCI_PASID

0 commit comments

Comments
 (0)