Forráskód Böngészése

qcacld-3.0: Check driver load/unload status before starting tx

hdd_softap_hard_start_xmit has cds_ssr_protect so prevent it running at
point of cds_wait_for_external_threads_completion in wlan_hdd_remove,
but after that hdd_softap_hard_start_xmit still inject in, it will
cause race condition between tx and unloading deinit.

Fix it by checking driver load/unload status at the beginning of
__hdd_softap_hard_start_xmit, and similar change for sta mode.

Change-Id: Ic3c72debb81fdfb8adca4e90bd9436f3a68eea11
CRs-Fixed: 2174243
Will Huang 7 éve
szülő
commit
20de943612
2 módosított fájl, 7 hozzáadás és 4 törlés
  1. 4 2
      core/hdd/src/wlan_hdd_softap_tx_rx.c
  2. 3 2
      core/hdd/src/wlan_hdd_tx_rx.c

+ 4 - 2
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -299,9 +299,11 @@ static int __hdd_softap_hard_start_xmit(struct sk_buff *skb,
 	 * context may not be reinitialized at this time which may
 	 * lead to a crash.
 	 */
-	if (cds_is_driver_recovering() || cds_is_driver_in_bad_state()) {
+	if (cds_is_driver_recovering() || cds_is_driver_in_bad_state() ||
+	    cds_is_load_or_unload_in_progress()) {
 		QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_INFO_HIGH,
-			  "%s: Recovery in Progress. Ignore!!!", __func__);
+			  "%s: Recovery/(Un)load in Progress. Ignore!!!",
+			  __func__);
 		goto drop_pkt;
 	}
 

+ 3 - 2
core/hdd/src/wlan_hdd_tx_rx.c

@@ -595,9 +595,10 @@ static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	++adapter->hdd_stats.tx_rx_stats.tx_called;
 	adapter->hdd_stats.tx_rx_stats.cont_txtimeout_cnt = 0;
 
-	if (cds_is_driver_recovering() || cds_is_driver_in_bad_state()) {
+	if (cds_is_driver_recovering() || cds_is_driver_in_bad_state() ||
+	    cds_is_load_or_unload_in_progress()) {
 		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_INFO_HIGH,
-			"Recovery in progress, dropping the packet");
+			  "Recovery/(Un)load in progress, dropping the packet");
 		goto drop_pkt;
 	}