Browse Source

qcacld-3.0: Fix lim deferred messages not getting processed

When channel Switch is happening and north bound disconnect is
also initiated at same time before vdev restart response is
received, the disconnect command will be activated by serialization
module but the eWNI_SME_DEAUTH_REQ message to lim was deferred.
The deferred message queue at lim was not processed as there was
no wmi command response received.

So process the deferred messages after the gLimProcessDefdMsgs
is set to 1.

Change-Id: I8200407663857349ea2eef0924fe1c345fab8028
CRs-Fixed: 2789632
Pragaspathi Thilagaraj 4 years ago
parent
commit
050500b032

+ 2 - 1
core/mac/src/include/sir_params.h

@@ -733,8 +733,9 @@ enum halmsgtype {
 					 (SIR_LIM_TIMEOUT_MSG_START + 0x28)
 
 #define SIR_LIM_AUTH_RETRY_TIMEOUT     (SIR_LIM_TIMEOUT_MSG_START + 0x2D)
+#define SIR_LIM_AUTH_SAE_TIMEOUT       (SIR_LIM_TIMEOUT_MSG_START + 0x2E)
 
-#define SIR_LIM_AUTH_SAE_TIMEOUT     (SIR_LIM_TIMEOUT_MSG_START + 0x2E)
+#define SIR_LIM_PROCESS_DEFERRED_QUEUE (SIR_LIM_TIMEOUT_MSG_START + 0x2F)
 
 #define SIR_LIM_MSG_TYPES_END            (SIR_LIM_MSG_TYPES_BEGIN+0xFF)
 

+ 35 - 15
core/mac/src/pe/include/lim_api.h

@@ -67,9 +67,42 @@
 #define LIM_IS_CONNECTION_ACTIVE(pe_session)  (pe_session->LimRxedBeaconCntDuringHB)
 /*mac->lim.gLimProcessDefdMsgs*/
 #define GET_LIM_PROCESS_DEFD_MESGS(mac) (mac->lim.gLimProcessDefdMsgs)
+
+/**
+ * lim_post_msg_api() - post normal priority PE message
+ * @mac: mac context
+ * @msg: message to be posted
+ *
+ * This function is called to post a message to the tail of the PE
+ * message queue to be processed in the MC Thread with normal
+ * priority.
+ *
+ * Return: QDF_STATUS_SUCCESS on success, other QDF_STATUS on error
+ */
+QDF_STATUS lim_post_msg_api(struct mac_context *mac, struct scheduler_msg *msg);
+
+static inline void
+lim_post_msg_to_process_deferred_queue(struct mac_context *mac)
+{
+	struct scheduler_msg msg = {0};
+	QDF_STATUS status;
+
+	if (!mac->lim.gLimProcessDefdMsgs || !mac->lim.gLimDeferredMsgQ.size)
+		return;
+
+	msg.type = SIR_LIM_PROCESS_DEFERRED_QUEUE;
+	msg.bodyptr = NULL;
+	msg.bodyval = 0;
+
+	status = lim_post_msg_api(mac, &msg);
+	if (QDF_IS_STATUS_ERROR(status))
+		pe_err("Failed to post lim msg:0x%x", msg.type);
+}
+
 #define SET_LIM_PROCESS_DEFD_MESGS(mac, val) \
-		mac->lim.gLimProcessDefdMsgs = val; \
-		pe_debug("Defer LIM msg %d", val);
+	mac->lim.gLimProcessDefdMsgs = val; \
+	pe_debug("Defer LIM msg %d", val); \
+	lim_post_msg_to_process_deferred_queue(mac);
 
 /* LIM exported function templates */
 #define LIM_MIN_BCN_PR_LENGTH  12
@@ -169,19 +202,6 @@ void pe_register_callbacks_with_wma(struct mac_context *mac,
  */
 void lim_cleanup(struct mac_context *);
 
-/**
- * lim_post_msg_api() - post normal priority PE message
- * @mac: mac context
- * @msg: message to be posted
- *
- * This function is called to post a message to the tail of the PE
- * message queue to be processed in the MC Thread with normal
- * priority.
- *
- * Return: QDF_STATUS_SUCCESS on success, other QDF_STATUS on error
- */
-QDF_STATUS lim_post_msg_api(struct mac_context *mac, struct scheduler_msg *msg);
-
 /**
  * lim_post_msg_high_priority() - post high priority PE message
  * @mac: mac context

+ 2 - 0
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -2105,6 +2105,8 @@ static void lim_process_messages(struct mac_context *mac_ctx,
 		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
+	case SIR_LIM_PROCESS_DEFERRED_QUEUE:
+		break;
 	default:
 		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;

+ 2 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -299,6 +299,8 @@ char *lim_msg_str(uint32_t msgType)
 		return "eWNI_SME_SET_HW_MODE_RESP";
 	case eWNI_SME_HW_MODE_TRANS_IND:
 		return "eWNI_SME_HW_MODE_TRANS_IND";
+	case SIR_LIM_PROCESS_DEFERRED_QUEUE:
+		return "SIR_LIM_PROCESS_DEFERRED_QUEUE";
 	default:
 		return "Unknown";
 	}