qcacmn: Refine spinlock in ucfg_wifi_pos_process_req

Currently, the function causes the system false when
tries to release the spinlock because it holds the
spinlock longer than max_hold_time.

Change-Id: I90c78b7d8530cf3d1c224a693ab9f743f669b730
CRs-Fixed: 2371481
This commit is contained in:
Paul Zhang
2018-12-28 11:17:40 +08:00
committato da nshrivas
parent 273e871dc0
commit d2dad4b5bd
2 ha cambiato i file con 8 aggiunte e 11 eliminazioni

Vedi File

@@ -403,8 +403,10 @@ static QDF_STATUS wifi_pos_process_app_reg_req(struct wlan_objmgr_psoc *psoc,
}
wifi_pos_debug("Valid App Req Req from pid(%d)", req->pid);
qdf_spin_lock_bh(&wifi_pos_obj->wifi_pos_lock);
wifi_pos_obj->is_app_registered = true;
wifi_pos_obj->app_pid = req->pid;
qdf_spin_unlock_bh(&wifi_pos_obj->wifi_pos_lock);
vdev_idx = 0;
wlan_objmgr_iterate_obj_list(psoc, WLAN_VDEV_OP,

Vedi File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -31,7 +31,6 @@ QDF_STATUS ucfg_wifi_pos_process_req(struct wlan_objmgr_psoc *psoc,
{
uint8_t err;
uint32_t app_pid;
QDF_STATUS status;
bool is_app_registered;
struct wifi_pos_psoc_priv_obj *wifi_pos_psoc_obj =
wifi_pos_get_psoc_priv_obj(psoc);
@@ -47,12 +46,13 @@ QDF_STATUS ucfg_wifi_pos_process_req(struct wlan_objmgr_psoc *psoc,
wifi_pos_psoc_obj->wifi_pos_send_rsp = send_rsp_cb;
is_app_registered = wifi_pos_psoc_obj->is_app_registered;
app_pid = wifi_pos_psoc_obj->app_pid;
qdf_spin_unlock_bh(&wifi_pos_psoc_obj->wifi_pos_lock);
if (!wifi_pos_psoc_obj->wifi_pos_req_handler) {
wifi_pos_err("wifi_pos_psoc_obj->wifi_pos_req_handler is null");
err = OEM_ERR_NULL_CONTEXT;
send_rsp_cb(app_pid, ANI_MSG_OEM_ERROR, sizeof(err), &err);
status = QDF_STATUS_E_NULL_VALUE;
goto unlock_and_exit;
return QDF_STATUS_E_NULL_VALUE;
}
if (req->msg_type != ANI_MSG_APP_REG_REQ &&
@@ -61,15 +61,10 @@ QDF_STATUS ucfg_wifi_pos_process_req(struct wlan_objmgr_psoc *psoc,
is_app_registered, req->pid, app_pid);
err = OEM_ERR_APP_NOT_REGISTERED;
send_rsp_cb(app_pid, ANI_MSG_OEM_ERROR, sizeof(err), &err);
status = QDF_STATUS_E_INVAL;
goto unlock_and_exit;
return QDF_STATUS_E_INVAL;
}
status = wifi_pos_psoc_obj->wifi_pos_req_handler(psoc, req);
unlock_and_exit:
qdf_spin_unlock_bh(&wifi_pos_psoc_obj->wifi_pos_lock);
return status;
return wifi_pos_psoc_obj->wifi_pos_req_handler(psoc, req);
}