Explorar el Código

qcacld-3.0: Avoid sending P2P action frame confirmation twice

qcacld-2.0 to qcacld-3.0 propagation..

P2P action frame confirmation can be called from work queue
wma_mgmt_tx_ack_work_handler as well as from MC thread during
remain on channel completion. So it can lead to race condition
where frame confirmation is called twice and driver tries to free
frame buffer twice.

To detect duplicate use PE global lock in P2P action frame
confirmation.

Change-Id: Id193b5a979fad5effa7c6b00d89452ad876ae00e
CRs-Fixed: 1035077
Abhishek Singh hace 8 años
padre
commit
a6b0982b34
Se han modificado 1 ficheros con 22 adiciones y 7 borrados
  1. 22 7
      core/mac/src/pe/lim/lim_p2p.c

+ 22 - 7
core/mac/src/pe/lim/lim_p2p.c

@@ -412,16 +412,31 @@ void lim_send_sme_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType,
 
 QDF_STATUS lim_p2p_action_cnf(tpAniSirGlobal pMac, uint32_t txCompleteSuccess)
 {
-	if (pMac->lim.mgmtFrameSessionId != 0xff) {
-		/* The session entry might be invalid(0xff) action confirmation received after
-		 * remain on channel timer expired */
-		if (pMac->p2p_ack_ind_cb)
-			pMac->p2p_ack_ind_cb(pMac->lim.mgmtFrameSessionId,
-							txCompleteSuccess);
+	QDF_STATUS status;
+	uint32_t mgmt_frame_sessionId;
+
+	status = pe_acquire_global_lock(&pMac->lim);
+	if (QDF_IS_STATUS_SUCCESS(status)) {
+		mgmt_frame_sessionId = pMac->lim.mgmtFrameSessionId;
 		pMac->lim.mgmtFrameSessionId = 0xff;
+		pe_release_global_lock(&pMac->lim);
+
+		if (mgmt_frame_sessionId != 0xff) {
+			/*
+			 * The session entry might be invalid(0xff)
+			 * action confirmation received after
+			 * remain on channel timer expired.
+			 */
+			lim_log(pMac, LOG1,
+				FL("mgmt_frame_sessionId %d"),
+					 mgmt_frame_sessionId);
+			if (pMac->p2p_ack_ind_cb)
+				pMac->p2p_ack_ind_cb(mgmt_frame_sessionId,
+							txCompleteSuccess);
+		}
 	}
 
-	return QDF_STATUS_SUCCESS;
+	return status;
 }
 
 /**