diff options
| author | Komal Seelam <kseelam@qti.qualcomm.com> | 2016-07-29 19:19:51 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-08-02 14:49:53 +0530 |
| commit | 429032c359a75cffce510262bb5bf3a502ac6b01 (patch) | |
| tree | 00fe6208ddf323054e2aea8b01c76b2fa9116f5d | |
| parent | 84ce8f5a2f55c397f62a3ab9c5f302ed9585ba78 (diff) | |
qcacld-2.0: Optimize the spinlock usage in suspend callback
1. Optimize the spinlock usage in suspend callback by keeping
target wakeup sequence outside the spinlock such that
spinlock is not held for longer time.
2. Remove duplicate target sleep call as anyway bus suspend callback
puts target into sleep before returning.
Change-Id: I08c3d1a72e0b6d3aadd590222130e33ee3db02b2
CRs-Fixed: 1048112
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/if_pci.c | 17 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 4 |
2 files changed, 8 insertions, 13 deletions
diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c index 086ee60325ba..17e99b14996a 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.c +++ b/CORE/SERVICES/HIF/PCIe/if_pci.c @@ -2723,18 +2723,18 @@ __hif_pci_suspend(struct pci_dev *pdev, pm_message_t state, bool runtime_pm) } pr_debug("%s: Suspend completes (D0WOW)\n", __func__); + HIFCancelDeferredTargetSleep(sc->hif_device); ret = 0; goto out; } #endif - adf_os_spin_lock_irqsave(&hif_state->suspend_lock); - - /*Disable PCIe interrupts*/ - if (HIFTargetSleepStateAdjust(targid, FALSE, TRUE) < 0) { - adf_os_spin_unlock_irqrestore(&hif_state->suspend_lock); + /* Wakeup ROME to disable PCIe interrupts */ + if (HIFTargetSleepStateAdjust(targid, FALSE, TRUE) < 0) goto out; - } + + /* Acquire lock to access shared register */ + adf_os_spin_lock_irqsave(&hif_state->suspend_lock); A_PCI_WRITE32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_ENABLE_ADDRESS), 0); A_PCI_WRITE32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_CLR_ADDRESS), PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL); @@ -2747,17 +2747,16 @@ __hif_pci_suspend(struct pci_dev *pdev, pm_message_t state, bool runtime_pm) hif_irq_record(HIF_SUSPEND_END, sc); + /* Put ROME to sleep */ if (HIFTargetSleepStateAdjust(targid, TRUE, FALSE) < 0) { adf_os_spin_unlock_irqrestore(&hif_state->suspend_lock); goto out; } - /* Stop the HIF Sleep Timer */ HIFCancelDeferredTargetSleep(sc->hif_device); adf_os_atomic_set(&sc->pci_link_suspended, 1); - - adf_os_spin_unlock_irqrestore( &hif_state->suspend_lock); + adf_os_spin_unlock_irqrestore(&hif_state->suspend_lock); /* Keep PCIe bus driver's shadow memory intact */ vos_pcie_shadow_control(pdev, FALSE); diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index bc2be814822f..c66ddff4cc1e 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -22377,8 +22377,6 @@ int wma_enable_wow_in_fw(WMA_HANDLE handle, int runtime_pm) return VOS_STATUS_E_FAULT; } - HTCCancelDeferredTargetSleep(scn); - wma->wow.wow_enable_cmd_sent = TRUE; return VOS_STATUS_SUCCESS; @@ -34879,8 +34877,6 @@ int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr) return -1; } - HTCCancelDeferredTargetSleep(scn); - return 0; } |
