Skip to content

Commit 014dbfe

Browse files
committed
Merge branch 'pci/virtualization'
- Add an ACS quirk for Loongson Root Ports that don't advertise ACS but don't allow peer-to-peer transactions between Root Ports; the quirk allows each Root Port to be in a separate IOMMU group (Huacai Chen) * pci/virtualization: PCI: Add ACS quirk for Loongson PCIe
2 parents df11586 + 1f3303a commit 014dbfe

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/pci/quirks.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4991,6 +4991,18 @@ static int pci_quirk_brcm_acs(struct pci_dev *dev, u16 acs_flags)
49914991
PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
49924992
}
49934993

4994+
static int pci_quirk_loongson_acs(struct pci_dev *dev, u16 acs_flags)
4995+
{
4996+
/*
4997+
* Loongson PCIe Root Ports don't advertise an ACS capability, but
4998+
* they do not allow peer-to-peer transactions between Root Ports.
4999+
* Allow each Root Port to be in a separate IOMMU group by masking
5000+
* SV/RR/CR/UF bits.
5001+
*/
5002+
return pci_acs_ctrl_enabled(acs_flags,
5003+
PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
5004+
}
5005+
49945006
/*
49955007
* Wangxun 40G/25G/10G/1G NICs have no ACS capability, but on
49965008
* multi-function devices, the hardware isolates the functions by
@@ -5124,6 +5136,17 @@ static const struct pci_dev_acs_enabled {
51245136
{ PCI_VENDOR_ID_BROADCOM, 0x1762, pci_quirk_mf_endpoint_acs },
51255137
{ PCI_VENDOR_ID_BROADCOM, 0x1763, pci_quirk_mf_endpoint_acs },
51265138
{ PCI_VENDOR_ID_BROADCOM, 0xD714, pci_quirk_brcm_acs },
5139+
/* Loongson PCIe Root Ports */
5140+
{ PCI_VENDOR_ID_LOONGSON, 0x3C09, pci_quirk_loongson_acs },
5141+
{ PCI_VENDOR_ID_LOONGSON, 0x3C19, pci_quirk_loongson_acs },
5142+
{ PCI_VENDOR_ID_LOONGSON, 0x3C29, pci_quirk_loongson_acs },
5143+
{ PCI_VENDOR_ID_LOONGSON, 0x7A09, pci_quirk_loongson_acs },
5144+
{ PCI_VENDOR_ID_LOONGSON, 0x7A19, pci_quirk_loongson_acs },
5145+
{ PCI_VENDOR_ID_LOONGSON, 0x7A29, pci_quirk_loongson_acs },
5146+
{ PCI_VENDOR_ID_LOONGSON, 0x7A39, pci_quirk_loongson_acs },
5147+
{ PCI_VENDOR_ID_LOONGSON, 0x7A49, pci_quirk_loongson_acs },
5148+
{ PCI_VENDOR_ID_LOONGSON, 0x7A59, pci_quirk_loongson_acs },
5149+
{ PCI_VENDOR_ID_LOONGSON, 0x7A69, pci_quirk_loongson_acs },
51275150
/* Amazon Annapurna Labs */
51285151
{ PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031, pci_quirk_al_acs },
51295152
/* Zhaoxin multi-function devices */

0 commit comments

Comments
 (0)