Re: [PATCH v2] ASoC: fsl_asrc: Add initialization finishing check in runtime resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 6, 2022 at 8:20 PM Shengjiu Wang <shengjiu.wang@xxxxxxx> wrote:
>
> If the initialization is not finished, then filling input data to
> the FIFO may fail. So it is better to add initialization finishing
> check in the runtime resume for suspend & resume case.
>
> And consider the case of three instances working in parallel,
> increase the retry times to 50 for more initialization time.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@xxxxxxx>

Some nitpicks inline.

Otherwise,
Reviewed-by: Nicolin Chen <nicolinc@xxxxxxxxx>

> @@ -20,6 +20,7 @@
>
>  #define IDEAL_RATIO_DECIMAL_DEPTH 26
>  #define DIVIDER_NUM  64
> +#define INIT_TRY_NUM 50

s/TRY/RETRY

> @@ -592,6 +593,10 @@ static void fsl_asrc_start_pair(struct fsl_asrc_pair *pair)
>                 reg &= ASRCFG_INIRQi_MASK(index);
>         } while (!reg && --retry);
>
> +       /* NOTE: Doesn't treat initialization timeout as error */

s/as error/as an error

> +       if (!retry)
> +               dev_warn(&asrc->pdev->dev, "initialization isn't finished\n");

Could print which pair; or perhaps pair_warn?

> @@ -1295,6 +1301,20 @@ static int fsl_asrc_runtime_resume(struct device *dev)
>         regmap_update_bits(asrc->regmap, REG_ASRCTR,
>                            ASRCTR_ASRCEi_ALL_MASK, asrctr);
>
> +       /* Wait for status of initialization for every enabled pairs */

s/every/all

> +       do {
> +               udelay(5);
> +               regmap_read(asrc->regmap, REG_ASRCFG, &reg);
> +               reg = (reg >> ASRCFG_INIRQi_SHIFT(0)) & 0x7;
> +       } while ((reg != ((asrctr >> ASRCTR_ASRCEi_SHIFT(0)) & 0x7)) && --retry);
> +
> +       /*
> +        * NOTE: Doesn't treat initialization timeout as error

s/as error/as an error/

> +        * Some of pair maybe success, then still can continue.

+        * Some of the pairs may succeed, then still can continue.

> +        */
> +       if (!retry)
> +               dev_warn(dev, "initialization isn't finished\n");

Could print which pair.



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux