Kaynağa Gözat

qcacld-3.0: Check driver state machine and stop iface_change timer during sap start

In a corner case the interface change timer is not getting stopped.
One such case can be:
1) Framework issues add interface command for softap
2) Turns off the wifi sta which check for any interface is opened
and if no interface is opnened it starts the interface change timer.
3) After this hostapd is attached and tethering becomes functional.

Once the interface timer is expired it closes all modules and as part
of del_station from the upper layer it tries to access pdev_txrx_ctx
causing system crash.

So, as part of the hostapd attach check for driver state machine and
also stop the interface timer if it is expired.

CRs-Fixed: 1094440
Change-Id: Ic973d53f09d901ead4fd0921cf3a593728e09c56
Arunk Khandavalli 8 yıl önce
ebeveyn
işleme
702e170947
1 değiştirilmiş dosya ile 13 ekleme ve 5 silme
  1. 13 5
      core/hdd/src/wlan_hdd_hostapd.c

+ 13 - 5
core/hdd/src/wlan_hdd_hostapd.c

@@ -235,16 +235,25 @@ void hdd_sap_context_destroy(hdd_context_t *hdd_ctx)
 static int __hdd_hostapd_open(struct net_device *dev)
 {
 	hdd_adapter_t *pAdapter = netdev_priv(dev);
+	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
+	int ret;
 
 	ENTER_DEV(dev);
 
 	MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
 			 TRACE_CODE_HDD_HOSTAPD_OPEN_REQUEST, NO_SESSION, 0));
 
-	if (cds_is_load_or_unload_in_progress()) {
-		hdd_err("Driver load/unload in progress, ignore, state: 0x%x",
-			cds_get_driver_state());
-		goto done;
+	ret = wlan_hdd_validate_context(hdd_ctx);
+	if (ret)
+		return ret;
+	/*
+	 * Check statemachine state and also stop iface change timer if running
+	 */
+	ret = hdd_wlan_start_modules(hdd_ctx, pAdapter, false);
+
+	if (ret) {
+		hdd_err("Failed to start WLAN modules return");
+		return ret;
 	}
 
 	set_bit(DEVICE_IFACE_OPENED, &pAdapter->event_flags);
@@ -253,7 +262,6 @@ static int __hdd_hostapd_open(struct net_device *dev)
 	wlan_hdd_netif_queue_control(pAdapter,
 				   WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
 				   WLAN_CONTROL_PATH);
-done:
 	EXIT();
 	return 0;
 }