Explorar o código

qcacld-3.0: Avoid all module logging onto kmsg during driver load

This is qcacld-2.0 to qcacld-3.0 propagation

Avoid logging of all module logs into kmsg during the driver load
phase. All module log level is set much before setting of the
flag that indicates whether multicast logging is enabled or not.
Because of this all module log levels are getting printed for a
brief duration in kmsg during driver load. Fix the same by
setting the multicast flag appropriately so that when multicast
logging is enabled, all the logs are multicast to user space
and only the error and fatal messages continue to get logged in
the kmsg.

CRs-Fixed: 958705
Change-Id: I260e38ef64f704dfd9ca1ca4dc68c56428526559
Chandrasekaran, Manishekar %!s(int64=9) %!d(string=hai) anos
pai
achega
dc3231b00d
Modificáronse 1 ficheiros con 34 adicións e 12 borrados
  1. 34 12
      core/hdd/src/wlan_hdd_main.c

+ 34 - 12
core/hdd/src/wlan_hdd_main.c

@@ -4921,6 +4921,34 @@ static CDF_STATUS wlan_hdd_disable_all_dual_mac_features(hdd_context_t *hdd_ctx)
 	return CDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
+/**
+ * wlan_hdd_logging_sock_activate_svc() - Activate logging
+ * @hdd_ctx: HDD context
+ *
+ * Activates the logging service
+ *
+ * Return: Zero in case of success, negative value otherwise
+ */
+static int wlan_hdd_logging_sock_activate_svc(hdd_context_t *hdd_ctx)
+{
+	if (hdd_ctx->config->wlanLoggingEnable) {
+		if (wlan_logging_sock_activate_svc(
+				hdd_ctx->config->wlanLoggingFEToConsole,
+				hdd_ctx->config->wlanLoggingNumBuf)) {
+			hdd_err("wlan_logging_sock_activate_svc failed");
+			return -EINVAL;
+		}
+	}
+	return 0;
+}
+#else
+static inline int wlan_hdd_logging_sock_activate_svc(hdd_context_t *hdd_ctx)
+{
+	return 0;
+}
+#endif
+
 /**
  * hdd_wlan_startup() - HDD init function
  * @dev:	Pointer to the underlying device
@@ -5082,10 +5110,15 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
 		hdd_ctx->fw_log_settings.dl_mod_loglevel[i] = 0;
 	}
 
+	cds_set_multicast_logging(hdd_ctx->config->multicast_host_fw_msgs);
+
+	if (wlan_hdd_logging_sock_activate_svc(hdd_ctx) < 0)
+		goto err_config;
+
 	/*
 	 * Update CDF trace levels based upon the code
 	 */
-	if (hdd_ctx->config->multicast_host_fw_msgs)
+	if (cds_is_multicast_logging())
 		wlan_logging_set_log_level();
 
 	/*
@@ -5469,17 +5502,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
 		       FL("cnss_diag_activate_service failed"));
 		goto err_nl_srv;
 	}
-#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-	if (hdd_ctx->config->wlanLoggingEnable) {
-		if (wlan_logging_sock_activate_svc
-			    (hdd_ctx->config->wlanLoggingFEToConsole,
-			    hdd_ctx->config->wlanLoggingNumBuf)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("wlan_logging_sock_activate_svc failed"));
-			goto err_nl_srv;
-		}
-	}
-#endif
 
 	/*
 	 * Action frame registered in one adapter which will