From f78b05e239bee23f896354aed351aebbfab29978 Mon Sep 17 00:00:00 2001 From: "Chandrasekaran, Manishekar" Date: Mon, 7 Dec 2015 12:51:58 +0530 Subject: [PATCH] qcacld-3.0: Avoid taking lock for vfree API during driver load/unload This is qcacld-2.0 to qcacld-3.0 propagation Avoid invoking vfree inside spinlock during logging service activation and deactivation. Since vfree is prone to sleep, this disables the IRQs for duration longer than the acceptable limit. vfree can be done without spin lock here, as there is no synchronization issue in this scenario. CRs-Fixed: 914363 Change-Id: I4d69431a98a4e4301dfc1e2b3b4c40c408a7ef99 --- core/utils/logging/src/wlan_logging_sock_svc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/utils/logging/src/wlan_logging_sock_svc.c b/core/utils/logging/src/wlan_logging_sock_svc.c index 59033f384233..507b5847e939 100644 --- a/core/utils/logging/src/wlan_logging_sock_svc.c +++ b/core/utils/logging/src/wlan_logging_sock_svc.c @@ -701,10 +701,10 @@ int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf) pr_err("%s: Could not Create LogMsg Thread Controller", __func__); spin_lock_irqsave(&gwlan_logging.spin_lock, irq_flag); - vfree(gplog_msg); - gplog_msg = NULL; gwlan_logging.pcur_node = NULL; spin_unlock_irqrestore(&gwlan_logging.spin_lock, irq_flag); + vfree(gplog_msg); + gplog_msg = NULL; return -ENOMEM; } wake_up_process(gwlan_logging.thread); @@ -740,10 +740,10 @@ int wlan_logging_sock_deactivate_svc(void) wait_for_completion(&gwlan_logging.shutdown_comp); spin_lock_irqsave(&gwlan_logging.spin_lock, irq_flag); - vfree(gplog_msg); - gplog_msg = NULL; gwlan_logging.pcur_node = NULL; spin_unlock_irqrestore(&gwlan_logging.spin_lock, irq_flag); + vfree(gplog_msg); + gplog_msg = NULL; pr_info("%s: Deactivate wlan_logging svc\n", __func__);