From da4fb2ad20d2af7b1c6ec4b8fe3ad4fe8c9c0210 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 19 Nov 2018 12:08:38 -0800 Subject: [PATCH] qcacmn: Avoid marking MSI as wakeable On MSM platforms, MSI vectors are always wakeable, so calling enable_irq_wake() on an MSI vector interrupt line is a no-op. Additionally, on some product lines, this call will fail. This causes suspend to fail despite the MSI already being wakeable. Simply avoid marking the wake MSI as wakeable during suspend as a work around. Change-Id: I32b2b4fb231681ad29b4e98b2410d0eb6e68c671 CRs-Fixed: 2357784 --- hif/src/pcie/if_pci.c | 52 ++++--------------------------------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index b4431e01a47e..d8134a14c013 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -2528,33 +2528,14 @@ void hif_pci_prevent_linkdown(struct hif_softc *scn, bool flag) } #endif -static int hif_mark_wake_irq_wakeable(struct hif_softc *scn) -{ - int errno; - - errno = enable_irq_wake(scn->wake_irq); - if (errno) { - HIF_ERROR("%s: Failed to mark wake IRQ: %d", __func__, errno); - return errno; - } - - return 0; -} - /** * hif_pci_bus_suspend(): prepare hif for suspend * - * Enables pci bus wake irq based on link suspend voting. - * - * Return: 0 for success and non-zero error code for failure + * Return: Errno */ int hif_pci_bus_suspend(struct hif_softc *scn) { - if (hif_can_suspend_link(GET_HIF_OPAQUE_HDL(scn))) - return 0; - - /* pci link is staying up; enable wake irq */ - return hif_mark_wake_irq_wakeable(scn); + return 0; } /** @@ -2596,39 +2577,14 @@ static int __hif_check_link_status(struct hif_softc *scn) return -EACCES; } -static int hif_unmark_wake_irq_wakeable(struct hif_softc *scn) -{ - int errno; - - errno = disable_irq_wake(scn->wake_irq); - if (errno) { - HIF_ERROR("%s: Failed to unmark wake IRQ: %d", __func__, errno); - return errno; - } - - return 0; -} - /** * hif_pci_bus_resume(): prepare hif for resume * - * Disables pci bus wake irq based on link suspend voting. - * - * Return: 0 for success and non-zero error code for failure + * Return: Errno */ int hif_pci_bus_resume(struct hif_softc *scn) { - int ret; - - ret = __hif_check_link_status(scn); - if (ret) - return ret; - - if (hif_can_suspend_link(GET_HIF_OPAQUE_HDL(scn))) - return 0; - - /* pci link is up; disable wake irq */ - return hif_unmark_wake_irq_wakeable(scn); + return __hif_check_link_status(scn); } /**