From ce4f3d9b5905012ff99b69985ed91a2763211ad4 Mon Sep 17 00:00:00 2001 From: Aditya Bavanari Date: Thu, 20 Dec 2018 20:24:33 +0530 Subject: [PATCH] asoc: codecs: Increase timeout for session close during SSR/PDR Userspace takes 10 seconds to close the session when pcm_start fails due to concurrency with PDR/SSR. Match the SSR timeout in va macro to user space session tear down delay. Change-Id: I1e0fb4bdb25a43cbe7c345a47c115410b964e6eb Signed-off-by: Aditya Bavanari --- asoc/codecs/bolero/va-macro.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/asoc/codecs/bolero/va-macro.c b/asoc/codecs/bolero/va-macro.c index db078e2a6cdf..cee0e002a0f1 100644 --- a/asoc/codecs/bolero/va-macro.c +++ b/asoc/codecs/bolero/va-macro.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. */ #include @@ -41,7 +41,7 @@ #define VA_MACRO_TX_DMIC_CLK_DIV_SHFT 0x01 #define BOLERO_CDC_VA_TX_UNMUTE_DELAY_MS 40 -#define MAX_RETRY_ATTEMPTS 250 +#define MAX_RETRY_ATTEMPTS 500 static const DECLARE_TLV_DB_SCALE(digital_gain, 0, 1, 0); static int va_tx_unmute_delay = BOLERO_CDC_VA_TX_UNMUTE_DELAY_MS; @@ -225,12 +225,15 @@ static int va_macro_event_handler(struct snd_soc_component *component, switch (event) { case BOLERO_MACRO_EVT_WAIT_VA_CLK_RESET: while ((va_priv->va_mclk_users != 0) && (retry_cnt != 0)) { - dev_dbg(va_dev, "%s:retry_cnt: %d\n", + dev_dbg_ratelimited(va_dev, "%s:retry_cnt: %d\n", __func__, retry_cnt); /* - * loop and check every 20ms for va_mclk user count - * to get reset to 0 which ensures userspace teardown - * is done and SSR powerup seq can proceed. + * Userspace takes 10 seconds to close + * the session when pcm_start fails due to concurrency + * with PDR/SSR. Loop and check every 20ms till 10 + * seconds for va_mclk user count to get reset to 0 + * which ensures userspace teardown is done and SSR + * powerup seq can proceed. */ msleep(20); retry_cnt--;