Revert "qcacld-3.0: Add the Full Power Down feature support"

This reverts commit I293647175c151da0fd6628345f98ea65c83b1bb3.

New solution idle shutdown in suspend prepare is better.

Change-Id: I69a0e7401c811e4a9656fcc8e3dd069f4317cc35
CRs-Fixed: 3213236
This commit is contained in:
Yu Ouyang
2022-06-05 22:03:45 +08:00
committed by Madan Koyyalamudi
parent 3fbdeb8f84
commit 6b2b1cfb27
13 changed files with 8 additions and 213 deletions

4
Kbuild
View File

@@ -4366,10 +4366,6 @@ endif
cppflags-$(CONFIG_DP_FT_LOCK_HISTORY) += -DDP_FT_LOCK_HISTORY
ifeq ($(CONFIG_WLAN_FULL_POWER_DOWN), y)
cppflags-y += -DFEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
endif
ccflags-$(CONFIG_INTRA_BSS_FWD_OFFLOAD) += -DINTRA_BSS_FWD_OFFLOAD
ccflags-$(CONFIG_GET_DRIVER_MODE) += -DFEATURE_GET_DRIVER_MODE

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 - Full power down 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,13 +175,11 @@ enum powersave_mode {
* @PMO_SUSPEND_NONE: Does not support suspend
* @PMO_SUSPEND_LEGENCY: Legency PDEV suspend mode
* @PMO_SUSPEND_WOW: WoW suspend mode
* @PMO_FULL_POWER_DOWN: Full power down while suspend
*/
enum pmo_suspend_mode {
PMO_SUSPEND_NONE = 0,
PMO_SUSPEND_LEGENCY,
PMO_SUSPEND_WOW,
PMO_FULL_POWER_DOWN
PMO_SUSPEND_WOW
};
#define PMO_TARGET_SUSPEND_TIMEOUT (4000)

View File

@@ -5423,23 +5423,6 @@ hdd_is_dynamic_set_mac_addr_allowed(struct hdd_adapter *adapter)
#endif /* WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE */
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
/**
* hdd_set_suspend_mode: set the suspend_mode state to pld based on the
* configuration option from INI file
* @hdd_ctx: HDD context
*
* Return: 0 for success
* Non zero failure code for errors
*/
int hdd_set_suspend_mode(struct hdd_context *hdd_ctx);
#else
static inline int hdd_set_suspend_mode(struct hdd_context *hdd_ctx)
{
return 0;
}
#endif
#define HDD_DATA_STALL_ENABLE BIT(0)
#define HDD_HOST_STA_TX_TIMEOUT BIT(16)
#define HDD_HOST_SAP_TX_TIMEOUT BIT(17)

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2014-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -621,25 +622,6 @@ static inline int wlan_hdd_rx_thread_suspend(struct hdd_context *hdd_ctx)
}
#endif
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
/**
* wlan_hdd_is_full_power_down_enable()- Check wlan full power down
* @hdd_ctx: HDD context
*
* check whether the wlan full power down is enabled or not.
*
* Return: true if wlan full power enabled else false
*/
bool
wlan_hdd_is_full_power_down_enable(struct hdd_context *hdd_ctx);
#else
static inline bool
wlan_hdd_is_full_power_down_enable(struct hdd_context *hdd_ctx)
{
return false;
}
#endif
#ifdef FEATURE_ANI_LEVEL_REQUEST
/**
* wlan_hdd_get_ani_level() - Wrapper to call API to fetch ani level

View File

@@ -642,10 +642,6 @@ static int __hdd_soc_probe(struct device *dev,
hdd_start_complete(0);
hdd_thermal_mitigation_register(hdd_ctx, dev);
errno = hdd_set_suspend_mode(hdd_ctx);
if (errno)
hdd_err("Failed to set suspend mode in PLD; errno:%d", errno);
hdd_soc_load_unlock(dev);
return 0;
@@ -978,16 +974,13 @@ static void __hdd_soc_recovery_shutdown(void)
struct hdd_context *hdd_ctx;
void *hif_ctx;
/* recovery starts via firmware down indication; ensure we got one */
QDF_BUG(cds_is_driver_recovering());
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx)
return;
if (wlan_hdd_is_full_power_down_enable(hdd_ctx))
cds_set_driver_state(CDS_DRIVER_STATE_RECOVERING);
/* recovery starts via firmware down indication; ensure we got one */
QDF_BUG(cds_is_driver_recovering());
/*
* Perform SSR related cleanup if it has not already been done as a
* part of receiving the uevent.

View File

@@ -18901,20 +18901,6 @@ static int hdd_register_driver_retry(void)
return errno;
}
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
int hdd_set_suspend_mode(struct hdd_context *hdd_ctx)
{
int errno;
if (wlan_hdd_is_full_power_down_enable(hdd_ctx))
errno = pld_set_suspend_mode(PLD_FULL_POWER_DOWN);
else
errno = pld_set_suspend_mode(PLD_SUSPEND);
return errno;
}
#endif
int hdd_driver_load(void)
{
struct osif_driver_sync *driver_sync;

View File

@@ -2261,18 +2261,6 @@ hdd_sched_scan_results(struct wiphy *wiphy, uint64_t reqid)
}
#endif
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
bool wlan_hdd_is_full_power_down_enable(struct hdd_context *hdd_ctx)
{
if (ucfg_pmo_get_suspend_mode(hdd_ctx->psoc) == PMO_FULL_POWER_DOWN) {
hdd_info_rl("Wlan full power down is enabled while suspend");
return true;
}
return false;
}
#endif
/**
* __wlan_hdd_cfg80211_resume_wlan() - cfg80211 resume callback
* @wiphy: Pointer to wiphy
@@ -2311,12 +2299,6 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
return -EINVAL;
}
if (wlan_hdd_is_full_power_down_enable(hdd_ctx)) {
hdd_debug("Driver has been re-initialized; Skipping resume");
exit_code = 0;
goto exit_with_code;
}
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
hdd_debug("Driver is not enabled; Skipping resume");
exit_code = 0;
@@ -2497,11 +2479,6 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
return -EINVAL;
}
if (wlan_hdd_is_full_power_down_enable(hdd_ctx)) {
hdd_debug("Driver will be shutdown; Skipping suspend");
return 0;
}
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
hdd_debug("Driver Modules not Enabled ");
return 0;

View File

@@ -369,16 +369,6 @@ enum pld_driver_mode {
PLD_FTM_COLDBOOT_CALIBRATION = 10
};
/**
* enum pld_suspend_mode - WLAN suspend mode
* @PLD_SUSPEND: suspend
* @PLD_FULL_POWER_DOWN: full power down while suspend
*/
enum pld_suspend_mode {
PLD_SUSPEND,
PLD_FULL_POWER_DOWN,
};
/**
* struct pld_device_version - WLAN device version info
* @family_number: family number of WLAN SOC HW
@@ -572,33 +562,6 @@ void pld_deinit(void);
*/
int pld_set_mode(u8 mode);
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
/**
* pld_set_suspend_mode() - set suspend mode in PLD module
* @mode: pld suspend mode
*
* Return: 0 for success
* Non zero failure code for errors
*/
int pld_set_suspend_mode(enum pld_suspend_mode mode);
/**
* pld_is_full_power_down_enable() - check full power down is enabled or not
*
* Return: true if full power down is enabled else false
*/
bool pld_is_full_power_down_enable(void);
#else
static inline int pld_set_suspend_mode(enum pld_suspend_mode mode)
{
return 0;
}
static inline bool pld_is_full_power_down_enable(void)
{
return false;
}
#endif
int pld_register_driver(struct pld_driver_ops *ops);
void pld_unregister_driver(void);

View File

@@ -145,39 +145,6 @@ int pld_set_mode(u8 mode)
return 0;
}
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
int pld_set_suspend_mode(enum pld_suspend_mode mode)
{
struct pld_context *pld_context;
int ret;
pld_context = pld_get_global_context();
if (!pld_context)
return -ENOMEM;
pld_context->suspend_mode = mode;
ret = pld_pcie_set_suspend_mode(mode);
return ret;
}
bool pld_is_full_power_down_enable(void)
{
struct pld_context *pld_context;
pld_context = pld_get_global_context();
if (!pld_context)
goto out;
if (pld_context->suspend_mode == PLD_FULL_POWER_DOWN)
return true;
out:
return false;
}
#endif
/**
* pld_get_global_context() - Get global context of PLD
*

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -34,7 +35,6 @@ struct pld_context {
struct list_head dev_list;
uint32_t pld_driver_state;
uint8_t mode;
enum pld_suspend_mode suspend_mode;
};
struct pld_context *pld_get_global_context(void);

View File

@@ -671,35 +671,6 @@ struct cnss_wlan_runtime_ops runtime_pm_ops = {
};
#endif
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
static enum cnss_suspend_mode pld_pcie_suspend_mode = CNSS_SUSPEND_LEGACY;
int pld_pcie_set_suspend_mode(enum pld_suspend_mode mode)
{
struct pld_context *pld_ctx = pld_get_global_context();
enum cnss_suspend_mode suspend_mode;
if (!pld_ctx)
return -ENOMEM;
switch (pld_ctx->suspend_mode) {
case PLD_SUSPEND:
suspend_mode = CNSS_SUSPEND_LEGACY;
break;
case PLD_FULL_POWER_DOWN:
suspend_mode = CNSS_SUSPEND_POWER_DOWN;
break;
default:
suspend_mode = CNSS_SUSPEND_LEGACY;
break;
}
pld_pcie_suspend_mode = suspend_mode;
return 0;
}
#endif
struct cnss_wlan_driver pld_pcie_ops = {
.name = PLD_PCIE_OPS_NAME,
.id_table = pld_pcie_id_table,
@@ -727,9 +698,6 @@ struct cnss_wlan_driver pld_pcie_ops = {
#ifdef FEATURE_GET_DRIVER_MODE
.get_driver_mode = pld_pcie_get_mode,
#endif
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
.suspend_mode = &pld_pcie_suspend_mode,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
.chip_version = CHIP_VERSION,
#endif

View File

@@ -138,23 +138,6 @@ static inline int pld_pcie_wlan_pm_control(struct device *dev, bool vote)
}
#endif
#ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
/**
* pld_pcie_set_suspend_mode() - Set current WLAN suspend mode
*
* This function is to set current wlan suspend mode for CNSS2
*
* Return: 0 for success
* Non zero failure code for errors
*/
int pld_pcie_set_suspend_mode(enum pld_suspend_mode mode);
#else
static inline int pld_pcie_set_suspend_mode(enum pld_suspend_mode mode)
{
return 0;
}
#endif
#ifndef CONFIG_PLD_PCIE_CNSS
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
static inline void *pld_pcie_smmu_get_domain(struct device *dev)