From patchwork Tue Jul 21 16:32:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 6837211 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 E42359F380 for ; Tue, 21 Jul 2015 16:57:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A33F206CE for ; Tue, 21 Jul 2015 16:57:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0C81220690 for ; Tue, 21 Jul 2015 16:57:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C6456260870; Tue, 21 Jul 2015 18:57:26 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, NO_DNS_FOR_FROM,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id E5168260599; Tue, 21 Jul 2015 18:57:19 +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 F04792605AA; Tue, 21 Jul 2015 18:57:17 +0200 (CEST) Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by alsa0.perex.cz (Postfix) with ESMTP id 040AA260599 for ; Tue, 21 Jul 2015 18:57:11 +0200 (CEST) Received: from localhost (unknown [IPv6:2a01:e35:2f5c:9de0:21c:dfff:fe9f:57fb]) by smtp6-g21.free.fr (Postfix) with ESMTP id 45DAC82286; Tue, 21 Jul 2015 18:51:34 +0200 (CEST) X-Mailbox-Line: From 600c64b5b752b20e80a9944a4fe3952aefc0feed Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Tue, 21 Jul 2015 18:32:58 +0200 To: Mark Brown , Liam Girdwood Message-Id: <20150721165717.F04792605AA@alsa0.perex.cz> Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] ASoC: kirkwood: prevent double streaming 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 kirkwood audio subsystem presents 2 PCM's for one source. Streaming on a second PCM while the first one is active cuts this last one. Then, ending the last stream gives a kernel trap in free_irq(). Signed-off-by: Jean-Francois Moine --- sound/soc/kirkwood/kirkwood-dma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index 4cf2245..dbfdfe9 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c @@ -148,10 +148,14 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream) dram = mv_mbus_dram_info(); addr = substream->dma_buffer.addr; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (priv->substream_play) + return -EBUSY; priv->substream_play = substream; kirkwood_dma_conf_mbus_windows(priv->io, KIRKWOOD_PLAYBACK_WIN, addr, dram); } else { + if (priv->substream_rec) + return -EBUSY; priv->substream_rec = substream; kirkwood_dma_conf_mbus_windows(priv->io, KIRKWOOD_RECORD_WIN, addr, dram);