dfc: release WDA client eariler

During SSR, release QMI WDA client before waiting for transaction
to expire to reduce wait time.

Change-Id: I1e60e3830e82f59a86d9d088840f8e1df80e6065
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
Subash Abhinov Kasiviswanathan 2020-10-27 13:44:13 -07:00
commit 398da54894
3 changed files with 20 additions and 3 deletions

View file

@ -708,6 +708,7 @@ void qmi_rmnet_change_link(struct net_device *dev, void *port, void *tcm_pt)
{
struct qmi_info *qmi = (struct qmi_info *)rmnet_get_qmi_pt(port);
struct tcmsg *tcm = (struct tcmsg *)tcm_pt;
void *wda_data = NULL;
switch (tcm->tcm_family) {
case NLMSG_FLOW_ACTIVATE:
@ -750,6 +751,11 @@ void qmi_rmnet_change_link(struct net_device *dev, void *port, void *tcm_pt)
return;
if (tcm->tcm_handle == 0) { /* instance 0 */
rmnet_clear_powersave_format(port);
if (qmi->wda_client)
wda_data = qmi->wda_client;
else if (qmi->wda_pending)
wda_data = qmi->wda_pending;
wda_qmi_client_release(wda_data);
qmi_rmnet_work_exit(port);
}
qmi_rmnet_delete_client(port, qmi, tcm);
@ -780,13 +786,14 @@ void qmi_rmnet_qmi_exit(void *qmi_pt, void *port)
ASSERT_RTNL();
qmi_rmnet_work_exit(port);
if (qmi->wda_client)
data = qmi->wda_client;
else if (qmi->wda_pending)
data = qmi->wda_pending;
wda_qmi_client_release(data);
qmi_rmnet_work_exit(port);
if (data) {
wda_qmi_client_exit(data);
qmi->wda_client = NULL;

View file

@ -224,6 +224,7 @@ wda_qmi_client_init(void *port, struct svc_info *psvc, struct qmi_info *qmi);
void wda_qmi_client_exit(void *wda_data);
int wda_set_powersave_mode(void *wda_data, u8 enable);
void qmi_rmnet_flush_ps_wq(void);
void wda_qmi_client_release(void *wda_data);
#else
static inline int
wda_qmi_client_init(void *port, struct svc_info *psvc, struct qmi_info *qmi)
@ -242,5 +243,8 @@ static inline int wda_set_powersave_mode(void *wda_data, u8 enable)
static inline void qmi_rmnet_flush_ps_wq(void)
{
}
static inline void wda_qmi_client_release(void *wda_data)
{
}
#endif
#endif /*_RMNET_QMI_I_H*/

View file

@ -461,7 +461,6 @@ void wda_qmi_client_exit(void *wda_data)
data->restart_state = 1;
trace_wda_client_state_down(0);
qmi_handle_release(&data->handle);
destroy_workqueue(data->wda_wq);
kfree(data);
}
@ -471,3 +470,10 @@ int wda_set_powersave_mode(void *wda_data, uint8_t enable)
trace_wda_set_powersave_mode(enable);
return wda_set_powersave_mode_req(wda_data, enable);
}
void wda_qmi_client_release(void *wda_data)
{
if (!wda_data)
return;
qmi_handle_release(&((struct wda_qmi_data *)wda_data)->handle);
}