소스 검색

qcacld-3.0: Hold mutex lock while channel switch notify

From the kernel, it is expected to hold the mutex lock while
channel switch notify. Currently it is not done hence kernel
is asserting while channel switch notify.

To avoid kernel assert, hold mutex lock before driver
invokes channel switch notify.

CRs-Fixed: 3598047
Change-Id: I8838aa07bc12c317c494ad7e17116d090582944a
Deeksha Gupta 1 년 전
부모
커밋
4a8fcb43d0
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      core/hdd/src/wlan_hdd_hostapd.c

+ 8 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -1068,9 +1068,17 @@ QDF_STATUS hdd_chan_change_notify(struct wlan_hdd_link_info *link_info,
 		dev = assoc_adapter->dev;
 	}
 
+	if (adapter->device_mode == QDF_STA_MODE ||
+	    adapter->device_mode == QDF_P2P_CLIENT_MODE)
+		mutex_lock(&dev->ieee80211_ptr->mtx);
+
 	wlan_cfg80211_ch_switch_notify(dev, &chandef, link_id,
 				       puncture_bitmap);
 
+	if (adapter->device_mode == QDF_STA_MODE ||
+	    adapter->device_mode == QDF_P2P_CLIENT_MODE)
+		mutex_unlock(&dev->ieee80211_ptr->mtx);
+
 	return QDF_STATUS_SUCCESS;
 }