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 X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C75EEC43463 for ; Sun, 20 Sep 2020 20:07:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72B44206B7 for ; Sun, 20 Sep 2020 20:07:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Z9R8r25D"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Bd8j3+i2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72B44206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C64B41673; Sun, 20 Sep 2020 22:06:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C64B41673 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1600632421; bh=hCwVHbukvDaf8SGiVbk6ZXPv0A/iqqQHVOAJ7mjOuHk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Z9R8r25DXLz/yk2TrwbvJmcH7X40UCdnvklvMt02a4f82QGEW3OuBfjTnrpRur3pc Khdy6tE06gF3+o4NL+Kjia3JoWV8YEbS4ApC9jrEqcO8D/mnXT3BMOmF7+5mdLo/F5 MDpEDg4dqSxSiAlfLiqfgdkt82/xlqaHMwzj6f3k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 55B68F80229; Sun, 20 Sep 2020 22:06:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A8C8BF80232; Sun, 20 Sep 2020 22:06:09 +0200 (CEST) Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3191EF801EC for ; Sun, 20 Sep 2020 22:06:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3191EF801EC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Bd8j3+i2" Received: by mail-il1-x143.google.com with SMTP id t13so11699416ile.9 for ; Sun, 20 Sep 2020 13:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wP4gZRkOAWgiW0xnyA5/8lMVxtrC05P+MT5wMJXn4Ks=; b=Bd8j3+i27Pi1JS6swpqa39XxIyg0FnZZehxsQB73iY8qx/SIdpXwyAUGFpNpx96Gso dd9ZVKY8Nme0wkY9hzNyw5MO8P5F6knorU7JkKKpSE/Vx8N/CRiRqsO0YRP535/8UJet SFJfTzgprcgbI/OODHFMJYR7yJ5gx04jPohWq9haKdZA6VrpVQz6z4/N4RSVroJoYv0X z+HkA+WgVdpDWBusI2arko6gwI9AVmhiuRToSvB8KMCWFxpHXbcbpzvWJI0YYCJuX9bJ 4MkTJZJdirUOJbP71WkN0dIY0xNzvXwdDmXtw7l4ssBeVBNFy9VRD2vioJj25AFeT6Oh P9Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wP4gZRkOAWgiW0xnyA5/8lMVxtrC05P+MT5wMJXn4Ks=; b=pKLqmyADFzyxqTtDSWkzseIn4Mm5ICfDCnG33drT0mjOm1mVAQTRuBY4RkaUQw/nLc OMLPfOncCyuZmVmJeOlnrAzsSr8mXoCnxSEQWTwbxShYRkwzCz5VcwxMQfhG9hnNv/zy FlUKuA240yizFJ49f8bSBxCB5qhQKw8y4e0zT1DZ6JTU8VTxlJMDX7qYJtfIIeyG9o1s VrnoR6ju5q6ADbssUfIP/PA775bSpIb/aExKcnrHHsiGuHf2rbLLjeUcpp38LcKHSyE6 tOvDWHZMCsFYDy7Ylko+0G6JXb9r6PRKZmXczTiVc5ZWHI4Y27TErCMvl6UuS0JPovKv Epkw== X-Gm-Message-State: AOAM531PDIiqDXldh1GFatAfzTxkMfTAacC6DGnQq1rGArStYSTxll3o u1sFNSH5paSODdfyiKtPb+UTz11AGm6i1ineBrE= X-Google-Smtp-Source: ABdhPJxuV8GsyADygtnzpUmWSuBmmFfyYdRFN3/asdGXDpCMeaS/zYguGIj04QJ5JTCpS6h53VBfbQWyhYeFuOPh728= X-Received: by 2002:a92:217:: with SMTP id 23mr38815570ilc.118.1600632359330; Sun, 20 Sep 2020 13:05:59 -0700 (PDT) MIME-Version: 1.0 References: <20200920180758.592217-1-peron.clem@gmail.com> <20200920180758.592217-7-peron.clem@gmail.com> <497a7062-4acf-d928-c2ee-ec595ed6799b@sholland.org> In-Reply-To: <497a7062-4acf-d928-c2ee-ec595ed6799b@sholland.org> From: =?UTF-8?B?Q2zDqW1lbnQgUMOpcm9u?= Date: Sun, 20 Sep 2020 22:05:48 +0200 Message-ID: Subject: Re: [PATCH v3 06/19] ASoC: sun4i-i2s: Fix sun8i volatile regs To: Samuel Holland Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: devicetree , Jernej Skrabec , linux-sunxi , Linux-ALSA , linux-kernel , Mark Brown , Takashi Iwai , Liam Girdwood , Maxime Ripard , Marcus Cooper , Chen-Yu Tsai , Rob Herring , linux-arm-kernel X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hi Samuel, On Sun, 20 Sep 2020 at 20:52, Samuel Holland wrote: > > On 9/20/20 1:07 PM, Cl=C3=A9ment P=C3=A9ron wrote: > > The FIFO TX reg is volatile and sun8i i2s register > > mapping is different from sun4i. > > > > Even if in this case it's doesn't create an issue, > > Avoid setting some regs that are undefined in sun8i. > > > > Signed-off-by: Cl=C3=A9ment P=C3=A9ron > > Acked-by: Maxime Ripard > > --- > > sound/soc/sunxi/sun4i-i2s.c | 15 +++++++++++---- > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c > > index ce4913f0ffe4..a35be0e2baf5 100644 > > --- a/sound/soc/sunxi/sun4i-i2s.c > > +++ b/sound/soc/sunxi/sun4i-i2s.c > > @@ -1126,12 +1126,19 @@ static bool sun8i_i2s_rd_reg(struct device *dev= , unsigned int reg) > > > > static bool sun8i_i2s_volatile_reg(struct device *dev, unsigned int re= g) > > { > > - if (reg =3D=3D SUN8I_I2S_INT_STA_REG) > > + switch (reg) { > > + case SUN4I_I2S_FIFO_CTRL_REG: > > Please check if this breaks audio recording with runtime PM enabled. I no= ticed > this with an older revision of the series that also changed > sun4i_i2s_volatile_reg. Marking SUN4I_I2S_FIFO_CTRL_REG as volatile broke > setting of SUN4I_I2S_FIFO_CTRL_TX_MODE/RX_MODE, because the set_fmt() cal= lback > is not run with a runtime PM reference held, and volatile registers are n= ot > written by regcache_sync() during sun4i_i2s_runtime_resume(). > > As a workaround, I moved the TX_MODE/RX_MODE initialization to hw_params(= ), but > I am not sure it is the right thing to do: Thanks for the catch, I never tried to suspend/resume my board actually. But your explanation and the fix seems legit to me. I don't think it's a workaround as settings the fifo size is not related to set_fmt and could also be set in hw_params. I will add your fix in the next version. Regards, Clement > > https://github.com/smaeul/linux/commit/5e40ac610986.patch > > Cheers, > Samuel > > > + case SUN4I_I2S_FIFO_RX_REG: > > + case SUN4I_I2S_FIFO_STA_REG: > > + case SUN4I_I2S_RX_CNT_REG: > > + case SUN4I_I2S_TX_CNT_REG: > > + case SUN8I_I2S_FIFO_TX_REG: > > + case SUN8I_I2S_INT_STA_REG: > > return true; > > - if (reg =3D=3D SUN8I_I2S_FIFO_TX_REG) > > - return false; > > > > - return sun4i_i2s_volatile_reg(dev, reg); > > + default: > > + return false; > > + } > > } > > > > static const struct reg_default sun4i_i2s_reg_defaults[] =3D { > > >