mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
Merge d071e6b448 on remote branch
Change-Id: I51f809836cd5164733513af2eeaa8610f61cf35f
This commit is contained in:
commit
eab1468cc3
4 changed files with 49 additions and 14 deletions
|
|
@ -3,6 +3,7 @@ RMNET_CORE_DLKM_PLATFORMS_LIST := lahaina
|
|||
RMNET_CORE_DLKM_PLATFORMS_LIST += holi
|
||||
RMNET_CORE_DLKM_PLATFORMS_LIST += monaco
|
||||
RMNET_CORE_DLKM_PLATFORMS_LIST += monaco_go
|
||||
RMNET_CORE_DLKM_PLATFORMS_LIST += monaco_go_aon
|
||||
|
||||
ifeq ($(call is-board-platform-in-list, $(RMNET_CORE_DLKM_PLATFORMS_LIST)),true)
|
||||
#Make file to create RMNET_CORE DLKM
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
|
@ -53,7 +53,8 @@ unsigned int rmnet_wq_frequency __read_mostly = 1000;
|
|||
#define PS_INTERVAL (((!rmnet_wq_frequency) ? \
|
||||
1 : rmnet_wq_frequency/10) * (HZ/100))
|
||||
#define NO_DELAY (0x0000 * HZ)
|
||||
#define PS_INTERVAL_KT (ms_to_ktime(1000))
|
||||
#define PS_INTERVAL_MS (1000)
|
||||
#define PS_INTERVAL_KT (ms_to_ktime(PS_INTERVAL_MS))
|
||||
#define WATCHDOG_EXPIRE_JF (msecs_to_jiffies(50))
|
||||
|
||||
#ifdef CONFIG_QTI_QMI_DFC
|
||||
|
|
@ -622,6 +623,7 @@ qmi_rmnet_setup_client(void *port, struct qmi_info *qmi, struct tcmsg *tcm)
|
|||
if (!qmi)
|
||||
return -ENOMEM;
|
||||
|
||||
qmi->ws = wakeup_source_register(NULL, "RMNET_DFC");
|
||||
rmnet_init_qmi_pt(port, qmi);
|
||||
}
|
||||
|
||||
|
|
@ -670,6 +672,7 @@ __qmi_rmnet_delete_client(void *port, struct qmi_info *qmi, int idx)
|
|||
|
||||
if (!qmi_rmnet_has_client(qmi) && !qmi_rmnet_has_pending(qmi)) {
|
||||
rmnet_reset_qmi_pt(port);
|
||||
wakeup_source_unregister(qmi->ws);
|
||||
kfree(qmi);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -739,6 +742,7 @@ void qmi_rmnet_change_link(struct net_device *dev, void *port, void *tcm_pt)
|
|||
!qmi_rmnet_has_client(qmi) &&
|
||||
!qmi_rmnet_has_pending(qmi)) {
|
||||
rmnet_reset_qmi_pt(port);
|
||||
wakeup_source_unregister(qmi->ws);
|
||||
kfree(qmi);
|
||||
}
|
||||
} else if (tcm->tcm_ifindex & FLAG_POWERSAVE_MASK) {
|
||||
|
|
@ -1142,6 +1146,22 @@ static enum alarmtimer_restart qmi_rmnet_work_alarm(struct alarm *atimer,
|
|||
return ALARMTIMER_NORESTART;
|
||||
}
|
||||
|
||||
static void dfc_wakelock_acquire(struct qmi_info *qmi)
|
||||
{
|
||||
if (qmi && !qmi->wakelock_active) {
|
||||
__pm_stay_awake(qmi->ws);
|
||||
qmi->wakelock_active = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void dfc_wakelock_release(struct qmi_info *qmi)
|
||||
{
|
||||
if (qmi && qmi->wakelock_active) {
|
||||
__pm_relax(qmi->ws);
|
||||
qmi->wakelock_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
static void qmi_rmnet_check_stats(struct work_struct *work)
|
||||
{
|
||||
struct rmnet_powersave_work *real_work;
|
||||
|
|
@ -1161,6 +1181,17 @@ static void qmi_rmnet_check_stats(struct work_struct *work)
|
|||
if (unlikely(!qmi))
|
||||
return;
|
||||
|
||||
dfc_wakelock_release(qmi);
|
||||
|
||||
rmnet_get_packets(real_work->port, &rx, &tx);
|
||||
rxd = rx - real_work->old_rx_pkts;
|
||||
txd = tx - real_work->old_tx_pkts;
|
||||
real_work->old_rx_pkts = rx;
|
||||
real_work->old_tx_pkts = tx;
|
||||
|
||||
dl_msg_active = qmi->dl_msg_active;
|
||||
qmi->dl_msg_active = false;
|
||||
|
||||
if (qmi->ps_enabled) {
|
||||
|
||||
/* Ready to accept grant */
|
||||
|
|
@ -1181,15 +1212,6 @@ static void qmi_rmnet_check_stats(struct work_struct *work)
|
|||
goto end;
|
||||
}
|
||||
|
||||
rmnet_get_packets(real_work->port, &rx, &tx);
|
||||
rxd = rx - real_work->old_rx_pkts;
|
||||
txd = tx - real_work->old_tx_pkts;
|
||||
real_work->old_rx_pkts = rx;
|
||||
real_work->old_tx_pkts = tx;
|
||||
|
||||
dl_msg_active = qmi->dl_msg_active;
|
||||
qmi->dl_msg_active = false;
|
||||
|
||||
if (!rxd && !txd) {
|
||||
/* If no DL msg received and there is a flow disabled,
|
||||
* (likely in RLF), no need to enter powersave
|
||||
|
|
@ -1223,12 +1245,19 @@ static void qmi_rmnet_check_stats(struct work_struct *work)
|
|||
end:
|
||||
rcu_read_lock();
|
||||
if (!rmnet_work_quit) {
|
||||
if (use_alarm_timer)
|
||||
if (use_alarm_timer) {
|
||||
/* Suspend will fail and get delayed for 2s if
|
||||
* alarmtimer expires within 2s. Hold a wakelock
|
||||
* for the actual timer duration to prevent suspend
|
||||
*/
|
||||
if (PS_INTERVAL_MS < 2000)
|
||||
dfc_wakelock_acquire(qmi);
|
||||
alarm_start_relative(&real_work->atimer,
|
||||
PS_INTERVAL_KT);
|
||||
else
|
||||
} else {
|
||||
queue_delayed_work(rmnet_ps_wq, &real_work->work,
|
||||
PS_INTERVAL);
|
||||
}
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
|
@ -1306,6 +1335,7 @@ void qmi_rmnet_work_exit(void *port)
|
|||
rmnet_ps_wq = NULL;
|
||||
kfree(rmnet_work);
|
||||
rmnet_work = NULL;
|
||||
dfc_wakelock_release((struct qmi_info *)rmnet_get_qmi_pt(port));
|
||||
}
|
||||
EXPORT_SYMBOL(qmi_rmnet_work_exit);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/netdevice.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/pm_wakeup.h>
|
||||
|
||||
#define MAX_MQ_NUM 16
|
||||
#define MAX_CLIENT_NUM 2
|
||||
|
|
@ -107,6 +108,8 @@ struct qmi_info {
|
|||
bool ps_enabled;
|
||||
bool dl_msg_active;
|
||||
bool ps_ignore_grant;
|
||||
bool wakelock_active;
|
||||
struct wakeup_source *ws;
|
||||
};
|
||||
|
||||
enum data_ep_type_enum_v01 {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ DATA_DLKM_BOARD_PLATFORMS_LIST := lahaina
|
|||
DATA_DLKM_BOARD_PLATFORMS_LIST += holi
|
||||
DATA_DLKM_BOARD_PLATFORMS_LIST += monaco
|
||||
DATA_DLKM_BOARD_PLATFORMS_LIST += monaco_go
|
||||
DATA_DLKM_BOARD_PLATFORMS_LIST += monaco_go_aon
|
||||
ifneq ($(TARGET_BOARD_AUTO),true)
|
||||
ifeq ($(call is-board-platform-in-list,$(DATA_DLKM_BOARD_PLATFORMS_LIST)),true)
|
||||
BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/rmnet_core.ko
|
||||
|
|
|
|||
Loading…
Reference in a new issue