Revert "qcacld-3.0: Idle shutdown in suspend"
This reverts commit I08818517d05e7866d50e3f92cfdc9fa1a4d0e63f. New solution idle shutdown in suspend prepare is better. Change-Id: I76b1ef8e6f945bbcba3955ff625484ebee727670 CRs-Fixed: 3213236
This commit is contained in:

committed by
Madan Koyyalamudi

parent
6e1249d0ea
commit
3fbdeb8f84
@@ -175,13 +175,13 @@ enum powersave_mode {
|
|||||||
* @PMO_SUSPEND_NONE: Does not support suspend
|
* @PMO_SUSPEND_NONE: Does not support suspend
|
||||||
* @PMO_SUSPEND_LEGENCY: Legency PDEV suspend mode
|
* @PMO_SUSPEND_LEGENCY: Legency PDEV suspend mode
|
||||||
* @PMO_SUSPEND_WOW: WoW suspend mode
|
* @PMO_SUSPEND_WOW: WoW suspend mode
|
||||||
* @PMO_SUSPEND_SHUTDOWN: Shutdown suspend mode. Shutdown while suspend
|
* @PMO_FULL_POWER_DOWN: Full power down while suspend
|
||||||
*/
|
*/
|
||||||
enum pmo_suspend_mode {
|
enum pmo_suspend_mode {
|
||||||
PMO_SUSPEND_NONE = 0,
|
PMO_SUSPEND_NONE = 0,
|
||||||
PMO_SUSPEND_LEGENCY,
|
PMO_SUSPEND_LEGENCY,
|
||||||
PMO_SUSPEND_WOW,
|
PMO_SUSPEND_WOW,
|
||||||
PMO_SUSPEND_SHUTDOWN
|
PMO_FULL_POWER_DOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PMO_TARGET_SUSPEND_TIMEOUT (4000)
|
#define PMO_TARGET_SUSPEND_TIMEOUT (4000)
|
||||||
|
@@ -2113,9 +2113,6 @@ struct hdd_context {
|
|||||||
/* Flag keeps track of wiphy suspend/resume */
|
/* Flag keeps track of wiphy suspend/resume */
|
||||||
bool is_wiphy_suspended;
|
bool is_wiphy_suspended;
|
||||||
|
|
||||||
/* Flag keeps track of idle shutdown triggered by suspend */
|
|
||||||
bool shutdown_in_suspend;
|
|
||||||
|
|
||||||
#ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
|
#ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
|
||||||
struct qdf_periodic_work bus_bw_work;
|
struct qdf_periodic_work bus_bw_work;
|
||||||
int cur_vote_level;
|
int cur_vote_level;
|
||||||
@@ -5442,14 +5439,6 @@ static inline int hdd_set_suspend_mode(struct hdd_context *hdd_ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
* hdd_shutdown_wlan_in_suspend: shutdown wlan chip when suspend called
|
|
||||||
* @hdd_ctx: HDD context
|
|
||||||
*
|
|
||||||
* this function called by __wlan_hdd_cfg80211_suspend_wlan(), and it
|
|
||||||
* schedule idle shutdown work queue when no interface open.
|
|
||||||
*/
|
|
||||||
void hdd_shutdown_wlan_in_suspend(struct hdd_context *hdd_ctx);
|
|
||||||
|
|
||||||
#define HDD_DATA_STALL_ENABLE BIT(0)
|
#define HDD_DATA_STALL_ENABLE BIT(0)
|
||||||
#define HDD_HOST_STA_TX_TIMEOUT BIT(16)
|
#define HDD_HOST_STA_TX_TIMEOUT BIT(16)
|
||||||
|
@@ -18915,23 +18915,6 @@ int hdd_set_suspend_mode(struct hdd_context *hdd_ctx)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void hdd_shutdown_wlan_in_suspend(struct hdd_context *hdd_ctx)
|
|
||||||
{
|
|
||||||
/* schedule timeout cb as soon as possible */
|
|
||||||
#define SHUTDOWN_IN_SUSPEND_WAIT_TIMEOUT 0
|
|
||||||
/* prevent system suspend to let shutdown_restart work can be invoked */
|
|
||||||
#define SHUTDOWN_IN_SUSPEND_PREVENT_TIMEOUT 5
|
|
||||||
|
|
||||||
if (!hdd_is_any_interface_open(hdd_ctx)) {
|
|
||||||
qdf_delayed_work_start(&hdd_ctx->psoc_idle_timeout_work,
|
|
||||||
SHUTDOWN_IN_SUSPEND_WAIT_TIMEOUT);
|
|
||||||
hdd_prevent_suspend_timeout(SHUTDOWN_IN_SUSPEND_PREVENT_TIMEOUT,
|
|
||||||
WIFI_POWER_EVENT_WAKELOCK_DRIVER_IDLE_SHUTDOWN);
|
|
||||||
} else {
|
|
||||||
hdd_err("some adapter not stopped");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int hdd_driver_load(void)
|
int hdd_driver_load(void)
|
||||||
{
|
{
|
||||||
struct osif_driver_sync *driver_sync;
|
struct osif_driver_sync *driver_sync;
|
||||||
|
@@ -2469,7 +2469,6 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
|
|||||||
int rc;
|
int rc;
|
||||||
wlan_net_dev_ref_dbgid dbgid = NET_DEV_HOLD_CFG80211_SUSPEND_WLAN;
|
wlan_net_dev_ref_dbgid dbgid = NET_DEV_HOLD_CFG80211_SUSPEND_WLAN;
|
||||||
struct hdd_hostapd_state *hapd_state;
|
struct hdd_hostapd_state *hapd_state;
|
||||||
enum pmo_suspend_mode suspend_mode;
|
|
||||||
struct csr_del_sta_params params = {
|
struct csr_del_sta_params params = {
|
||||||
.peerMacAddr = QDF_MAC_ADDR_BCAST_INIT,
|
.peerMacAddr = QDF_MAC_ADDR_BCAST_INIT,
|
||||||
.reason_code = REASON_DEAUTH_NETWORK_LEAVING,
|
.reason_code = REASON_DEAUTH_NETWORK_LEAVING,
|
||||||
@@ -2493,20 +2492,14 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend_mode = ucfg_pmo_get_suspend_mode(hdd_ctx->psoc);
|
if (ucfg_pmo_get_suspend_mode(hdd_ctx->psoc) == PMO_SUSPEND_NONE) {
|
||||||
if (suspend_mode == PMO_SUSPEND_NONE) {
|
|
||||||
hdd_info_rl("Suspend is not supported");
|
hdd_info_rl("Suspend is not supported");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (suspend_mode == PMO_SUSPEND_SHUTDOWN) {
|
if (wlan_hdd_is_full_power_down_enable(hdd_ctx)) {
|
||||||
hdd_info_rl("Shutdown WLAN in Suspend");
|
hdd_debug("Driver will be shutdown; Skipping suspend");
|
||||||
hdd_ctx->shutdown_in_suspend = true;
|
return 0;
|
||||||
hdd_shutdown_wlan_in_suspend(hdd_ctx);
|
|
||||||
/* shutdown must be excute in active, so return -EAGAIN
|
|
||||||
* to PM to exit and try again
|
|
||||||
*/
|
|
||||||
return -EAGAIN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
||||||
@@ -2737,8 +2730,7 @@ static int _wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
|
|||||||
|
|
||||||
/* If Wifi is off, return success for system suspend */
|
/* If Wifi is off, return success for system suspend */
|
||||||
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
||||||
hdd_info("Driver Modules not Enabled");
|
hdd_debug("Driver Modules not Enabled ");
|
||||||
hdd_ctx->shutdown_in_suspend = false;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2787,8 +2779,7 @@ int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
|
|||||||
* the deadlock as idle shutdown waits for the dsc ops
|
* the deadlock as idle shutdown waits for the dsc ops
|
||||||
* to complete.
|
* to complete.
|
||||||
*/
|
*/
|
||||||
if (!hdd_ctx->shutdown_in_suspend)
|
hdd_psoc_idle_timer_stop(hdd_ctx);
|
||||||
hdd_psoc_idle_timer_stop(hdd_ctx);
|
|
||||||
|
|
||||||
errno = osif_psoc_sync_op_start(wiphy_dev(wiphy), &psoc_sync);
|
errno = osif_psoc_sync_op_start(wiphy_dev(wiphy), &psoc_sync);
|
||||||
if (errno)
|
if (errno)
|
||||||
|
Reference in New Issue
Block a user