From e740517a7be14c0355c084a2b648b06daf28b08a Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Mon, 20 Jun 2016 15:21:33 +0530 Subject: [PATCH] qcacld-3.0: Do not call pr_info while using spin_lock_irqsave qcacld-2.0 to qcacld-3.0 propagation wlan_queue_logmsg_for_app is called while holding spin lock with interrupts disabled. It may call pr_info to log if node is dropped while sending to user space. This may cause interrupts disabled for some time. As part of fix remove all pr_info from wlan_queue_logmsg_for_app. Change-Id: Iffa5d463ae4e807bb30ff6eec5f3949735663fd5 CRs-Fixed: 1005714 --- .../utils/logging/src/wlan_logging_sock_svc.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/core/utils/logging/src/wlan_logging_sock_svc.c b/core/utils/logging/src/wlan_logging_sock_svc.c index b11a6ca38357..aedbd3dd3ce6 100644 --- a/core/utils/logging/src/wlan_logging_sock_svc.c +++ b/core/utils/logging/src/wlan_logging_sock_svc.c @@ -233,15 +233,6 @@ static int wlan_queue_logmsg_for_app(void) gwlan_logging.pcur_node = (struct log_msg *)(gwlan_logging.filled_list.next); ++gwlan_logging.drop_count; - /* print every 64th drop count */ - if (cds_is_multicast_logging() && - (!(gwlan_logging.drop_count % 0x40))) { - pr_info - ("%s: drop_count = %u index = %d filled_length = %d\n", - __func__, gwlan_logging.drop_count, - gwlan_logging.pcur_node->index, - gwlan_logging.pcur_node->filled_length); - } list_del_init(gwlan_logging.filled_list.next); ret = 1; } @@ -315,6 +306,7 @@ int wlan_log_to_user(QDF_TRACE_LEVEL log_level, char *to_be_sent, int length) unsigned long flags; uint64_t ts; int radio; + bool log_overflow = false; radio = cds_get_radio_index(); @@ -369,13 +361,11 @@ int wlan_log_to_user(QDF_TRACE_LEVEL log_level, char *to_be_sent, int length) /* Assumption here is that we receive logs which is always less than * MAX_LOGMSG_LENGTH, where we can accomodate the * tAniNlHdr + [context][timestamp] + log - * QDF_ASSERT if we cannot accomodate the the complete log into - * the available buffer. * * Continue and copy logs to the available length and discard the rest. */ if (MAX_LOGMSG_LENGTH < (sizeof(tAniNlHdr) + total_log_len)) { - QDF_ASSERT(0); + log_overflow = true; total_log_len = MAX_LOGMSG_LENGTH - sizeof(tAniNlHdr) - 2; } @@ -387,6 +377,11 @@ int wlan_log_to_user(QDF_TRACE_LEVEL log_level, char *to_be_sent, int length) *pfilled_length += 1; spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); + /* + * QDF_ASSERT if complete log was not accomodated into + * the available buffer. + */ + QDF_ASSERT(!log_overflow); /* Wakeup logger thread */ if ((true == wake_up_thread)) {