Revert "qcacld-3.0: Idle shutdown in suspend prepare"

This reverts Change-Id: Id1f5172a7fc1792c83c8c1c20127de815f7e4980
to avoid deadlock between cnss_pm_notify and unregister_pm_notifier
during soft driver unload.

Change-Id: Ic82db9dc0ca9d6686df99926335af27abc61cdb5
CRs-Fixed: 3266366
This commit is contained in:
Aditya Kodukula
2022-08-12 15:11:59 -07:00
committed by Madan Koyyalamudi
parent 143859f245
commit 2b0915517c
4 changed files with 3 additions and 62 deletions

View File

@@ -340,14 +340,13 @@
* <ini>
* gSuspendMode - Suspend mode configuration
* @Min: 0
* @Max: 3
* @Max: 2
* @Default: 2
*
* This ini is used to set suspend mode. Configurations are as follows:
* 0 - Does not support suspend.
* 1 - Legency suspend mode, PDEV suspend.
* 2 - WOW suspend mode.
* 3 - Shutdown wlan while suspend.
*
* Related: None
*
@@ -358,7 +357,7 @@
* </ini>
*/
#define CFG_PMO_SUSPEND_MODE CFG_INI_UINT("gSuspendMode", \
0, 3, 2, \
0, 2, 2, \
CFG_VALUE_OR_DEFAULT, \
"Suspend mode")

View File

@@ -175,7 +175,7 @@ enum powersave_mode {
* @PMO_SUSPEND_NONE: Does not support suspend
* @PMO_SUSPEND_LEGENCY: Legency PDEV suspend mode
* @PMO_SUSPEND_WOW: WoW suspend mode
* @PMO_SUSPEND_SHUTDOWN: Shutdown suspend mode. Shutdown while suspend
* @PMO_SUSPEND_SHUTDOWN: shutdown while suspend mode
*/
enum pmo_suspend_mode {
PMO_SUSPEND_NONE = 0,

View File

@@ -1872,7 +1872,6 @@ struct hdd_context {
/* Present state of driver cds modules */
enum driver_modules_status driver_status;
struct qdf_delayed_work psoc_idle_timeout_work;
struct notifier_block pm_notifier;
struct acs_dfs_policy acs_policy;
uint16_t wmi_max_len;
struct suspend_resume_stats suspend_resume_stats;

View File

@@ -83,7 +83,6 @@
#include <linux/ctype.h>
#include <linux/compat.h>
#include <linux/ethtool.h>
#include <linux/suspend.h>
#ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
#include "qdf_periodic_work.h"
@@ -9411,7 +9410,6 @@ void hdd_context_destroy(struct hdd_context *hdd_ctx)
hdd_ctx->config = NULL;
cfg_release();
unregister_pm_notifier(&hdd_ctx->pm_notifier);
qdf_delayed_work_destroy(&hdd_ctx->psoc_idle_timeout_work);
wiphy_free(hdd_ctx->wiphy);
}
@@ -12563,58 +12561,6 @@ static inline QDF_STATUS hdd_cfg_parse_connection_roaming_cfg(void)
}
#endif
static QDF_STATUS hdd_shutdown_wlan_in_suspend_prepare(void)
{
#define SHUTDOWN_IN_SUSPEND_RETRY 10
int count = 0;
struct hdd_context *hdd_ctx;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (wlan_hdd_validate_context(hdd_ctx) != 0)
return -EINVAL;
if (ucfg_pmo_get_suspend_mode(hdd_ctx->psoc) != PMO_SUSPEND_SHUTDOWN) {
hdd_info("shutdown in suspend not supported");
return 0;
}
while (hdd_is_any_interface_open(hdd_ctx) &&
count < SHUTDOWN_IN_SUSPEND_RETRY) {
count++;
hdd_info_rl("sleep 50ms to wait apdaters stopped, #%d", count);
msleep(50);
}
if (count >= SHUTDOWN_IN_SUSPEND_RETRY) {
hdd_err("some adapters not stopped");
return -EBUSY;
}
qdf_delayed_work_stop_sync(&hdd_ctx->psoc_idle_timeout_work);
hdd_debug("call pld idle shutdown directly");
return pld_idle_shutdown(hdd_ctx->parent_dev, hdd_psoc_idle_shutdown);
}
static int hdd_pm_notify(struct notifier_block *b,
unsigned long event, void *p)
{
hdd_info("got PM event: %lu", event);
switch (event) {
case PM_SUSPEND_PREPARE:
case PM_HIBERNATION_PREPARE:
if (0 != hdd_shutdown_wlan_in_suspend_prepare())
return NOTIFY_STOP;
break;
case PM_POST_SUSPEND:
case PM_POST_HIBERNATION:
break;
}
return NOTIFY_DONE;
}
struct hdd_context *hdd_context_create(struct device *dev)
{
QDF_STATUS status;
@@ -12637,9 +12583,6 @@ struct hdd_context *hdd_context_create(struct device *dev)
goto wiphy_dealloc;
}
hdd_ctx->pm_notifier.notifier_call = hdd_pm_notify;
register_pm_notifier(&hdd_ctx->pm_notifier);
hdd_ctx->parent_dev = dev;
hdd_ctx->last_scan_reject_vdev_id = WLAN_UMAC_VDEV_ID_MAX;