From patchwork Tue Sep 29 14:43:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yitian X-Patchwork-Id: 7286741 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 C24BA9F1D5 for ; Tue, 29 Sep 2015 14:44:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 556C62075F for ; Tue, 29 Sep 2015 14:43:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E8FFC20752 for ; Tue, 29 Sep 2015 14:43:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F10A5265713; Tue, 29 Sep 2015 16:43:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 44EA5265767; Tue, 29 Sep 2015 16:43:41 +0200 (CEST) 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 E4479265775; Tue, 29 Sep 2015 16:43:39 +0200 (CEST) Received: from smtpbg64.qq.com (smtpbg62.qq.com [103.7.29.139]) by alsa0.perex.cz (Postfix) with ESMTP id 1D0F0265705 for ; Tue, 29 Sep 2015 16:43:31 +0200 (CEST) X-QQ-mid: bizesmtp8t1443537798t955t323 Received: from buyitPC (unknown [125.121.205.0]) by esmtp4.qq.com (ESMTP) with id ; Tue, 29 Sep 2015 22:43:18 +0800 (CST) X-QQ-SSF: 01100000008000F0FG42C00A0000000 X-QQ-FEAT: B66SWoL63m0cqi/rfKgWxyuOuuCMdNllZa32ibmtGdaTO6ldpH33yIOVS0AYB te//RYF8HC7rksDIScULXZitRrSyzXcIW4FjUgjAs1sVEu34Ytnwt5IS3cOvsd0nSLUHdoL 3w1B7U6vJHQw8m8g4qcaQoMLogNkWlfyxhUOtQwo4hW4WygwsH++tRRZcBf+UFz0WTZzZsl WU2lUpIYjJn4RsCmdUMWNVEa3WoxzF41UzHpmAGOW9ZSR78jFmzSaP8PT8WJvvqk1tdYvpn YImw== X-QQ-GoodBg: 0 From: "yitian" To: , , , , , Date: Tue, 29 Sep 2015 22:43:17 +0800 Message-ID: <006401d0fac5$2e4bb840$8ae328c0$@tangramtek.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AdD6xPBwN3lii9c+RPu9p+sweG0IeA== Content-Language: zh-cn X-QQ-SENDSIZE: 520 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [RESEND PATCH v2 1/1] ASoC: dwc: fix dma stop transferring issue 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Designware I2S uses tx empty and rx available signals as the DMA handshaking signals. during music playing, if XRUN occurs, i2s_stop() function will be executed and both tx and rx irq are masked, when music continues to be played, i2s_start() is executed but both tx and rx irq are not unmasked which cause I2S stop sending DMA handshaking signal to DMA controller, and it finally causes music playing will be stopped once XRUN occurs for the first time. Signed-off-by: Yitian Bu --- changes in V2: - add definition for i and irq --- sound/soc/dwc/designware_i2s.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) } diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index a3e97b4..76b2e19 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -141,13 +141,22 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream) static void i2s_start(struct dw_i2s_dev *dev, struct snd_pcm_substream *substream) { - + u32 i, irq; i2s_write_reg(dev->i2s_base, IER, 1); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + for (i = 0; i < 4; i++) { + irq = i2s_read_reg(dev->i2s_base, IMR(i)); + i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x30); + } i2s_write_reg(dev->i2s_base, ITER, 1); - else + } else { + for (i = 0; i < 4; i++) { + irq = i2s_read_reg(dev->i2s_base, IMR(i)); + i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x03); + } i2s_write_reg(dev->i2s_base, IRER, 1); + } i2s_write_reg(dev->i2s_base, CER, 1);