From 5472b65b067704a7507efbf526dcf7561bf9f003 Mon Sep 17 00:00:00 2001 From: Patrick Talbert Date: Wed, 6 Feb 2019 16:48:55 +0100 Subject: [PATCH 1/1] PCI: Add ASPM quirk for Realtek RTS5209 PCI Express Card Reader --- drivers/pci/quirks.c | 15 +++++++++++++++ include/linux/pci_ids.h | 1 + 2 files changed, 16 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index b0a413f..7d39aba 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -5117,3 +5117,18 @@ static void quirk_switchtec_ntb_dma_alias(struct pci_dev *pdev) SWITCHTEC_QUIRK(0x8574); /* PFXI 64XG3 */ SWITCHTEC_QUIRK(0x8575); /* PFXI 80XG3 */ SWITCHTEC_QUIRK(0x8576); /* PFXI 96XG3 */ + +/* + * A Realtek RTS5209 PCI Express Card Reader does not initialize itself + * properly if PCIE ASPM is disabled but we might have turned it off because + * of it was indicated by acpi_gbl_FADT.boot_flags. So in this case flip it + * back on. + */ +static void quirk_realtek_rts(struct pci_dev *dev) +{ + if ((acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) && aspm_disabled) { + /* Turn it back on! */ + aspm_disabled = 0; + } +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_RTS5209, quirk_realtek_rts); diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 5eaf39d..3d24a6f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1353,6 +1353,7 @@ #define PCI_VENDOR_ID_REALTEK 0x10ec #define PCI_DEVICE_ID_REALTEK_8139 0x8139 +#define PCI_DEVICE_ID_REALTEK_RTS5209 0x5209 #define PCI_VENDOR_ID_XILINX 0x10ee #define PCI_DEVICE_ID_RME_DIGI96 0x3fc0 -- 1.8.3.1