浏览代码

qcacmn: Do not serialize link switch for host force reason

In response to host set link request, FW might send link switch
request where FW will wait for response of link switch in order
to send response of set link. As set link is already in
serialization link switch will be in pending queue.
This will lead to dead lock case where set link in serialization
is waiting for FW response where FW is waiting for link switch
response which is in pending queue due to set link command.

To avoid this dead-lock, do not serialize link switch request
due to set link as FW will send the reason code as HOST_FORCE.

Change-Id: I338f6b4c90ceba5452ede77ad0237af7ddecb31f
CRs-Fixed: 3607164
Vinod Kumar Pirla 1 年之前
父节点
当前提交
d968a41646
共有 1 个文件被更改,包括 22 次插入5 次删除
  1. 22 5
      umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

+ 22 - 5
umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

@@ -800,7 +800,7 @@ mlo_mgr_ser_link_switch_cb(struct wlan_serialization_command *cmd,
 		status = mlo_mgr_start_link_switch(vdev, cmd);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			mlo_mgr_link_switch_trans_abort_state(vdev->mlo_dev_ctx);
-			status = mlo_mgr_link_switch_notify(vdev, req);
+			mlo_mgr_link_switch_notify(vdev, req);
 		}
 		break;
 	case WLAN_SER_CB_RELEASE_MEM_CMD:
@@ -835,6 +835,12 @@ void mlo_mgr_remove_link_switch_cmd(struct wlan_objmgr_vdev *vdev)
 	req = &vdev->mlo_dev_ctx->link_ctx->last_req;
 	mlo_mgr_link_switch_notify(vdev, req);
 
+	if (req->reason == MLO_LINK_SWITCH_REASON_HOST_FORCE) {
+		mlo_debug("Link switch not serialized");
+		mlo_mgr_link_switch_complete(vdev);
+		return;
+	}
+
 	cmd_info.cmd_id = (vdev_id << 16) + (req->new_ieee_link_id << 8) +
 			  (req->curr_ieee_link_id);
 	cmd_info.req_type = WLAN_SER_CANCEL_NON_SCAN_CMD;
@@ -850,6 +856,7 @@ void mlo_mgr_remove_link_switch_cmd(struct wlan_objmgr_vdev *vdev)
 QDF_STATUS mlo_mgr_ser_link_switch_cmd(struct wlan_objmgr_vdev *vdev,
 				       struct wlan_mlo_link_switch_req *req)
 {
+	QDF_STATUS status;
 	enum wlan_serialization_status ser_cmd_status;
 	struct wlan_serialization_command cmd = {0};
 	uint8_t vdev_id = wlan_vdev_get_id(vdev);
@@ -873,6 +880,16 @@ QDF_STATUS mlo_mgr_ser_link_switch_cmd(struct wlan_objmgr_vdev *vdev,
 	cmd.vdev = vdev;
 	cmd.is_blocking = true;
 
+	if (req->reason == MLO_LINK_SWITCH_REASON_HOST_FORCE) {
+		mlo_debug("Do not serialize link switch");
+		status = mlo_mgr_start_link_switch(vdev, &cmd);
+		if (QDF_IS_STATUS_ERROR(status)) {
+			mlo_mgr_link_switch_trans_abort_state(vdev->mlo_dev_ctx);
+			mlo_mgr_link_switch_notify(vdev, req);
+		}
+		return status;
+	}
+
 	ser_cmd_status = wlan_serialization_request(&cmd);
 	switch (ser_cmd_status) {
 	case WLAN_SER_CMD_PENDING:
@@ -1000,6 +1017,10 @@ QDF_STATUS mlo_mgr_link_switch_request_params(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_INVAL;
 	}
 
+	mlo_debug("VDEV %d, curr_link_id %d, new_link_id %d, new_freq %d, new_phymode: %d, reason %d",
+		  req->vdev_id, req->curr_ieee_link_id, req->new_ieee_link_id,
+		  req->new_primary_freq, req->new_phymode, req->reason);
+
 	status = mlo_mgr_link_switch_validate_request(vdev, req);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		mlo_debug("Link switch params/request invalid");
@@ -1007,10 +1028,6 @@ QDF_STATUS mlo_mgr_link_switch_request_params(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	mlo_debug("VDEV %d, curr_link_id %d, new_link_id %d, new_freq %d, new_phymode: %d, reason %d",
-		  req->vdev_id, req->curr_ieee_link_id, req->new_ieee_link_id,
-		  req->new_primary_freq, req->new_phymode, req->reason);
-
 	status = mlo_mgr_ser_link_switch_cmd(vdev, req);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		mlo_err("Failed to serialize link switch command");