From 20a3868ffc846db2d434f5ee2ea0bcc14eff39fd Mon Sep 17 00:00:00 2001 From: Jianmin Lv Date: Mon, 5 Sep 2022 17:26:21 +0800 Subject: [PATCH] pci/quirks: ls7a2000: fix pm transition of devices under pcie port LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I6BWFP -------------------------------- Signed-off-by: Jianmin Lv Change-Id: Ie2c78cc46aa7bde00395906f7e6ab6a09e09a190 (cherry picked from commit d6ac51fcf32e8cc70cbc9a7e61b65d0a10d54cbb) --- drivers/pci/controller/pci-loongson.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/controller/pci-loongson.c b/drivers/pci/controller/pci-loongson.c index 2777b9c0ed1d..24441c1cf02c 100644 --- a/drivers/pci/controller/pci-loongson.c +++ b/drivers/pci/controller/pci-loongson.c @@ -19,6 +19,12 @@ #define DEV_PCIE_PORT_1 0x7a19 #define DEV_PCIE_PORT_2 0x7a29 +#define DEV_PCIE_PORT_4 0x7a39 +#define DEV_PCIE_PORT_5 0x7a49 +#define DEV_PCIE_PORT_6 0x7a59 +#define DEV_PCIE_PORT_7 0x7a69 + + #define DEV_LS2K_APB 0x7a02 #define DEV_LS7A_GMAC 0x7a03 #define DEV_LS7A_DC1 0x7a06 @@ -76,6 +82,20 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_LOONGSON, DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_LOONGSON, DEV_LS7A_LPC, system_bus_quirk); +static void loongson_d3_quirk(struct pci_dev *pdev) +{ + pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3; + pdev->no_d1d2 = 1; +} +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_LOONGSON, + DEV_PCIE_PORT_4, loongson_d3_quirk); +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_LOONGSON, + DEV_PCIE_PORT_5, loongson_d3_quirk); +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_LOONGSON, + DEV_PCIE_PORT_6, loongson_d3_quirk); +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_LOONGSON, + DEV_PCIE_PORT_7, loongson_d3_quirk); + static void loongson_mrrs_quirk(struct pci_dev *pdev) { /* -- GitLab