diff options
| author | Kabilan Kannan <kabilank@codeaurora.org> | 2018-02-21 13:41:00 -0800 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2018-02-26 15:48:59 -0800 |
| commit | 4a1be3dbf6b730e2ec7b5ee51b9e82fa7c5ba7be (patch) | |
| tree | 54120b25f058686133dadc2eb64dcef9124c5800 | |
| parent | 08d84f8db9dec79424524cda64a669d90593a362 (diff) | |
qcacmn: Block WMI cmds before issuing HTC stop
WMI cmds should be blocked, before calling HTC stop
to avoid the race condition in the system
Change-Id: I015b154a3bc422f50d4ed82bc861dd9e054c47a3
CRs-Fixed: 2194234
| -rw-r--r-- | htc/htc_send.c | 13 | ||||
| -rw-r--r-- | wmi/src/wmi_unified.c | 29 |
2 files changed, 27 insertions, 15 deletions
diff --git a/htc/htc_send.c b/htc/htc_send.c index bd45a80cb86e..4777ff991287 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1505,8 +1505,17 @@ static inline QDF_STATUS __htc_send_pkt(HTC_HANDLE HTCHandle, /* HTC API - htc_send_pkt */ QDF_STATUS htc_send_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket) { - if (HTCHandle == NULL || pPacket == NULL) + if (HTCHandle == NULL) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERR, + ("%s: HTCHandle is NULL \n", __func__)); + return QDF_STATUS_E_FAILURE; + } + + if (pPacket == NULL) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERR, + ("%s: pPacket is NULL \n", __func__)); return QDF_STATUS_E_FAILURE; + } AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("+-htc_send_pkt: Enter endPointId: %d, buffer: %pK, length: %d\n", diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 52f01f3678b5..fa3644d4411a 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -2121,6 +2121,22 @@ void wmi_set_tgt_assert(wmi_unified_t wmi_handle, bool val) { wmi_handle->tgt_force_assert_enable = val; } + +/** + * wmi_stop() - generic function to block unified WMI command + * @wmi_handle: handle to WMI. + * + * @Return: success always. + */ +int +wmi_stop(wmi_unified_t wmi_handle) +{ + QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO, + "WMI Stop\n"); + wmi_handle->wmi_stopinprogress = 1; + return 0; +} + #ifdef WMI_NON_TLV_SUPPORT /** * API to flush all the previous packets associated with the wmi endpoint @@ -2134,17 +2150,4 @@ wmi_flush_endpoint(wmi_unified_t wmi_handle) wmi_handle->wmi_endpoint_id, 0); } -/** - * generic function to block unified WMI command - * @param wmi_handle : handle to WMI. - * @return 0 on success and -ve on failure. - */ -int -wmi_stop(wmi_unified_t wmi_handle) -{ - QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO, - "WMI Stop\n"); - wmi_handle->wmi_stopinprogress = 1; - return 0; -} #endif |
