From 74e4dd0fd61f8f779f25659ff8b6c09dd0d22043 Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Tue, 3 Sep 2019 12:07:30 -0700 Subject: [PATCH] qcacld-3.0: Change spin lock APIs to use spin lock IRQ The spin lock APIs are accessed from wake MSI hard irq handler as well, causing deadlock. To solve this, change spin lock APIs to use spin lock IRQ. CRs-Fixed: 2519986 Change-Id: I4d05abd294a71a26915210ae7e2be9be6aa7a996 --- components/pmo/core/inc/wlan_pmo_wow.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/pmo/core/inc/wlan_pmo_wow.h b/components/pmo/core/inc/wlan_pmo_wow.h index 32cd76422770..d56b3d4485b8 100644 --- a/components/pmo/core/inc/wlan_pmo_wow.h +++ b/components/pmo/core/inc/wlan_pmo_wow.h @@ -494,9 +494,12 @@ static inline void pmo_core_update_wow_initial_wake_up(struct pmo_psoc_priv_obj *psoc_ctx, bool value) { - qdf_spin_lock_bh(&psoc_ctx->lock); + /* Intentionally using irq save since initial wake flag is updated + * from wake msi hard irq handler + */ + qdf_spin_lock_irqsave(&psoc_ctx->lock); psoc_ctx->wow.wow_initial_wake_up = value; - qdf_spin_unlock_bh(&psoc_ctx->lock); + qdf_spin_unlock_irqrestore(&psoc_ctx->lock); } /** @@ -510,9 +513,12 @@ bool pmo_core_get_wow_initial_wake_up(struct pmo_psoc_priv_obj *psoc_ctx) { bool value; - qdf_spin_lock_bh(&psoc_ctx->lock); + /* Intentionally using irq save since initial wake flag is updated + * from wake msi hard irq handler + */ + qdf_spin_lock_irqsave(&psoc_ctx->lock); value = psoc_ctx->wow.wow_initial_wake_up; - qdf_spin_unlock_bh(&psoc_ctx->lock); + qdf_spin_unlock_irqrestore(&psoc_ctx->lock); return value; }