Commit 191b4101 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/virtualization'

- Avoid FLR for AMD FCH AHCI adapters to avoid a hardware defect (Damien Le
  Moal)

- Add ACS quirk for Wangxun NICs that don't allow peer-to-peer between
  functions, but don't advertise an ACS Capability (Mengyuan Lou)

* pci/virtualization:
  PCI: Add ACS quirk for Wangxun NICs
  PCI: Avoid FLR for AMD FCH AHCI adapters
parents ebdce9e3 a2b9b123
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -4835,6 +4835,26 @@ static int pci_quirk_brcm_acs(struct pci_dev *dev, u16 acs_flags)
		PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
}

/*
 * Wangxun 10G/1G NICs have no ACS capability, and on multi-function
 * devices, peer-to-peer transactions are not be used between the functions.
 * So add an ACS quirk for below devices to isolate functions.
 * SFxxx 1G NICs(em).
 * RP1000/RP2000 10G NICs(sp).
 */
static int  pci_quirk_wangxun_nic_acs(struct pci_dev *dev, u16 acs_flags)
{
	switch (dev->device) {
	case 0x0100 ... 0x010F:
	case 0x1001:
	case 0x2001:
		return pci_acs_ctrl_enabled(acs_flags,
			PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
	}

	return false;
}

static const struct pci_dev_acs_enabled {
	u16 vendor;
	u16 device;
@@ -4980,6 +5000,8 @@ static const struct pci_dev_acs_enabled {
	{ PCI_VENDOR_ID_NXP, 0x8d9b, pci_quirk_nxp_rp_acs },
	/* Zhaoxin Root/Downstream Ports */
	{ PCI_VENDOR_ID_ZHAOXIN, PCI_ANY_ID, pci_quirk_zhaoxin_pcie_ports_acs },
	/* Wangxun nics */
	{ PCI_VENDOR_ID_WANGXUN, PCI_ANY_ID, pci_quirk_wangxun_nic_acs },
	{ 0 }
};

@@ -5340,6 +5362,7 @@ static void quirk_no_flr(struct pci_dev *dev)
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x1487, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x148c, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x149c, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x7901, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_no_flr);

+2 −0
Original line number Diff line number Diff line
@@ -3012,6 +3012,8 @@
#define PCI_DEVICE_ID_INTEL_VMD_9A0B	0x9a0b
#define PCI_DEVICE_ID_INTEL_S21152BB	0xb152

#define PCI_VENDOR_ID_WANGXUN		0x8088

#define PCI_VENDOR_ID_SCALEMP		0x8686
#define PCI_DEVICE_ID_SCALEMP_VSMP_CTL	0x1010