From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E89BCECAAD3 for ; Tue, 6 Sep 2022 02:58:52 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4MM97v3XKcz303P for ; Tue, 6 Sep 2022 12:58:51 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lW+LPTis; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::132; helo=mail-lf1-x132.google.com; envelope-from=shengjiu.wang@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lW+LPTis; dkim-atps=neutral Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MM7jl0w7hz2xCd for ; Tue, 6 Sep 2022 11:54:34 +1000 (AEST) Received: by mail-lf1-x132.google.com with SMTP id z6so15206994lfu.9 for ; Mon, 05 Sep 2022 18:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=zcTwaijpd2111xsDdervpJH9/9EDsphYRA2s0wo+LWI=; b=lW+LPTisK5EL83PlNfwHIRgyD85NBZqOEhnGqWrhWcjI4xy7mDs6KH+ClAngeTn3mQ o41+m6JMXXfnI3z7rXvvpHApZi2olOFeCTWeErVjcYbzHcnRO274gIKW9id9dk3LXBnh bbfcWOdXFd8ZBVd7IeBMigdDleaCs9ntPhGI05yA60yusbVBl/jJ/jUNgUFmratMpVWu o5+vAGEvo1bogvKe/e1urzLcG9AROxbJsvBd9Y7NGwPMgz/qKTRuHDO7U0IbosJy5W3b PgPP2rZdU0VwXPD/iKieDymxIIU7vbLOHdmY/5OhVO1y9fem2WppQEMcZ7nY5mXXR8kF K6/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=zcTwaijpd2111xsDdervpJH9/9EDsphYRA2s0wo+LWI=; b=InO+p2/deZ++4kbxBPIENvCwAfMqGMPi/ykNZaC+tG8ThPIwYPVMtFcpn2Rc3Y0R10 DV+0Xt0RNTtK1bytJaRsMbFyIRmGkNtqLDQhFmQ8Nk1ZbKh5gvBtA0/dIGf9sevC8wBs h58U/yL8TKAFLh2Qp9vYlcXVnkQKCZASm1yJJ+PnmS5T1t/DikAGQLnxMuS0yImOwtUR iF7xyKqajdkc9CxB+966HJSRRXfrkfYYjkKRAucCGaS/2do6B3pCRxaiqAox4M92FnET kbchzzwbBV132GoloQ+LRl2T085BoQ0ndcNRqcLLbyEbOlI/xpMI672OvxQTGqoE3XS/ EGsA== X-Gm-Message-State: ACgBeo3Oy2d82Xlokb3liYCjfe9cYepy3a+k0/xZwpRBvGP+J8e39WDf NNFZwm8tH54eMW/EpEX0VZvSxX/AwMgOvFp0ii8= X-Google-Smtp-Source: AA6agR6rpzNvrgDBOH7xaVDM/+HbHO0nMeVMUOH9wH2pSgnS+vmy/lSZkWXIl5pFi/oGBhvCu4veg5fAaBqtC69FIqE= X-Received: by 2002:a05:6512:2211:b0:496:7767:28b with SMTP id h17-20020a056512221100b004967767028bmr1252696lfu.433.1662429268454; Mon, 05 Sep 2022 18:54:28 -0700 (PDT) MIME-Version: 1.0 References: <1662373788-19561-1-git-send-email-shengjiu.wang@nxp.com> In-Reply-To: From: Shengjiu Wang Date: Tue, 6 Sep 2022 09:54:16 +0800 Message-ID: Subject: Re: [PATCH] ASoC: fsl_asrc: Add initialization finishing check in runtime resume To: Nicolin Chen Content-Type: multipart/alternative; boundary="00000000000002b05305e7f87ac3" X-Mailman-Approved-At: Tue, 06 Sep 2022 12:58:15 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Xiubo Li , linuxppc-dev , Shengjiu Wang , Takashi Iwai , Liam Girdwood , Jaroslav Kysela , Mark Brown , Fabio Estevam , linux-kernel Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" --00000000000002b05305e7f87ac3 Content-Type: text/plain; charset="UTF-8" On Mon, Sep 5, 2022 at 9:15 PM Nicolin Chen wrote: > On Mon, Sep 5, 2022 at 3:47 AM Shengjiu Wang > wrote: > > @@ -1295,6 +1301,17 @@ 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 */ > > + do { > > + udelay(5); > > + regmap_read(asrc->regmap, REG_ASRCFG, ®); > > + reg = (reg >> ASRCFG_INIRQi_SHIFT(0)) & 0x7; > > + } while ((reg != ((asrctr >> ASRCTR_ASRCEi_SHIFT(0)) & 0x7)) && > --retry); > > + > > + /* FIXME: Doesn't treat initialization timeout as error */ > > + if (!retry) > > + dev_warn(dev, "initialization isn't finished\n"); > > Any reason why not just dev_err? Just hesitate to use dev_err. if use dev_err, then should return an error. May one of the pairs is finished, it still can continue. Best regards Wang Shengjiu --00000000000002b05305e7f87ac3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Sep 5, 2022 at 9:15 PM Nicoli= n Chen <nicoleotsuka@gmail.com= > wrote:
= On Mon, Sep 5, 2022 at 3:47 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote:
> @@ -1295,6 +1301,17 @@ static int fsl_asrc_runtime_resume(struct devic= e *dev)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0regmap_update_bits(asrc->regmap, R= EG_ASRCTR,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ASRCTR_ASRCEi_ALL_MASK, asrctr);
>
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Wait for status of initialization for e= very enabled pairs */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0do {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0udelay(5);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0regmap_read(as= rc->regmap, REG_ASRCFG, &reg);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0reg =3D (reg &= gt;> ASRCFG_INIRQi_SHIFT(0)) & 0x7;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0} while ((reg !=3D ((asrctr >> ASRCT= R_ASRCEi_SHIFT(0)) & 0x7)) && --retry);
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* FIXME: Doesn't treat initialization= timeout as error */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!retry)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dev_warn(dev, = "initialization isn't finished\n");

Any reason why not just dev_err?
=C2=A0
Just hes= itate=C2=A0to use dev_err. if use dev_err, then should return an error.
May one of the pairs is finished, it still can continue.
<= br>
Best regards
Wang Shengjiu


=C2=A0
--00000000000002b05305e7f87ac3--