lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGoOwPSCQF9WC=jhV79wnqDQ-puL+=yuF1u1oEpomZU9FRzBbA@mail.gmail.com>
Date:   Thu, 8 Sep 2022 13:32:32 -0700
From:   Nicolin Chen <nicoleotsuka@...il.com>
To:     Shengjiu Wang <shengjiu.wang@....com>
Cc:     Xiubo.Lee@...il.com, festevam@...il.com, shengjiu.wang@...il.com,
        lgirdwood@...il.com, broonie@...nel.org, perex@...ex.cz,
        tiwai@...e.com, alsa-devel@...a-project.org,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ASoC: fsl_asrc: Add initialization finishing check in
 runtime resume

On Tue, Sep 6, 2022 at 8:20 PM Shengjiu Wang <shengjiu.wang@....com> 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@....com>

Some nitpicks inline.

Otherwise,
Reviewed-by: Nicolin Chen <nicolinc@...il.com>

> @@ -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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ