From 2a7bc9c287ba50e7dd21e7c4e2fd8fe9099ff035 Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Tue, 28 Sep 2021 14:31:41 -0700 Subject: [PATCH] qcacmn: Remove logic to enable/disable wake msi for drv systems Remove logic to enable/disable wake msi for drv systems. Today, during WoW suspend sequence, between hif pci bus suspend and hif pci bus suspend no irq, wake msi is getting disable temporarily. In case fw toggles wake msi during this period, then the wake msi is lost, which can lead to device not waking up for fw triggered wakeup. Add the fix to remove enable/disable wake msi from suspend/resume path and keep wake msi always enabled. Change-Id: Idad0805f66ead4079d67577fa1151f73567511a3 CRs-Fixed: 3042261 --- hif/src/dispatcher/multibus.c | 3 +-- hif/src/hif_main.c | 6 ++---- hif/src/pcie/if_pci.c | 5 +---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/hif/src/dispatcher/multibus.c b/hif/src/dispatcher/multibus.c index 49e880bf23f3..210d41d40b31 100644 --- a/hif/src/dispatcher/multibus.c +++ b/hif/src/dispatcher/multibus.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2018, 2020-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -477,7 +478,6 @@ int hif_apps_irqs_disable(struct hif_opaque_softc *hif_ctx) return -EINVAL; /* if the wake_irq is shared, don't disable it twice */ - disable_irq(scn->wake_irq); for (i = 0; i < scn->ce_count; ++i) { int irq = scn->bus_ops.hif_map_ce_to_irq(scn, i); @@ -499,7 +499,6 @@ int hif_apps_irqs_enable(struct hif_opaque_softc *hif_ctx) return -EINVAL; /* if the wake_irq is shared, don't enable it twice */ - enable_irq(scn->wake_irq); for (i = 0; i < scn->ce_count; ++i) { int irq = scn->bus_ops.hif_map_ce_to_irq(scn, i); diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 83ac8f2f749c..5ef1f3beafad 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -2047,10 +2047,8 @@ irqreturn_t hif_wake_interrupt_handler(int irq, void *context) hif_info("wake interrupt received on irq %d", irq); - if (hif_pm_runtime_get_monitor_wake_intr(hif_ctx)) { - hif_pm_runtime_set_monitor_wake_intr(hif_ctx, 0); - hif_pm_runtime_request_resume(hif_ctx); - } + hif_pm_runtime_set_monitor_wake_intr(hif_ctx, 0); + hif_pm_runtime_request_resume(hif_ctx); if (scn->initial_wakeup_cb) scn->initial_wakeup_cb(scn->initial_wakeup_priv); diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 4ad1e7ad3777..ee5f297e9789 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2403,8 +2404,6 @@ int hif_pci_bus_suspend_noirq(struct hif_softc *scn) if (hif_can_suspend_link(GET_HIF_OPAQUE_HDL(scn))) qdf_atomic_set(&scn->link_suspended, 1); - hif_apps_wake_irq_enable(GET_HIF_OPAQUE_HDL(scn)); - return 0; } @@ -2419,8 +2418,6 @@ int hif_pci_bus_suspend_noirq(struct hif_softc *scn) */ int hif_pci_bus_resume_noirq(struct hif_softc *scn) { - hif_apps_wake_irq_disable(GET_HIF_OPAQUE_HDL(scn)); - /* a vote for link up can come in the middle of the ongoing resume * process. hence, clear the link suspend flag once * hif_bus_resume_noirq() succeeds since PCIe link is already resumed