Skip to content

Commit 5a10bb0

Browse files
P33Mpopcornmix
authored andcommitted
PCI: quirks: work around VL805 firmware ASPM meddling
Certain versions of the VL805 firmware manipulate the endpoint Link Control register to toggle ASPM on/off based on workload, but these versions also report 0 in the Device Capability Acceptable Latency field leaving the RC with ASPM disabled. As it turns out, this EP has a broken L0s implementation so a) override L1 latency to a sensible value and b) mask L0s. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
1 parent 0829549 commit 5a10bb0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/pci/quirks.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6225,6 +6225,22 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56b0, aspm_l1_acceptable_latency
62256225
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56b1, aspm_l1_acceptable_latency);
62266226
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56c0, aspm_l1_acceptable_latency);
62276227
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56c1, aspm_l1_acceptable_latency);
6228+
6229+
/*
6230+
* VL805 firmware can report 0 in the L0s/L1 Acceptable Latency fields.
6231+
* This is shorter than its own exit latency so ASPM for the link partner
6232+
* never gets enabled (but firmware toggles EP L1/L0s enable internally).
6233+
* However, L0s is flaky so explicitly disable it.
6234+
*/
6235+
static void vl805_aspm_fixup(struct pci_dev *dev)
6236+
{
6237+
dev->devcap &= ~PCI_EXP_DEVCAP_L1;
6238+
/* Set to own exit latency + 1 */
6239+
dev->devcap |= FIELD_PREP(PCI_EXP_DEVCAP_L1, 5);
6240+
pci_disable_link_state(dev, PCIE_LINK_STATE_L0S);
6241+
pci_info(dev, "ASPM: VL805 fixup applied\n");
6242+
}
6243+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, 0x3483, vl805_aspm_fixup);
62286244
#endif
62296245

62306246
#ifdef CONFIG_PCIE_DPC

0 commit comments

Comments
 (0)