From c89d4e16c8f5846b218975d85405bb0d4d973a65 Mon Sep 17 00:00:00 2001 From: Subramanian Ananthanarayanan Date: Wed, 20 Oct 2021 21:04:38 +0530 Subject: [PATCH 1/2] pci:msm: Implement SUSPEND LATE for switch support Changes are to save and restore PCI switch config space as part of suspend late using framework support. Framework does save and resore post suspend and prior to suspend late, hence this change is important for switch. Change-Id: I1aa06ad43d647fb8deb8cf15903c91d43344553c Signed-off-by: Subramanian Ananthanarayanan --- drivers/pci/controller/pci-msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-msm.c b/drivers/pci/controller/pci-msm.c index 6dfd62249124..700907277641 100644 --- a/drivers/pci/controller/pci-msm.c +++ b/drivers/pci/controller/pci-msm.c @@ -7392,7 +7392,7 @@ static void msm_pcie_fixup_suspend(struct pci_dev *dev) mutex_unlock(&pcie_dev->recovery_lock); } -DECLARE_PCI_FIXUP_SUSPEND(PCIE_VENDOR_ID_QCOM, PCI_ANY_ID, +DECLARE_PCI_FIXUP_SUSPEND_LATE(PCIE_VENDOR_ID_QCOM, PCI_ANY_ID, msm_pcie_fixup_suspend); /* Resume the PCIe link */ From 873b6ae5f4028a768d58e8bc7c8ba80deff40cd4 Mon Sep 17 00:00:00 2001 From: Subramanian Ananthanarayanan Date: Wed, 20 Oct 2021 08:23:05 -0700 Subject: [PATCH 2/2] Revert "pci:switch: Implement PM ops for QPS615 support" This reverts commit f9c8d6dd2b57864c84011842b898f842b3054965. Change-Id: I98da9ef48ce30cb0363025c14a72564c29e47861 Signed-off-by: Subramanian Ananthanarayanan --- drivers/pci/switch/switch-qcom.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/drivers/pci/switch/switch-qcom.c b/drivers/pci/switch/switch-qcom.c index a15933db5fd3..58873051d210 100644 --- a/drivers/pci/switch/switch-qcom.c +++ b/drivers/pci/switch/switch-qcom.c @@ -15,8 +15,6 @@ #define DIODE_VENDOR_ID 0x12d8 #define DIODE_DEVICE_ID 0xb304 -#define NTN3_VENDOR_ID PCI_VENDOR_ID_TOSHIBA -#define NTN3_DEVICE_ID 0x0623 /* * @DIODE_ERRATA_0: Apply errata specific to the upstream port (USP). @@ -258,9 +256,6 @@ static struct pci_device_id switch_qcom_pci_tbl[] = { { PCI_DEVICE(DIODE_VENDOR_ID, DIODE_DEVICE_ID), }, - { - PCI_DEVICE(NTN3_VENDOR_ID, NTN3_DEVICE_ID), - }, {0}, }; MODULE_DEVICE_TABLE(pci, switch_qcom_pci_tbl); @@ -319,33 +314,11 @@ static int switch_qcom_pci_probe(struct pci_dev *pdev, return 0; } -static int switch_qcom_pci_suspend(struct device *dev) -{ - struct pci_dev *pdev = to_pci_dev(dev); - - pci_save_state(pdev); - pci_set_power_state(pdev, PCI_D3hot); - - return 0; -} -static int switch_qcom_pci_resume(struct device *dev) -{ - struct pci_dev *pdev = to_pci_dev(dev); - - pci_set_power_state(pdev, PCI_D0); - pci_restore_state(pdev); - - return 0; -} -const struct dev_pm_ops switch_qcom_pci_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(switch_qcom_pci_suspend, switch_qcom_pci_resume) -}; static struct pci_driver switch_qcom_pci_driver = { .name = "pcie-qcom-switch", .id_table = switch_qcom_pci_tbl, .probe = switch_qcom_pci_probe, .remove = switch_qcom_pci_remove, - .driver.pm = &switch_qcom_pci_pm_ops, }; static int __init switch_qcom_pci_init(void)