qcacmn: Hold wakelock during Optional wifi dp
To prevent APPS from suspending hold a wakelock at the time of filter reserve and release at filter release. Change-Id: I5c15c50ccf2cebce677abd8ff6b568b7fafab49b CRs-Fixed: 3498105
This commit is contained in:

zatwierdzone przez
Rahul Choudhary

rodzic
4b0fb803fb
commit
5db38f1713
@@ -48,7 +48,7 @@ static inline bool wlan_ipa_uc_is_enabled(struct wlan_ipa_config *ipa_cfg)
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_ipa_is_opt_wifi_dp_enabled() - Is IPA optional wifi dp enabled?
|
||||
* wlan_ipa_is_opt_wifi_dp_enabled() - Is optional wifi dp enabled from WLAN
|
||||
* @ipa_cfg: IPA config
|
||||
*
|
||||
* Return: true if IPA opt wifi dp is enabled, false otherwise
|
||||
|
@@ -784,6 +784,7 @@ struct wlan_ipa_priv {
|
||||
#ifdef IPA_OPT_WIFI_DP
|
||||
struct wifi_dp_flt_setup dp_cce_super_rule_flt_param;
|
||||
qdf_event_t ipa_flt_evnt;
|
||||
qdf_wake_lock_t opt_dp_wake_lock;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@@ -4146,25 +4146,83 @@ static inline QDF_STATUS wlan_ipa_reg_flt_cbs(struct wlan_ipa_priv *ipa_ctx)
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_ipa_opt_dp_init() - Check if OPT_WIFI_DP enabled from both IPA
|
||||
* and WLAN, and perform required init steps
|
||||
* @ipa_ctx: IPA context
|
||||
*
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
static inline
|
||||
QDF_STATUS wlan_ipa_opt_dp_init(struct wlan_ipa_priv *ipa_ctx)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
/* Register call backs for opt wifi dp */
|
||||
if (ipa_ctx->opt_wifi_datapath) {
|
||||
if (ipa_config_is_opt_wifi_dp_enabled()) {
|
||||
status = wlan_ipa_reg_flt_cbs(ipa_ctx);
|
||||
ipa_info("opt_dp: Register flt cb. status %d", status);
|
||||
qdf_wake_lock_create(&ipa_ctx->opt_dp_wake_lock,
|
||||
"opt_dp");
|
||||
} else {
|
||||
ipa_info("opt_dp: Disabled from WLAN INI");
|
||||
}
|
||||
} else {
|
||||
ipa_info("opt_dp: Disabled from IPA");
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_ipa_destroy_opt_wifi_flt_cb_event - destroy filter cb event
|
||||
* @ipa_ctx: IPA context
|
||||
*
|
||||
*Return: void
|
||||
*/
|
||||
static inline void wlan_ipa_destroy_opt_wifi_flt_cb_event(
|
||||
struct wlan_ipa_priv *ipa_ctx)
|
||||
static inline
|
||||
void wlan_ipa_destroy_opt_wifi_flt_cb_event(struct wlan_ipa_priv *ipa_ctx)
|
||||
{
|
||||
qdf_event_destroy(&ipa_ctx->ipa_flt_evnt);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_ipa_opt_dp_deinit() - Perform opt_wifi_dp deinit steps
|
||||
* @ipa_ctx: IPA context
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline
|
||||
void wlan_ipa_opt_dp_deinit(struct wlan_ipa_priv *ipa_ctx)
|
||||
{
|
||||
if (ipa_ctx->uc_loaded)
|
||||
wlan_ipa_destroy_opt_wifi_flt_cb_event(ipa_ctx);
|
||||
|
||||
if (ipa_ctx->opt_wifi_datapath && ipa_config_is_opt_wifi_dp_enabled())
|
||||
qdf_wake_lock_destroy(&ipa_ctx->opt_dp_wake_lock);
|
||||
}
|
||||
|
||||
#else
|
||||
static inline QDF_STATUS wlan_ipa_reg_flt_cbs(struct wlan_ipa_priv *ipa_ctx)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline void wlan_ipa_destroy_opt_wifi_flt_cb_event(
|
||||
struct wlan_ipa_priv *ipa_ctx)
|
||||
static inline
|
||||
QDF_STATUS wlan_ipa_opt_dp_init(struct wlan_ipa_priv *ipa_ctx)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline
|
||||
void wlan_ipa_destroy_opt_wifi_flt_cb_event(struct wlan_ipa_priv *ipa_ctx)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wlan_ipa_opt_dp_deinit(struct wlan_ipa_priv *ipa_ctx)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -4276,18 +4334,7 @@ QDF_STATUS wlan_ipa_setup(struct wlan_ipa_priv *ipa_ctx,
|
||||
goto ipa_wdi_destroy;
|
||||
}
|
||||
|
||||
/* Register call backs for opt wifi dp */
|
||||
if (ipa_ctx->opt_wifi_datapath) {
|
||||
if (ipa_config_is_opt_wifi_dp_enabled()) {
|
||||
status = wlan_ipa_reg_flt_cbs(ipa_ctx);
|
||||
ipa_info("opt_dp: Register cb. status %d",
|
||||
status);
|
||||
} else {
|
||||
ipa_info("opt_dp: Disabled from WLAN INI");
|
||||
}
|
||||
} else {
|
||||
ipa_info("opt_dp: Disabled from IPA");
|
||||
}
|
||||
status = wlan_ipa_opt_dp_init(ipa_ctx);
|
||||
|
||||
qdf_event_create(&ipa_ctx->ipa_resource_comp);
|
||||
|
||||
@@ -4356,8 +4403,7 @@ QDF_STATUS wlan_ipa_cleanup(struct wlan_ipa_priv *ipa_ctx)
|
||||
if (!wlan_ipa_uc_is_enabled(ipa_ctx->config))
|
||||
wlan_ipa_teardown_sys_pipe(ipa_ctx);
|
||||
|
||||
if (ipa_ctx->uc_loaded)
|
||||
wlan_ipa_destroy_opt_wifi_flt_cb_event(ipa_ctx);
|
||||
wlan_ipa_opt_dp_deinit(ipa_ctx);
|
||||
|
||||
/* Teardown IPA sys_pipe for MCC */
|
||||
if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config)) {
|
||||
@@ -5074,6 +5120,13 @@ int wlan_ipa_wdi_opt_dpath_flt_rsrv_cb(
|
||||
|
||||
pdev = ipa_obj->pdev;
|
||||
pdev_id = ipa_obj->dp_pdev_id;
|
||||
|
||||
/* Hold wakelock */
|
||||
qdf_wake_lock_acquire(&ipa_obj->opt_dp_wake_lock,
|
||||
WIFI_POWER_EVENT_WAKELOCK_OPT_WIFI_DP);
|
||||
qdf_pm_system_wakeup();
|
||||
ipa_info("opt_dp: Wakelock acquired");
|
||||
|
||||
/* Disable Low power features before filter reservation */
|
||||
ipa_info("opt_dp: Disable low power features to reserve filter");
|
||||
param_val = 0;
|
||||
@@ -5367,7 +5420,9 @@ void wlan_ipa_wdi_opt_dpath_notify_flt_rlsd(int flt0_rslt, int flt1_rslt)
|
||||
uc_op_work = &ipa_ctx->uc_op_work[WLAN_IPA_FILTER_REL_NOTIFY];
|
||||
uc_op_work->msg = msg;
|
||||
qdf_sched_work(0, &uc_op_work->work);
|
||||
ipa_info("opt_dp: sched flt_rel notify is_success: %d", msg->rsvd);
|
||||
qdf_wake_lock_release(&ipa_ctx->opt_dp_wake_lock,
|
||||
WIFI_POWER_EVENT_WAKELOCK_OPT_WIFI_DP);
|
||||
ipa_info("opt_dp: Wakelock released");
|
||||
}
|
||||
|
||||
void wlan_ipa_wdi_opt_dpath_notify_flt_add_rem_cb(int flt0_rslt, int flt1_rslt)
|
||||
|
Reference in New Issue
Block a user