qcacmn: Runtime PM packets tagging after wow suspend
qcacld-2.0 to qcacmn propagation.
Don't Tag Non-WoW packets as Runtime PM packets after
wow suspend. Some WMI Commands can be send in Runtime
PM context and MC thread context. Packets coming via
MC Thread Context can be tagged as Runtime PM packets
when runtime pm in progress.
Packets should be tagged in the same caller context to
avoid any race condition. Being stability issue, addressing
this issue by not tagging any non-wow commands as runtime pm
after wow suspend. This will ensure all the non-wow packets
coming after wow_suspend flag is set as non runtime pm packets
and will trigger a runtime resume.
Git-commit: 4a396d80c5cc2ded75098c61426521b9b2762c17
Git-commit: 2ee4bf4791cc5db30ec03eceaf591367deffe39a
CRs-Fixed: 1106496
Change-Id: I4e55733ad8403581aca0b49ce9442fc5591335c0
diff --git a/wmi_unified.c b/wmi_unified.c
index bb2a06d..7a67ef0 100644
--- a/wmi_unified.c
+++ b/wmi_unified.c
@@ -1686,33 +1686,7 @@
}
#endif
-
-/**
- * wmi_is_runtime_pm_cmd() - check if a cmd is from suspend resume sequence
- * @cmd: command to check
- *
- * Return: true if the command is part of the suspend resume sequence.
- */
#ifdef CONFIG_MCL
-static bool wmi_is_runtime_pm_cmd(uint32_t cmd_id)
-{
- switch (cmd_id) {
- case WMI_WOW_ENABLE_CMDID:
- case WMI_PDEV_SUSPEND_CMDID:
- case WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID:
- case WMI_WOW_ADD_WAKE_PATTERN_CMDID:
- case WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID:
- case WMI_PDEV_RESUME_CMDID:
- case WMI_WOW_DEL_WAKE_PATTERN_CMDID:
- case WMI_WOW_SET_ACTION_WAKE_UP_CMDID:
- case WMI_D0_WOW_ENABLE_DISABLE_CMDID:
- return true;
-
- default:
- return false;
- }
-}
-
/**
* wmi_is_pm_resume_cmd() - check if a cmd is part of the resume sequence
* @cmd_id: command to check
@@ -1731,10 +1705,6 @@
}
}
#else
-static bool wmi_is_runtime_pm_cmd(uint32_t cmd_id)
-{
- return false;
-}
static bool wmi_is_pm_resume_cmd(uint32_t cmd_id)
{
return false;
@@ -1760,8 +1730,9 @@
uint16_t htc_tag = 0;
if (wmi_get_runtime_pm_inprogress(wmi_handle)) {
- if (wmi_is_runtime_pm_cmd(cmd_id))
- htc_tag = HTC_TX_PACKET_TAG_AUTO_PM;
+ htc_tag =
+ (A_UINT16)wmi_handle->ops->wmi_set_htc_tx_tag(
+ wmi_handle, buf, cmd_id);
} else if (qdf_atomic_read(&wmi_handle->is_target_suspended) &&
(!wmi_is_pm_resume_cmd(cmd_id))) {
QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR,
@@ -2506,6 +2477,26 @@
qdf_atomic_set(&wmi_handle->is_target_suspended, val);
}
+/**
+ * WMI API to set crash injection state
+ * @param wmi_handle: handle to WMI.
+ * @param val: crash injection state boolean.
+ */
+void wmi_tag_crash_inject(wmi_unified_t wmi_handle, A_BOOL flag)
+{
+ wmi_handle->tag_crash_inject = flag;
+}
+
+/**
+ * WMI API to set bus suspend state
+ * @param wmi_handle: handle to WMI.
+ * @param val: suspend state boolean.
+ */
+void wmi_set_is_wow_bus_suspended(wmi_unified_t wmi_handle, A_BOOL val)
+{
+ qdf_atomic_set(&wmi_handle->is_wow_bus_suspended, val);
+}
+
#ifndef CONFIG_MCL
/**
* API to flush all the previous packets associated with the wmi endpoint