Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9773413ybi; Wed, 10 Jul 2019 16:51:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbxmOSSOjuIeFMudrgArBuZncSvK0Jrozp0ixUMnHotoz3EBQU4iUyiVgXpK2wxFm60QUn X-Received: by 2002:a63:f857:: with SMTP id v23mr1013476pgj.228.1562802709383; Wed, 10 Jul 2019 16:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562802709; cv=none; d=google.com; s=arc-20160816; b=Uf7dbJ+zy7OplT+b5BQjqTb8blCt/rKR2Brag6eSJuG8vYHbMPAuQ0ygcMw3bZYKm0 y3NXf0AqkI+bS/EirZ9WRwjlksuUAdjZ4X2xKr422VSj08KrYHx6UCMsWtxq31pgAlct 6GMOObl6fEY2P3I3n+ICw4+unDQnf722E55IjujBvQyEqy/SoyyYQlLVAhI2Aa0Ilk2w sv9TCHxNcBjAzutpscR6uBFgKozFCKdTcihxhrso5JCVifKe3LkKoP+jwjvk8BVyLqSq /+VC+4+EN4PNJVh7PATCp3ES2RjGTOLAjgP+nrwX1kjpAwOePcNT5HnB2ZRnY99S56L6 nsCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Fo3zNx7q8KOphF4/0k8ry1Exilbv+0XYzkMqa1pkdPw=; b=QlMNvL5a0fSwcqga/T9Um/lm6WTUS5TEVRzzshM7FHakuTpIuuUElURqj+RYInQ4cv osxzXtGHR8zYIRadmbtxlrLnfNMxO/nLraEJD+ozW48Lf58KDgHWkKGZDeMj1XNhoCpO U4B1mAdWXT52CbxDS1RqxB2C7RtOzggF7ECvDYQozrvOy07rn/yYN0EHyqo42/uyIA7D HHxob2r9/HSke6i0A7/aQ9fA42qMnTY17NHgWwKqGLkw6z1UK0zC14g4ABhtIuPGEvQu 32WGlHg8oU5+EWfXVbZVxssB0pjFdyOA6iTtwyvOZC3I+mdQym93DTOn/6Ue0XqXSlic Itnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="brITT/5d"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7si2550287pgv.86.2019.07.10.16.51.32; Wed, 10 Jul 2019 16:51:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="brITT/5d"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727622AbfGJXfh (ORCPT + 99 others); Wed, 10 Jul 2019 19:35:37 -0400 Received: from mail-pg1-f173.google.com ([209.85.215.173]:35018 "EHLO mail-pg1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727463AbfGJXfg (ORCPT ); Wed, 10 Jul 2019 19:35:36 -0400 Received: by mail-pg1-f173.google.com with SMTP id s27so1980403pgl.2 for ; Wed, 10 Jul 2019 16:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Fo3zNx7q8KOphF4/0k8ry1Exilbv+0XYzkMqa1pkdPw=; b=brITT/5d5a9WyodVg5ZUQsakATJo0F+/1F0NZxiiEO4WZQws6EdiwGGKUFKY2pt/Zo CYrZAOfPL/cCfxp3dHvE1aabIU8b7cgowtd3fXrrYR35j+w9wSFI4/MnhtzBbTlu/r6f JEKXEkQJ8j3TQqvb0K33a80yiZ+zyjPj5Z0pWmtYCvMAWLp/UJAgsVYiQ8MZ2pqd06Fp zjAAh5jbOtcdf3eu7kihy5eqVXw3cEWFA1QhWDw/g3HaPszaNu2XlkvfcZEoFxHBZ2vN 4/RaulelQD0Ma3GGYGzUZGqEEk/VKTIwXHs0hbdk8/rAh81ECwzdFDbV1PeVNjYcWwM+ vBQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Fo3zNx7q8KOphF4/0k8ry1Exilbv+0XYzkMqa1pkdPw=; b=s3E34wTLi9246JwatdKgbgSy1w1rjUpTcVCiX1PWOtlnArZCsnGugPrpPB9gCGA3TQ rQHYgolICSCcs9h1WM8ATJTLOlADaiwYRfVbJD0WJqjPEPOF7+18ydyNrfS5w7DL9yf4 VyAX4+Sx9TFfMzFDv7tIgjai7ae6JJulThSr6kKJnp/CYjWVI/amfjKkQL11iHOmy2iR Po+2Pdd59Gu3hhK2zvZDIaysKax3k0A6peILFt8n9lTwz7pWVIU79DwkAnU7XtTc/Nu1 mGhhu0p04oViZmLUrrGlf5gw7XKv7kCW1Ff863f+yi1YAHlMnRDI/cmQMhxtsl2w7/V4 A98A== X-Gm-Message-State: APjAAAXPT7lpfqXVave2d3g8oH6bGbD2e/LJ9OWDXkCVteF+VHjEgt0P BbJHJAhPWLtrUh7nbQ+Vwug= X-Received: by 2002:a17:90a:36e4:: with SMTP id t91mr1101282pjb.22.1562801735794; Wed, 10 Jul 2019 16:35:35 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id q1sm6318517pfn.178.2019.07.10.16.35.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2019 16:35:35 -0700 (PDT) Date: Wed, 10 Jul 2019 16:36:06 -0700 From: Nicolin Chen To: shengjiu.wang@nxp.com Cc: timur@kernel.org, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 2/2] ASoC: fsl_esai: recover the channel swap after xrun Message-ID: <20190710233605.GA9886@Asurada-Nvidia.nvidia.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shengjiu, Mostly looks good to me, just some small comments. On Mon, Jul 08, 2019 at 02:38:52PM +0800, shengjiu.wang@nxp.com wrote: > +static void fsl_esai_hw_reset(unsigned long arg) > +{ > + struct fsl_esai *esai_priv = (struct fsl_esai *)arg; > + u32 saisr, tfcr, rfcr; > + bool tx = true, rx = false, enabled[2]; Could we swap the lines of u32 and bool? It'd look better. > + regmap_update_bits(esai_priv->regmap, REG_ESAI_TCR, > + ESAI_xCR_xPR_MASK, ESAI_xCR_xPR); > + regmap_update_bits(esai_priv->regmap, REG_ESAI_RCR, > + ESAI_xCR_xPR_MASK, ESAI_xCR_xPR); Let's add a line of comments for these two: /* Enforce ESAI personal resets for both TX and RX */ > + /* > + * Restore registers by regcache_sync, and ignore > + * return value > + */ Could fit into single-line? > + regmap_update_bits(esai_priv->regmap, REG_ESAI_TCR, > + ESAI_xCR_xPR_MASK, 0); > + regmap_update_bits(esai_priv->regmap, REG_ESAI_RCR, > + ESAI_xCR_xPR_MASK, 0); > + > + regmap_update_bits(esai_priv->regmap, REG_ESAI_PRRC, > + ESAI_PRRC_PDC_MASK, ESAI_PRRC_PDC(ESAI_GPIO)); > + regmap_update_bits(esai_priv->regmap, REG_ESAI_PCRC, > + ESAI_PCRC_PC_MASK, ESAI_PCRC_PC(ESAI_GPIO)); Could remove the blank line and add a line of comments: /* Remove ESAI personal resets by configuring PCRC and PRRC also */ Btw, I still feel this personal reset can be stuffed into one of the wrapper functions. But let's keep this simple for now. > + regmap_read(esai_priv->regmap, REG_ESAI_SAISR, &saisr); Why do we read saisr here? All its bits would get cleared by the hardware reset. If it's a must to clear again, we should add a line of comments to emphasize it. Thank you