Skip to content

PCI: loongson: Fix supported link speeds for Loongson 3c19/3c29 PCIe devices proper dynamic speed negotiation. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,30 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quir

DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_HUAWEI, 0x1610, PCI_CLASS_BRIDGE_PCI, 8, quirk_pcie_mch);

/*
* Older steppings of the Loongson 3C6000 series incorrectly report the
* supported link speeds on their PCIe bridges (device IDs 3c19, 3c29) as
* only 2.5 GT/s, despite the upstream bus supporting speeds from 2.5 GT/s
* up to 16 GT/s.
*/
static void quirk_loongson_pci_bridge_supported_speeds(struct pci_dev *pdev)
{
switch (pdev->bus->max_bus_speed) {
case PCIE_SPEED_16_0GT:
pdev->supported_speeds |= PCI_EXP_LNKCAP2_SLS_16_0GB;
case PCIE_SPEED_8_0GT:
pdev->supported_speeds |= PCI_EXP_LNKCAP2_SLS_8_0GB;
case PCIE_SPEED_5_0GT:
pdev->supported_speeds |= PCI_EXP_LNKCAP2_SLS_5_0GB;
case PCIE_SPEED_2_5GT:
pdev->supported_speeds |= PCI_EXP_LNKCAP2_SLS_2_5GB;
default:
break;
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_LOONGSON, 0x3c19, quirk_loongson_secondary_bridge_supported_speeds);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_LOONGSON, 0x3c29, quirk_loongson_secondary_bridge_supported_speeds);

/*
* HiSilicon KunPeng920 and KunPeng930 have devices appear as PCI but are
* actually on the AMBA bus. These fake PCI devices can support SVA via
Expand Down