From patchwork Wed Jul 4 14:01:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10506949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CBC3600F5 for ; Wed, 4 Jul 2018 14:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B89128CCB for ; Wed, 4 Jul 2018 14:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 703CB28D4F; Wed, 4 Jul 2018 14:12:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC5B728D9D for ; Wed, 4 Jul 2018 14:12:56 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B67C926777F; Wed, 4 Jul 2018 16:02:06 +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 76CA426772D; Wed, 4 Jul 2018 16:01:56 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 317FA267731 for ; Wed, 4 Jul 2018 16:01:50 +0200 (CEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C9497AEC3; Wed, 4 Jul 2018 14:01:49 +0000 (UTC) From: Takashi Iwai To: Mark Brown Date: Wed, 4 Jul 2018 16:01:45 +0200 Message-Id: <20180704140146.6768-4-tiwai@suse.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180704140146.6768-1-tiwai@suse.de> References: <20180704140146.6768-1-tiwai@suse.de> Cc: alsa-devel@alsa-project.org, Banajit Goswami , Alexandre Torgue , Patrick Lai , Peter Ujfalusi , Maxime Coquelin Subject: [alsa-devel] [PATCH 3/4] ASoC: sti: Use snd_pcm_stop_xrun() helper 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 The XRUN trigger from the driver should be done via snd_pcm_stop_xrun(). It fixes the missing stream locking as a gratis, too. Signed-off-by: Takashi Iwai --- sound/soc/sti/uniperif_player.c | 6 +++--- sound/soc/sti/uniperif_reader.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c index d8b6936e544e..313dab2857ef 100644 --- a/sound/soc/sti/uniperif_player.c +++ b/sound/soc/sti/uniperif_player.c @@ -91,7 +91,7 @@ static irqreturn_t uni_player_irq_handler(int irq, void *dev_id) SET_UNIPERIF_ITM_BCLR_FIFO_ERROR(player); /* Stop the player */ - snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stop_xrun(player->substream); } ret = IRQ_HANDLED; @@ -105,7 +105,7 @@ static irqreturn_t uni_player_irq_handler(int irq, void *dev_id) SET_UNIPERIF_ITM_BCLR_DMA_ERROR(player); /* Stop the player */ - snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stop_xrun(player->substream); ret = IRQ_HANDLED; } @@ -138,7 +138,7 @@ static irqreturn_t uni_player_irq_handler(int irq, void *dev_id) dev_err(player->dev, "Underflow recovery failed\n"); /* Stop the player */ - snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stop_xrun(player->substream); ret = IRQ_HANDLED; } diff --git a/sound/soc/sti/uniperif_reader.c b/sound/soc/sti/uniperif_reader.c index ee0055e60852..7b63d35ef428 100644 --- a/sound/soc/sti/uniperif_reader.c +++ b/sound/soc/sti/uniperif_reader.c @@ -65,7 +65,7 @@ static irqreturn_t uni_reader_irq_handler(int irq, void *dev_id) if (unlikely(status & UNIPERIF_ITS_FIFO_ERROR_MASK(reader))) { dev_err(reader->dev, "FIFO error detected\n"); - snd_pcm_stop(reader->substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stop_xrun(reader->substream); ret = IRQ_HANDLED; }