qcacmn: Request stats over qmi only when target suspend is success
Currently, Stats request commands are sent over qmi right from the target suspend request is sent to FW. This is leading to a crash in FW since it is trying to access PCI when it is in suspend state. To address this, send stats request over QMI only after the ack is received for the target suspend command. Change-Id: Id7a79d52740916f66476bf911e571c0ff466c7d3 CRs-Fixed: 2838737
This commit is contained in:
@@ -496,6 +496,13 @@ int wmi_get_pending_cmds(wmi_unified_t wmi_handle);
|
|||||||
*/
|
*/
|
||||||
void wmi_set_target_suspend(wmi_unified_t wmi_handle, bool val);
|
void wmi_set_target_suspend(wmi_unified_t wmi_handle, bool val);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WMI API to set target suspend command acked flag
|
||||||
|
* @param wmi_handle : handle to WMI.
|
||||||
|
* @param val : suspend command acked flag boolean
|
||||||
|
*/
|
||||||
|
void wmi_set_target_suspend_acked(wmi_unified_t wmi_handle, bool val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmi_is_target_suspended() - WMI API to check target suspend state
|
* wmi_is_target_suspended() - WMI API to check target suspend state
|
||||||
* @wmi_handle: handle to WMI.
|
* @wmi_handle: handle to WMI.
|
||||||
@@ -506,6 +513,17 @@ void wmi_set_target_suspend(wmi_unified_t wmi_handle, bool val);
|
|||||||
*/
|
*/
|
||||||
bool wmi_is_target_suspended(struct wmi_unified *wmi_handle);
|
bool wmi_is_target_suspended(struct wmi_unified *wmi_handle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_is_target_suspend_acked() - WMI API to check target suspend command is
|
||||||
|
* acked or not
|
||||||
|
* @wmi_handle: handle to WMI.
|
||||||
|
*
|
||||||
|
* WMI API to check whether the target suspend command is acked or not
|
||||||
|
*
|
||||||
|
* Return: true if target suspend command is acked, else false.
|
||||||
|
*/
|
||||||
|
bool wmi_is_target_suspend_acked(struct wmi_unified *wmi_handle);
|
||||||
|
|
||||||
#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
|
#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
|
||||||
/**
|
/**
|
||||||
* wmi_set_qmi_stats() - WMI API to set qmi stats enabled/disabled
|
* wmi_set_qmi_stats() - WMI API to set qmi stats enabled/disabled
|
||||||
|
@@ -2532,6 +2532,7 @@ struct wmi_unified {
|
|||||||
#endif /*WMI_INTERFACE_EVENT_LOGGING */
|
#endif /*WMI_INTERFACE_EVENT_LOGGING */
|
||||||
|
|
||||||
qdf_atomic_t is_target_suspended;
|
qdf_atomic_t is_target_suspended;
|
||||||
|
qdf_atomic_t is_target_suspend_acked;
|
||||||
#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
|
#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
|
||||||
bool is_qmi_stats_enabled;
|
bool is_qmi_stats_enabled;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -3117,6 +3117,7 @@ void *wmi_unified_attach(void *scn_handle,
|
|||||||
|
|
||||||
qdf_atomic_init(&wmi_handle->pending_cmds);
|
qdf_atomic_init(&wmi_handle->pending_cmds);
|
||||||
qdf_atomic_init(&wmi_handle->is_target_suspended);
|
qdf_atomic_init(&wmi_handle->is_target_suspended);
|
||||||
|
qdf_atomic_init(&wmi_handle->is_target_suspend_acked);
|
||||||
qdf_atomic_init(&wmi_handle->num_stats_over_qmi);
|
qdf_atomic_init(&wmi_handle->num_stats_over_qmi);
|
||||||
wmi_runtime_pm_init(wmi_handle);
|
wmi_runtime_pm_init(wmi_handle);
|
||||||
wmi_interface_logging_init(wmi_handle, WMI_HOST_PDEV_ID_0);
|
wmi_interface_logging_init(wmi_handle, WMI_HOST_PDEV_ID_0);
|
||||||
@@ -3515,6 +3516,19 @@ void wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val)
|
|||||||
qdf_atomic_set(&wmi_handle->is_target_suspended, val);
|
qdf_atomic_set(&wmi_handle->is_target_suspended, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_set_target_suspend_acked() - WMI API to set target suspend acked flag
|
||||||
|
*
|
||||||
|
* @wmi_handle: handle to WMI.
|
||||||
|
* @val: target suspend command acked flag.
|
||||||
|
*
|
||||||
|
* @Return: none.
|
||||||
|
*/
|
||||||
|
void wmi_set_target_suspend_acked(wmi_unified_t wmi_handle, A_BOOL val)
|
||||||
|
{
|
||||||
|
qdf_atomic_set(&wmi_handle->is_target_suspend_acked, val);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmi_is_target_suspended() - WMI API to check target suspend state
|
* wmi_is_target_suspended() - WMI API to check target suspend state
|
||||||
* @wmi_handle: handle to WMI.
|
* @wmi_handle: handle to WMI.
|
||||||
@@ -3529,6 +3543,21 @@ bool wmi_is_target_suspended(struct wmi_unified *wmi_handle)
|
|||||||
}
|
}
|
||||||
qdf_export_symbol(wmi_is_target_suspended);
|
qdf_export_symbol(wmi_is_target_suspended);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_is_target_suspend_acked() - WMI API to check target suspend command is
|
||||||
|
* acked or not
|
||||||
|
* @wmi_handle: handle to WMI.
|
||||||
|
*
|
||||||
|
* WMI API to check whether the target suspend command is acked or not
|
||||||
|
*
|
||||||
|
* Return: true if target suspend command is acked, else false.
|
||||||
|
*/
|
||||||
|
bool wmi_is_target_suspend_acked(struct wmi_unified *wmi_handle)
|
||||||
|
{
|
||||||
|
return qdf_atomic_read(&wmi_handle->is_target_suspend_acked);
|
||||||
|
}
|
||||||
|
qdf_export_symbol(wmi_is_target_suspend_acked);
|
||||||
|
|
||||||
#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
|
#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
|
||||||
void wmi_set_qmi_stats(wmi_unified_t wmi_handle, bool val)
|
void wmi_set_qmi_stats(wmi_unified_t wmi_handle, bool val)
|
||||||
{
|
{
|
||||||
|
@@ -723,7 +723,7 @@ QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle,
|
|||||||
if (!wmi_is_qmi_stats_enabled(wmi_handle))
|
if (!wmi_is_qmi_stats_enabled(wmi_handle))
|
||||||
goto send_over_wmi;
|
goto send_over_wmi;
|
||||||
|
|
||||||
if (wmi_is_target_suspended(wmi_handle)) {
|
if (wmi_is_target_suspend_acked(wmi_handle)) {
|
||||||
if (QDF_IS_STATUS_SUCCESS(
|
if (QDF_IS_STATUS_SUCCESS(
|
||||||
wmi_unified_cmd_send_over_qmi(wmi_handle, buf,
|
wmi_unified_cmd_send_over_qmi(wmi_handle, buf,
|
||||||
buflen, cmd_id)))
|
buflen, cmd_id)))
|
||||||
|
Reference in New Issue
Block a user