From 898151cd02089e25b6cc187388239b82872bd514 Mon Sep 17 00:00:00 2001 From: Chris Lew Date: Tue, 27 Oct 2020 13:54:52 -0700 Subject: [PATCH 1/2] net: qrtr: Make wakeup timeout configurable The qrtr driver can guarantee that the packet gets queued to the socket but cannot guarantee the client process will get time to run if auto sleep is enabled. This config will help mitigate missed packets on systems where auto sleep is too aggressive. Use the pm_wakeup_ws_event() api so a hard wakeup can be specified. This will ensure a resume occurs if the data coming in happens while the device is going into suspend. Change-Id: Ic596e06e585b3479a6faa1d0210c016fc9138c6e Signed-off-by: Chris Lew Signed-off-by: Arun Prakash --- net/qrtr/Kconfig | 11 +++++++++++ net/qrtr/qrtr.c | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/net/qrtr/Kconfig b/net/qrtr/Kconfig index 8b9d3c2eaeb3..957e3fc7c86e 100644 --- a/net/qrtr/Kconfig +++ b/net/qrtr/Kconfig @@ -14,6 +14,17 @@ config QRTR if QRTR +config QRTR_WAKEUP_MS + int "QRTR Wakeup timeout" + default 0 + help + This option is used to configure the wakesource timeout that QRTR + should take when a packet is received. The qrtr driver can guarantee + that the packet gets queued to the socket but cannot guarantee the + client process will get time to run if auto sleep is enabled. This + config will help mitigate missed packets on systems where auto sleep + is aggressive. + config QRTR_SMD tristate "SMD IPC Router channels" depends on RPMSG || (COMPILE_TEST && RPMSG=n) diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index e8f5bb848ee9..e602addc959e 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -123,6 +123,7 @@ static inline struct qrtr_sock *qrtr_sk(struct sock *sk) } static unsigned int qrtr_local_nid = 1; +static unsigned int qrtr_wakeup_ms = CONFIG_QRTR_WAKEUP_MS; /* for node ids */ static RADIX_TREE(qrtr_nodes, GFP_KERNEL); @@ -843,7 +844,7 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) cb->type != QRTR_TYPE_RESUME_TX) goto err; - pm_wakeup_ws_event(node->ws, 0, true); + pm_wakeup_ws_event(node->ws, qrtr_wakeup_ms, true); skb->data_len = size; skb->len = size; From 3acc60ff8fe0315eeb5b0c1232d6b5a2a0943147 Mon Sep 17 00:00:00 2001 From: Sarannya S Date: Fri, 3 Sep 2021 13:36:29 +0530 Subject: [PATCH 2/2] arm64: defconfig: Set qrtr wakeup for lito Set the wakeup timeout for qrtr to 500 ms for lito. This change will help ensure the TUI client thread gets a chance to run before the system is suspended again. Change-Id: I8c8831995bf58fc39a3e8c107d0fd761745bbfed Signed-off-by: Sarannya S --- arch/arm64/configs/vendor/lito-perf_defconfig | 1 + arch/arm64/configs/vendor/lito_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/configs/vendor/lito-perf_defconfig b/arch/arm64/configs/vendor/lito-perf_defconfig index 4de4b421a731..ebd9b748aabb 100644 --- a/arch/arm64/configs/vendor/lito-perf_defconfig +++ b/arch/arm64/configs/vendor/lito-perf_defconfig @@ -259,6 +259,7 @@ CONFIG_NET_ACT_MIRRED=y CONFIG_NET_ACT_SKBEDIT=y CONFIG_DNS_RESOLVER=y CONFIG_QRTR=y +CONFIG_QRTR_WAKEUP_MS=500 CONFIG_QRTR_SMD=y CONFIG_QRTR_MHI=y CONFIG_BPF_JIT=y diff --git a/arch/arm64/configs/vendor/lito_defconfig b/arch/arm64/configs/vendor/lito_defconfig index 98aae59ee8dd..e45f42887e4c 100644 --- a/arch/arm64/configs/vendor/lito_defconfig +++ b/arch/arm64/configs/vendor/lito_defconfig @@ -265,6 +265,7 @@ CONFIG_NET_ACT_MIRRED=y CONFIG_NET_ACT_SKBEDIT=y CONFIG_DNS_RESOLVER=y CONFIG_QRTR=y +CONFIG_QRTR_WAKEUP_MS=500 CONFIG_QRTR_SMD=y CONFIG_QRTR_MHI=y CONFIG_BPF_JIT=y