From patchwork Thu Nov 26 14:07:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Mouiche X-Patchwork-Id: 7707361 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5176BF90C for ; Thu, 26 Nov 2015 14:09:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 093C220790 for ; Thu, 26 Nov 2015 14:09:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D961120649 for ; Thu, 26 Nov 2015 14:09:39 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3FA74266833; Thu, 26 Nov 2015 15:09:38 +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, 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 27B6926670A; Thu, 26 Nov 2015 15:08:03 +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 B8BD4261AD8; Thu, 26 Nov 2015 15:07:59 +0100 (CET) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by alsa0.perex.cz (Postfix) with ESMTP id C17D8261A95 for ; Thu, 26 Nov 2015 15:07:51 +0100 (CET) Received: by wmww144 with SMTP id w144so23958433wmw.0 for ; Thu, 26 Nov 2015 06:07:51 -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=wmFdP+5ZoS4/Cp4mxVdIrHoYkEHJgqlg0c4L7Gc9lfrgOH5n3d39da1+ix1+maH9lk LCQsHtooJwNYguWPhYaaVROX2Fic/icFqVLUmw96pkkoP56W43VL5KL1arqskOV539uQ iOfkLIj2RrBDvk9rM+ILmMyAFkkpgeyiovGBsuVa/YwrmkhIkf1UoOnk1qf+48m+I2zC fjAyE9GmODWkkdL6PmQLTARNCqTLtrVDlcRkeIPgU2ReMSg625atEkTpXfvnF+d3fvtL FV2Kw2M5/yXqfVHS5JuTIpAGHX28UfFRNk26JmyIS8BSLJO+YCZuz3dVsTbwShoZgaXw i9rw== 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=BW+bwgT2qQvgT4MO2aRbRJKpfp51BEaAJRj82/uLamk9rfkhjRQl2NYTuoYw3YRKIE 1EsJlqGUNOFaW6/bZqiPEi8pJJ0J96DDFs+hK25EzcqH7MdfEUnEhV+jc5YJpDxx5c+T Zb1NNVF5yNgb5hxU7hvWYr4aT+HY75YqnfaA+AlNH+M13E8HfmAfuI2M01FeoHJ/cUNL +YbHsf4QdIIdbWsgdrB787L2/glMqO52Tq/BhVcofuH7cuGQf4iWdwcGfypPpSmdMvU3 1Nq5T1nvqB7wAoYZUd9WjHbwT7mLPnNWUgCRXDHhTZNJxcDVKgp05n3WOh4vEK0vy2Ur 4ruQ== X-Gm-Message-State: ALoCoQlfoMoXfkFdaP33IS3Sf9DRFL1pEYQ6L4Arn43shiTZtqYC0SsRTejqkD5AfZFE1ENm/i+Z X-Received: by 10.194.189.68 with SMTP id gg4mr56437350wjc.146.1448546871509; Thu, 26 Nov 2015 06:07:51 -0800 (PST) Received: from amolinux.invoxia.net ([94.228.188.198]) by smtp.gmail.com with ESMTPSA id v196sm2907777wmv.10.2015.11.26.06.07.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Nov 2015 06:07:50 -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 15:07:20 +0100 Message-Id: <1448546842-4584-4-git-send-email-arnaud.mouiche@invoxia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448546842-4584-1-git-send-email-arnaud.mouiche@invoxia.com> References: <1448546842-4584-1-git-send-email-arnaud.mouiche@invoxia.com> Cc: Arnaud Mouiche Subject: [alsa-devel] [PATCH 3/5] 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;