qcacld-3.0: Add case handling for unit test WoW suspend

When unit test WoW is executed, system suspend case is currently being
executed. Add a new case for handling unit test WoW suspend mode.

Change-Id: I9defa7175a638363a1dd736018d17a42d8afe6b3
CRs-Fixed: 2855437
This commit is contained in:
Alan Chen
2021-01-14 17:09:08 -08:00
committed by snandini
父節點 e5cb66ff6d
當前提交 65119e6610
共有 4 個文件被更改,包括 22 次插入13 次删除

查看文件

@@ -811,6 +811,8 @@ pmo_core_enable_wow_in_fw(struct wlan_objmgr_psoc *psoc,
if (type == QDF_SYSTEM_SUSPEND) {
pmo_info("system suspend wow");
param.flags |= WMI_WOW_FLAG_SYSTEM_SUSPEND_WOW;
} else if (type == QDF_UNIT_TEST_WOW_SUSPEND) {
pmo_info("unit test wow suspend");
} else {
pmo_info("RTPM wow");
}

查看文件

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2017, 2019, 2021 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
@@ -76,12 +77,14 @@ int wlan_hdd_bus_suspend_noirq(void);
/**
* wlan_hdd_bus_resume() - wake up the bus
*
* @type: WoW suspend type
*
* This function is called by the platform driver to resume wlan
* bus
*
* Return: 0 for success and negative errno if failure
*/
int wlan_hdd_bus_resume(void);
int wlan_hdd_bus_resume(enum qdf_suspend_type type);
/**
* wlan_hdd_bus_resume_noirq() - handle bus resume no irq

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2021 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
@@ -1119,6 +1119,7 @@ hdd_to_pmo_wow_enable_params(struct wow_enable_params *in_params,
/**
* __wlan_hdd_bus_suspend() - handles platform supsend
* @wow_params: collection of wow enable override parameters
* @type: WoW suspend type
*
* Does precondtion validation. Ensures that a subsystem restart isn't in
* progress. Ensures that no load or unload is in progress. Does:
@@ -1130,7 +1131,8 @@ hdd_to_pmo_wow_enable_params(struct wow_enable_params *in_params,
* -EBUSY or -EAGAIN if another opperation is in progress and
* wlan will not be ready to suspend in time.
*/
static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params,
enum qdf_suspend_type type)
{
int err;
QDF_STATUS status;
@@ -1189,7 +1191,7 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
}
status = ucfg_pmo_psoc_bus_suspend_req(hdd_ctx->psoc,
QDF_SYSTEM_SUSPEND,
type,
&pmo_params);
err = qdf_status_to_os_return(status);
if (err) {
@@ -1227,7 +1229,7 @@ resume_hif:
resume_pmo:
status = ucfg_pmo_psoc_bus_resume_req(hdd_ctx->psoc,
QDF_SYSTEM_SUSPEND);
type);
QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
late_hif_resume:
@@ -1245,13 +1247,13 @@ int wlan_hdd_bus_suspend(void)
{
struct wow_enable_params default_params = {0};
return __wlan_hdd_bus_suspend(default_params);
return __wlan_hdd_bus_suspend(default_params, QDF_SYSTEM_SUSPEND);
}
#ifdef WLAN_SUSPEND_RESUME_TEST
int wlan_hdd_unit_test_bus_suspend(struct wow_enable_params wow_params)
{
return __wlan_hdd_bus_suspend(wow_params);
return __wlan_hdd_bus_suspend(wow_params, QDF_UNIT_TEST_WOW_SUSPEND);
}
#endif
@@ -1329,6 +1331,8 @@ done:
/**
* wlan_hdd_bus_resume() - handles platform resume
*
* @type: WoW suspend type
*
* Does precondtion validation. Ensures that a subsystem restart isn't in
* progress. Ensures that no load or unload is in progress. Ensures that
* it has valid pointers for the required contexts.
@@ -1339,7 +1343,7 @@ done:
*
* return: error code or 0 for success
*/
int wlan_hdd_bus_resume(void)
int wlan_hdd_bus_resume(enum qdf_suspend_type type)
{
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
void *hif_ctx;
@@ -1385,7 +1389,7 @@ int wlan_hdd_bus_resume(void)
}
qdf_status = ucfg_pmo_psoc_bus_resume_req(hdd_ctx->psoc,
QDF_SYSTEM_SUSPEND);
type);
status = qdf_status_to_os_return(qdf_status);
if (status) {
hdd_err("Failed pmo bus resume");
@@ -1818,7 +1822,7 @@ static int wlan_hdd_pld_resume(struct device *dev,
if (errno)
return errno;
errno = wlan_hdd_bus_resume();
errno = wlan_hdd_bus_resume(QDF_SYSTEM_SUSPEND);
osif_psoc_sync_op_stop(psoc_sync);

查看文件

@@ -2855,7 +2855,7 @@ static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy,
/* simulate kernel enable irqs */
QDF_BUG(!hif_apps_irqs_enable(hif_ctx));
QDF_BUG(!wlan_hdd_bus_resume());
QDF_BUG(!wlan_hdd_bus_resume(QDF_UNIT_TEST_WOW_SUSPEND));
QDF_BUG(!wlan_hdd_cfg80211_resume_wlan(wiphy));
@@ -2992,7 +2992,7 @@ enable_irqs:
QDF_BUG(!hif_apps_irqs_enable(hif_ctx));
bus_resume:
QDF_BUG(!wlan_hdd_bus_resume());
QDF_BUG(!wlan_hdd_bus_resume(QDF_UNIT_TEST_WOW_SUSPEND));
cfg80211_resume:
QDF_BUG(!wlan_hdd_cfg80211_resume_wlan(wiphy));