From 37baed62f6318b44eb386dd69eba06fd2a00dede Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Mon, 17 Dec 2018 16:19:32 +0800 Subject: MLK-18182: ASoC: fsl_asrc: increase the retry times When 3 asrc pair are working in parallel, there will be error log randomly output DMA task timeout fsl-asrc 2034000.asrc: Pair B: failed to process buffer: -62 The reason is that the initialization is not finished for some pair, the prefill data is failed to be input in FIFO. The patch is to increase the retry times to make sure that initialization is success. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sound/soc/fsl/fsl_asrc.c') diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 1daf6b611e13..3e69ba34d352 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -485,7 +485,7 @@ static void fsl_asrc_start_pair(struct fsl_asrc_pair *pair) { struct fsl_asrc *asrc_priv = pair->asrc_priv; enum asrc_pair_index index = pair->index; - int reg, retry = 10, i; + int reg, retry = 50, i; /* Enable the current pair */ regmap_update_bits(asrc_priv->regmap, REG_ASRCTR, @@ -498,6 +498,9 @@ static void fsl_asrc_start_pair(struct fsl_asrc_pair *pair) reg &= ASRCFG_INIRQi_MASK(index); } while (!reg && --retry); + if (retry == 0) + pair_warn("initialization is not finished\n"); + /* Make the input fifo to ASRC STALL level */ regmap_read(asrc_priv->regmap, REG_ASRCNCR, ®); for (i = 0; i < pair->channels * 4; i++) @@ -1156,7 +1159,7 @@ static int fsl_asrc_runtime_resume(struct device *dev) int i, ret; u32 asrctr; u32 reg; - int retry = 10; + int retry = 50; ret = clk_prepare_enable(asrc_priv->mem_clk); if (ret) @@ -1200,6 +1203,9 @@ static int fsl_asrc_runtime_resume(struct device *dev) reg = (reg >> ASRCFG_INIRQi_SHIFT(0)) & 0x7; } while (!(reg == ((asrctr & 0xE) >> 1)) && --retry); + if (retry == 0) + dev_warn(dev, "initialization is not finished\n"); + return 0; disable_asrck_clk: -- cgit v1.2.3