From patchwork Thu Nov 26 15:05:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Mouiche X-Patchwork-Id: 7707491 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 51EF19F2E9 for ; Thu, 26 Nov 2015 15:08:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75AB220626 for ; Thu, 26 Nov 2015 15:08:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4C31120570 for ; Thu, 26 Nov 2015 15:08:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D33F4266828; Thu, 26 Nov 2015 16:08:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, NO_DNS_FOR_FROM,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A54EA265041; Thu, 26 Nov 2015 16:06:21 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C8926261A5E; Thu, 26 Nov 2015 16:06:19 +0100 (CET) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by alsa0.perex.cz (Postfix) with ESMTP id A6CAA261A7C for ; Thu, 26 Nov 2015 16:06:13 +0100 (CET) Received: by wmvv187 with SMTP id v187so35376830wmv.1 for ; Thu, 26 Nov 2015 07:06:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invoxia-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sv54r0owXq+Xk4GuS/fjg3/gMv9de/O7hAp03THEQOw=; b=T5NZYZ8v8RIMfBt/EGe1Lekw1FMZS7Hnbx5rxwO+4hIERlY0APlgOeN/kj51q41tqy 9bDEMzlkEKHQyRu1T3wlKxwThBM67oKhsB5hLR4tgLxq4WIKOv98cw6dRdmn9bISMnhT 7KnH13RWcflM23+K3I/dm8HSIfSfC4blqhp80SyIz0rpYJ3qYkfEhw1SxrpL4d61QkPP epIKdJLQdZAsAXCDvm6uo+rY/Nlht1aoqimy4O6egsv5cr5AosupMULhniiH3vBdA0bi MH+w+v4i5DXe8FT9pWryjMZL1wfZaSToqdVZClm94PntL4+mSGGK6Sh/j2sz8Yp8VLH9 XF8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sv54r0owXq+Xk4GuS/fjg3/gMv9de/O7hAp03THEQOw=; b=lS83kcNavZNg2bIW/tSGBaGhtgPU2ZYMHaD2J1qDla6NWjnV903iW9+OKAYtbaPWsB 04wQE3j+ekfYo1fJSlVlSeVPiNWvdR37ykGCRJ+LS83IGYgczjFR3Cqz+ldGtNgudzbm vMoB5fCmHzyumOdDN+d7COfgHzyox7X0ZvmJxKSPoXJnrGEZAAuyJ+eai+lH8nWV3igw /slVJK3JrNpm5ADj4QzSSc8ANtQmy2yaxpB7tPKt7zXDkqfzGDbOWHY7aYCO0k6Rz/zS EWqd2N3S4Wd3uOktw6HU1bwOC7PUH6BLNsbQm1vK9gtMYvp73Ft6Z0YJuw8XstyauT5b ybKg== X-Gm-Message-State: ALoCoQmgeraABZ73jb80NnxqjqIKZ1b61YQgk+79a2Kelb9hJSUKdemzVrhgWqdt/ZuKAl9NE9fC X-Received: by 10.28.128.5 with SMTP id b5mr4033880wmd.25.1448550373415; Thu, 26 Nov 2015 07:06:13 -0800 (PST) Received: from amolinux.invoxia.net ([94.228.188.198]) by smtp.gmail.com with ESMTPSA id gl4sm1079618wjd.17.2015.11.26.07.06.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Nov 2015 07:06:12 -0800 (PST) From: Arnaud Mouiche To: Caleb Crome , Roberto Fichera , Markus Pargmann , Fabio Estevam , "shawn.guo@linaro.org" , alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com Date: Thu, 26 Nov 2015 16:05:39 +0100 Message-Id: <1448550341-11765-5-git-send-email-arnaud.mouiche@invoxia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448550341-11765-1-git-send-email-arnaud.mouiche@invoxia.com> References: <1448550341-11765-1-git-send-email-arnaud.mouiche@invoxia.com> Cc: Arnaud Mouiche Subject: [alsa-devel] [PATCH v2 4/6] ASoC: fsl_ssi: Fix samples being dropped as Playback startup X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP If the capture is already running while playback is started, it is highly probable (>80% in a 8 channels scenario) that samples are lost between the DMA and TX fifo. The reason is that SIER.TDMAE is set before STCR.TFEN0, leaving a time window where the FIFO doesn't receive the samples written by the DMA. This particular case happened only if capture is already enabled as SCR.SSIEN is already set at the playback startup instant. Signed-off-by: Arnaud Mouiche --- sound/soc/fsl/fsl_ssi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 243c9af..78ea6e1 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -404,9 +404,9 @@ static void fsl_ssi_config(struct fsl_ssi_private *ssi_private, bool enable, * (online configuration) */ if (enable) { - regmap_update_bits(regs, CCSR_SSI_SIER, vals->sier, vals->sier); regmap_update_bits(regs, CCSR_SSI_SRCR, vals->srcr, vals->srcr); regmap_update_bits(regs, CCSR_SSI_STCR, vals->stcr, vals->stcr); + regmap_update_bits(regs, CCSR_SSI_SIER, vals->sier, vals->sier); } else { u32 sier; u32 srcr;