qcacmn: Fix duplicate process of link set event

Add flag in event response struct to indicate event processed
or not.
Use scheduler thread to process set link active event same as
other link switch and vdev event to avoid race condition.

Change-Id: I963f9106e296a59cff5078c85a4accf63c7026dc
CRs-Fixed: 3572868
This commit is contained in:
Liangwei Dong 2023-07-20 14:26:26 +08:00 committed by Rahul Choudhary
parent 838ed5edf5
commit adb0ec3b16
3 changed files with 12 additions and 1 deletions

View File

@ -416,7 +416,7 @@ target_if_mlo_register_event_handler(struct wlan_objmgr_psoc *psoc)
wmi_handle,
wmi_mlo_link_set_active_resp_eventid,
target_if_mlo_link_set_active_resp_handler,
WMI_RX_WORK_CTX);
WMI_RX_SERIALIZER_CTX);
if (QDF_IS_STATUS_ERROR(status)) {
target_if_err("Register mlo link set active resp cb errcode %d",
status);

View File

@ -1085,6 +1085,7 @@ enum mlo_link_force_reason {
/**
* struct mlo_link_set_active_resp: MLO link set active response structure
* @status: Return status, 0 for success, non-zero otherwise
* @evt_handled: response event is handled
* @active_sz: size of current active vdev bitmap array
* @active: current active vdev bitmap array
* @inactive_sz: size of current inactive vdev bitmap array
@ -1099,6 +1100,7 @@ enum mlo_link_force_reason {
*/
struct mlo_link_set_active_resp {
uint32_t status;
bool evt_handled;
uint32_t active_sz;
uint32_t active[MLO_VDEV_BITMAP_SZ];
uint32_t inactive_sz;
@ -1134,11 +1136,14 @@ struct mlo_link_num_param {
* force_inactive bitmaps
* @dynamic_force_link_num: indicate fw to use force link number instead of
* force link bitmaps
* @post_re_evaluate: run link state check again after command response event
* handled
*/
struct mlo_control_flags {
bool overwrite_force_active_bitmap;
bool overwrite_force_inactive_bitmap;
bool dynamic_force_link_num;
bool post_re_evaluate;
};
/* struct ml_link_force_cmd - force command for links

View File

@ -662,6 +662,8 @@ mlo_link_set_active_resp_vdev_handler(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_vdev *vdev = obj;
struct mlo_link_set_active_resp *event = arg;
if (event->evt_handled)
return;
req = wlan_serialization_get_active_cmd(wlan_vdev_get_psoc(vdev),
wlan_vdev_get_id(vdev),
WLAN_SER_CMD_SET_MLO_LINK);
@ -672,6 +674,7 @@ mlo_link_set_active_resp_vdev_handler(struct wlan_objmgr_psoc *psoc,
req->ctx.set_mlo_link_cb(vdev, req->ctx.cb_arg, event);
mlo_release_ser_link_set_active_cmd(vdev);
event->evt_handled = true;
}
QDF_STATUS
@ -681,6 +684,9 @@ mlo_process_link_set_active_resp(struct wlan_objmgr_psoc *psoc,
wlan_objmgr_iterate_obj_list(psoc, WLAN_VDEV_OP,
mlo_link_set_active_resp_vdev_handler,
event, true, WLAN_MLO_MGR_ID);
if (!event->evt_handled)
mlo_debug("link set resp evt not handled");
return QDF_STATUS_SUCCESS;
}