From eaecb5470660c1a2ca5c970d2945bd448eaf672e Mon Sep 17 00:00:00 2001 From: Subramanian Ananthanarayanan Date: Tue, 25 Jul 2023 03:32:15 -0700 Subject: [PATCH] PCI: Configure RC MPS to 128 for Realtek 8168 attach Change is to configure QC RC MPS 128 bytes as 8168 device only supports 128 bytes. Without this quirk, since RC is using pcie_bus_perf flag MPS is configured to 256 bytes, when EP MRRS is changed to 4096 bytes RC is responding with packets of 256 bytes causing functionality break. Since pcie_bus_perf is used for many products, this change provies a provision to configure RC to 128 bytes for realtek 8168 attach alone. Change-Id: I4a82293e4f71bf188d4f0f2be8fa194c5ab007c2 Signed-off-by: Subramanian Ananthanarayanan --- drivers/pci/quirks.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index f8f37f09ab4d..974a6be26fbd 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2415,6 +2415,20 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, quirk_nvidia_ck804_pcie_aer_ext_cap); +/* + * Quirk to limit QCOM RC MPS to 128 in case of Realtek 8168 + * attaches. + */ +static void quirk_realtek_rc_mpss_limit(struct pci_dev *pdev) +{ + struct pci_dev *root_port = pcie_find_root_port(pdev); + + if (root_port->vendor == PCI_VENDOR_ID_QCOM) + pcie_set_mps(root_port, 128); +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REALTEK, 0x8168, + quirk_realtek_rc_mpss_limit); + static void quirk_via_cx700_pci_parking_caching(struct pci_dev *dev) { /*