Browse Source

qcacld-3.0: Reduce excessive logging during suspend

There are several logs along the suspend/resume code paths that log
debugging related information at the INFO level. Reduce the logging
level of these debug logs to avoid spamming the console.

Change-Id: I0e81901e4a053038392c1012600ae125a1ad27a3
CRs-Fixed: 2258093
Dustin Brown 6 years ago
parent
commit
c1cdb710bf

+ 11 - 8
components/pmo/core/src/wlan_pmo_arp.c

@@ -102,8 +102,10 @@ static QDF_STATUS pmo_core_flush_arp_from_vdev_priv(
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS pmo_core_do_enable_arp_offload(struct wlan_objmgr_vdev *vdev,
-		uint8_t vdev_id, enum pmo_offload_trigger trigger)
+static QDF_STATUS
+pmo_core_do_enable_arp_offload(struct wlan_objmgr_vdev *vdev,
+			       uint8_t vdev_id,
+			       enum pmo_offload_trigger trigger)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct pmo_psoc_priv_obj *psoc_ctx;
@@ -123,8 +125,8 @@ static QDF_STATUS pmo_core_do_enable_arp_offload(struct wlan_objmgr_vdev *vdev,
 	switch (trigger) {
 	case pmo_ipv4_change_notify:
 		if (!psoc_ctx->psoc_cfg.active_mode_offload) {
-			pmo_debug("active offload is disabled, skip in mode:%d",
-				trigger);
+			pmo_debug("active offload is disabled, skip in mode %d",
+				  trigger);
 			status = QDF_STATUS_E_INVAL;
 			goto out;
 		}
@@ -133,8 +135,8 @@ static QDF_STATUS pmo_core_do_enable_arp_offload(struct wlan_objmgr_vdev *vdev,
 		break;
 	case pmo_apps_suspend:
 		if (psoc_ctx->psoc_cfg.active_mode_offload) {
-			pmo_debug("active offload is enabled, skip in mode: %d",
-				trigger);
+			pmo_debug("active offload is enabled, skip in mode %d",
+				  trigger);
 			status = QDF_STATUS_E_INVAL;
 			goto out;
 		}
@@ -316,14 +318,15 @@ QDF_STATUS pmo_core_enable_arp_offload_in_fwr(struct wlan_objmgr_vdev *vdev,
 
 	status = pmo_core_arp_offload_sanity(vdev);
 	if (status != QDF_STATUS_SUCCESS)
-		goto def_ref;
+		goto put_ref;
 
 	vdev_id = pmo_vdev_get_id(vdev);
 	pmo_debug("Enable arp offload in fwr vdev id: %d vdev: %pK",
 		vdev_id, vdev);
 
 	status = pmo_core_do_enable_arp_offload(vdev, vdev_id, trigger);
-def_ref:
+
+put_ref:
 	pmo_vdev_put_ref(vdev);
 out:
 	pmo_exit();

+ 25 - 21
components/pmo/core/src/wlan_pmo_mc_addr_filtering.c

@@ -454,8 +454,8 @@ static QDF_STATUS pmo_core_handle_enable_mc_list_trigger(
 	switch (trigger) {
 	case pmo_mc_list_change_notify:
 		if (!vdev_ctx->pmo_psoc_ctx->psoc_cfg.active_mode_offload) {
-			pmo_info("active offload is disabled, skip in mode: %d",
-				 trigger);
+			pmo_debug("active offload is disabled, skip in mode %d",
+				  trigger);
 			status = QDF_STATUS_E_INVAL;
 			goto free_req;
 		}
@@ -464,8 +464,8 @@ static QDF_STATUS pmo_core_handle_enable_mc_list_trigger(
 		break;
 	case pmo_apps_suspend:
 		if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.active_mode_offload) {
-			pmo_info("active offload is enabled, skip in mode: %d",
-				trigger);
+			pmo_debug("active offload is enabled, skip in mode %d",
+				  trigger);
 			status = QDF_STATUS_E_INVAL;
 			goto free_req;
 		}
@@ -516,7 +516,7 @@ QDF_STATUS pmo_core_enable_mc_addr_filtering_in_fwr(
 	if (status != QDF_STATUS_SUCCESS)
 		goto put_vdev;
 
-	pmo_info("enable mclist trigger: %d", trigger);
+	pmo_debug("enable mclist trigger: %d", trigger);
 	status = pmo_core_handle_enable_mc_list_trigger(vdev, trigger);
 
 put_vdev:
@@ -535,16 +535,16 @@ static QDF_STATUS pmo_core_handle_disable_mc_list_trigger(
 			struct wlan_objmgr_vdev *vdev,
 			enum pmo_offload_trigger trigger)
 {
-	struct pmo_vdev_priv_obj *vdev_ctx;
 	QDF_STATUS status;
-	struct pmo_mc_addr_list *op_mc_list_req = NULL;
+	struct pmo_vdev_priv_obj *vdev_ctx;
+	struct pmo_mc_addr_list *op_mc_list_req;
 
 	vdev_ctx = pmo_vdev_get_priv(vdev);
 
 	op_mc_list_req = qdf_mem_malloc(sizeof(*op_mc_list_req));
 	if (!op_mc_list_req) {
-		pmo_err("op_mc_list_req is NULL");
-		status = QDF_STATUS_E_NULL_VALUE;
+		pmo_err("out of memory");
+		status = QDF_STATUS_E_NOMEM;
 		goto out;
 	}
 
@@ -552,20 +552,20 @@ static QDF_STATUS pmo_core_handle_disable_mc_list_trigger(
 	case pmo_peer_disconnect:
 	case pmo_mc_list_change_notify:
 		if (!vdev_ctx->pmo_psoc_ctx->psoc_cfg.active_mode_offload) {
-			pmo_info("active offload is disabled, skip in mode: %d",
-				trigger);
+			pmo_debug("active offload is disabled, skip in mode %d",
+				  trigger);
 			status = QDF_STATUS_E_INVAL;
-			goto out;
+			goto free_req;
 		}
 		status = pmo_core_do_disable_mc_addr_list(vdev, vdev_ctx,
 				op_mc_list_req);
 		break;
 	case pmo_apps_resume:
 		if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.active_mode_offload) {
-			pmo_info("active offload is enabled, skip in mode: %d",
-				trigger);
+			pmo_debug("active offload is enabled, skip in mode %d",
+				  trigger);
 			status = QDF_STATUS_E_INVAL;
-			goto out;
+			goto free_req;
 		}
 		status = pmo_core_do_disable_mc_addr_list(vdev, vdev_ctx,
 				op_mc_list_req);
@@ -575,10 +575,11 @@ static QDF_STATUS pmo_core_handle_disable_mc_list_trigger(
 		pmo_err("invalid pmo trigger for disable mc list");
 		break;
 	}
-out:
-	if (op_mc_list_req)
-		qdf_mem_free(op_mc_list_req);
 
+free_req:
+	qdf_mem_free(op_mc_list_req);
+
+out:
 	return status;
 }
 
@@ -610,12 +611,15 @@ QDF_STATUS pmo_core_disable_mc_addr_filtering_in_fwr(
 
 	status = pmo_core_mc_addr_flitering_sanity(vdev);
 	if (status != QDF_STATUS_SUCCESS)
-		goto dec_ref;
+		goto put_ref;
+
+	pmo_debug("disable mclist trigger: %d", trigger);
 
-	pmo_info("disable mclist trigger: %d", trigger);
 	status = pmo_core_handle_disable_mc_list_trigger(vdev, trigger);
-dec_ref:
+
+put_ref:
 	pmo_vdev_put_ref(vdev);
+
 out:
 	pmo_exit();
 

+ 3 - 3
components/pmo/core/src/wlan_pmo_suspend_resume.c

@@ -295,7 +295,7 @@ static QDF_STATUS pmo_core_psoc_configure_suspend(struct wlan_objmgr_psoc *psoc)
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 
 	if (pmo_core_is_wow_applicable(psoc)) {
-		pmo_info("WOW Suspend");
+		pmo_debug("WOW Suspend");
 		pmo_core_apply_lphb(psoc);
 
 		pmo_core_configure_dynamic_wake_events(psoc);
@@ -719,7 +719,7 @@ QDF_STATUS pmo_core_psoc_bus_suspend_req(struct wlan_objmgr_psoc *psoc,
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 
 	wow_mode_selected = pmo_core_is_wow_enabled(psoc_ctx);
-	pmo_info("wow mode selected %d", wow_mode_selected);
+	pmo_debug("wow mode selected %d", wow_mode_selected);
 
 	if (wow_mode_selected)
 		status = pmo_core_enable_wow_in_fw(psoc, psoc_ctx, wow_params);
@@ -1047,7 +1047,7 @@ QDF_STATUS pmo_core_psoc_bus_resume_req(struct wlan_objmgr_psoc *psoc,
 
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 	wow_mode = pmo_core_is_wow_enabled(psoc_ctx);
-	pmo_info("wow mode %d", wow_mode);
+	pmo_debug("wow mode %d", wow_mode);
 
 	pmo_core_update_wow_initial_wake_up(psoc_ctx, false);
 

+ 67 - 59
core/hdd/src/wlan_hdd_power.c

@@ -352,16 +352,17 @@ static int hdd_fill_ipv6_ac_addr(struct inet6_dev *idev,
 }
 
 void hdd_enable_ns_offload(struct hdd_adapter *adapter,
-	enum pmo_offload_trigger trigger)
+			   enum pmo_offload_trigger trigger)
 {
-	struct inet6_dev *in6_dev;
-	QDF_STATUS status;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct wlan_objmgr_psoc *psoc = hdd_ctx->hdd_psoc;
-	struct pmo_ns_req *ns_req = NULL;
-	int err;
+	struct inet6_dev *in6_dev;
+	struct pmo_ns_req *ns_req;
+	QDF_STATUS status;
+	int errno;
 
 	hdd_enter();
+
 	if (!psoc) {
 		hdd_err("psoc is NULL");
 		goto out;
@@ -385,42 +386,44 @@ void hdd_enable_ns_offload(struct hdd_adapter *adapter,
 	ns_req->count = 0;
 
 	/* Unicast Addresses */
-	err = hdd_fill_ipv6_uc_addr(in6_dev, ns_req->ipv6_addr,
-		ns_req->ipv6_addr_type, &ns_req->count);
-	if (err) {
+	errno = hdd_fill_ipv6_uc_addr(in6_dev, ns_req->ipv6_addr,
+				      ns_req->ipv6_addr_type, &ns_req->count);
+	if (errno) {
 		hdd_disable_ns_offload(adapter, trigger);
 		hdd_debug("Max supported addresses: disabling NS offload");
-		goto out;
+		goto free_req;
 	}
 
 	/* Anycast Addresses */
-	err = hdd_fill_ipv6_ac_addr(in6_dev, ns_req->ipv6_addr,
-		ns_req->ipv6_addr_type, &ns_req->count);
-	if (err) {
+	errno = hdd_fill_ipv6_ac_addr(in6_dev, ns_req->ipv6_addr,
+				      ns_req->ipv6_addr_type, &ns_req->count);
+	if (errno) {
 		hdd_disable_ns_offload(adapter, trigger);
 		hdd_debug("Max supported addresses: disabling NS offload");
-		goto out;
+		goto free_req;
 	}
 
 	/* cache ns request */
 	status = pmo_ucfg_cache_ns_offload_req(ns_req);
-	if (status != QDF_STATUS_SUCCESS) {
-		hdd_err("Failed to cache ns request status: %d", status);
-		goto out;
+	if (QDF_IS_STATUS_ERROR(status)) {
+		hdd_err("Failed to cache ns request; status:%d", status);
+		goto free_req;
 	}
 
 	/* enable ns request */
 	status = pmo_ucfg_enable_ns_offload_in_fwr(adapter->hdd_vdev, trigger);
-	if (status != QDF_STATUS_SUCCESS)
-		hdd_err("Failed to enable HostOffload feature with status: %d",
-			status);
-	else
-		hdd_wlan_offload_event(SIR_IPV6_NS_OFFLOAD, SIR_OFFLOAD_ENABLE);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		hdd_err("Failed to enable ns offload; status:%d", status);
+		goto free_req;
+	}
+
+	hdd_wlan_offload_event(SIR_IPV6_NS_OFFLOAD, SIR_OFFLOAD_ENABLE);
+
+free_req:
+	qdf_mem_free(ns_req);
+
 out:
-	if (ns_req)
-		qdf_mem_free(ns_req);
 	hdd_exit();
-
 }
 
 void hdd_disable_ns_offload(struct hdd_adapter *adapter,
@@ -526,17 +529,17 @@ void hdd_enable_host_offloads(struct hdd_adapter *adapter,
 	hdd_enter();
 
 	if (!ucfg_pmo_is_vdev_supports_offload(adapter->hdd_vdev)) {
-		hdd_info("offload is not supported on this vdev opmode: %d",
-			 adapter->device_mode);
+		hdd_debug("offload is not supported on vdev opmode %d",
+			  adapter->device_mode);
 		goto out;
 	}
 
 	if (!ucfg_pmo_is_vdev_connected(adapter->hdd_vdev)) {
-		hdd_info("vdev is not connected");
+		hdd_debug("offload is not supported on disconnected vdevs");
 		goto out;
 	}
 
-	hdd_info("enable offloads");
+	hdd_debug("enable offloads");
 	hdd_enable_gtk_offload(adapter);
 	hdd_enable_arp_offload(adapter, trigger);
 	hdd_enable_ns_offload(adapter, trigger);
@@ -563,7 +566,7 @@ void hdd_disable_host_offloads(struct hdd_adapter *adapter,
 		goto out;
 	}
 
-	hdd_info("disable offloads");
+	hdd_debug("disable offloads");
 	hdd_disable_gtk_offload(adapter);
 	hdd_disable_arp_offload(adapter, trigger);
 	hdd_disable_ns_offload(adapter, trigger);
@@ -887,15 +890,16 @@ static struct in_ifaddr *hdd_get_ipv4_local_interface(
 }
 
 void hdd_enable_arp_offload(struct hdd_adapter *adapter,
-		enum pmo_offload_trigger trigger)
+			    enum pmo_offload_trigger trigger)
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct wlan_objmgr_psoc *psoc = hdd_ctx->hdd_psoc;
 	QDF_STATUS status;
-	struct pmo_arp_req *arp_req = NULL;
-	struct in_ifaddr *ifa = NULL;
+	struct pmo_arp_req *arp_req;
+	struct in_ifaddr *ifa;
 
 	hdd_enter();
+
 	arp_req = qdf_mem_malloc(sizeof(*arp_req));
 	if (!arp_req) {
 		hdd_err("cannot allocate arp_req");
@@ -907,29 +911,33 @@ void hdd_enable_arp_offload(struct hdd_adapter *adapter,
 	arp_req->trigger = trigger;
 
 	ifa = hdd_get_ipv4_local_interface(adapter);
-	if (ifa && ifa->ifa_local) {
-		arp_req->ipv4_addr = (uint32_t)ifa->ifa_local;
-	status = pmo_ucfg_cache_arp_offload_req(arp_req);
-	if (status == QDF_STATUS_SUCCESS) {
-		status = pmo_ucfg_enable_arp_offload_in_fwr(
-				adapter->hdd_vdev, trigger);
-		if (status == QDF_STATUS_SUCCESS)
-			hdd_wlan_offload_event(
-				PMO_IPV4_ARP_REPLY_OFFLOAD,
-				PMO_OFFLOAD_ENABLE);
-		else
-			hdd_info("fail to enable arp offload in fwr");
-	} else
-		hdd_info("fail to cache arp offload request");
-	} else {
+	if (!ifa || !ifa->ifa_local) {
 		hdd_info("IP Address is not assigned");
 		status = QDF_STATUS_NOT_INITIALIZED;
+		goto free_req;
 	}
+
+	arp_req->ipv4_addr = (uint32_t)ifa->ifa_local;
+
+	status = pmo_ucfg_cache_arp_offload_req(arp_req);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		hdd_err("failed to cache arp offload request");
+		goto free_req;
+	}
+
+	status = pmo_ucfg_enable_arp_offload_in_fwr(adapter->hdd_vdev, trigger);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		hdd_err("failed to configure arp offload in firmware");
+		goto free_req;
+	}
+
+	hdd_wlan_offload_event(PMO_IPV4_ARP_REPLY_OFFLOAD, PMO_OFFLOAD_ENABLE);
+
+free_req:
+	qdf_mem_free(arp_req);
+
 out:
-	if (arp_req)
-		qdf_mem_free(arp_req);
 	hdd_exit();
-
 }
 
 void hdd_disable_arp_offload(struct hdd_adapter *adapter,
@@ -968,7 +976,7 @@ void hdd_enable_mc_addr_filtering(struct hdd_adapter *adapter,
 
 	status = pmo_ucfg_enable_mc_addr_filtering_in_fwr(psoc,
 				adapter->session_id, trigger);
-	if (status != QDF_STATUS_SUCCESS)
+	if (QDF_IS_STATUS_ERROR(status))
 		hdd_info("failed to enable mc list status %d", status);
 out:
 	hdd_exit();
@@ -1095,8 +1103,8 @@ hdd_suspend_wlan(void)
 		}
 
 		/* stop all TX queues before suspend */
-		hdd_info("Disabling queues for dev mode %s",
-			 hdd_device_mode_to_string(adapter->device_mode));
+		hdd_debug("Disabling queues for dev mode %s",
+			  hdd_device_mode_to_string(adapter->device_mode));
 		wlan_hdd_netif_queue_control(adapter,
 					     WLAN_STOP_ALL_NETIF_QUEUE,
 					     WLAN_CONTROL_PATH);
@@ -1128,7 +1136,7 @@ hdd_suspend_wlan(void)
 static int hdd_resume_wlan(void)
 {
 	struct hdd_context *hdd_ctx;
-	struct hdd_adapter *adapter = NULL;
+	struct hdd_adapter *adapter;
 	QDF_STATUS status;
 
 	hdd_info("WLAN being resumed by OS");
@@ -1158,8 +1166,8 @@ static int hdd_resume_wlan(void)
 		hdd_disable_host_offloads(adapter, pmo_apps_resume);
 
 		/* wake the tx queues */
-		hdd_info("Enabling queues for dev mode %s",
-			 hdd_device_mode_to_string(adapter->device_mode));
+		hdd_debug("Enabling queues for dev mode %s",
+			  hdd_device_mode_to_string(adapter->device_mode));
 		wlan_hdd_netif_queue_control(adapter,
 					WLAN_WAKE_ALL_NETIF_QUEUE,
 					WLAN_CONTROL_PATH);
@@ -1170,9 +1178,9 @@ static int hdd_resume_wlan(void)
 
 	ucfg_ipa_resume(hdd_ctx->hdd_pdev);
 	status = pmo_ucfg_psoc_user_space_resume_req(hdd_ctx->hdd_psoc,
-			QDF_SYSTEM_SUSPEND);
-	if (status != QDF_STATUS_SUCCESS)
-		return -EAGAIN;
+						     QDF_SYSTEM_SUSPEND);
+	if (QDF_IS_STATUS_ERROR(status))
+		return qdf_status_to_os_return(status);
 
 	return 0;
 }