From patchwork Tue Jun 18 13:26:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001697 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E63E1902 for ; Tue, 18 Jun 2019 13:27:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DDFA289CF for ; Tue, 18 Jun 2019 13:27:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11B8628B1F; Tue, 18 Jun 2019 13:27:32 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 87E87289CF for ; Tue, 18 Jun 2019 13:27:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2A37B16D1; Tue, 18 Jun 2019 15:26:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A37B16D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864447; bh=gc7TXn7+RXLl1LVIYvhGDBggElx3/da08I62EBZNIfw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ul09ZSksDpsiETDyh1T76lEs7lneolczs9Ds53Z+H3CSkRmoQRQLsVIgBtDPSrtsQ cNgnLdmup8uZi2vQNCtnOuLcdtky5iV7RtVhbGrOXY1ESZaOQFaEsfSWedrejidz5w aMa62wTENlNW5ZqT4VsnOvp7BXeogTY4yKhntoPE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8A107F896DB; Tue, 18 Jun 2019 15:26:36 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id AEC2DF8971F; Tue, 18 Jun 2019 15:26:34 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9E144F896DB for ; Tue, 18 Jun 2019 15:26:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9E144F896DB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="DZ4d5Y7b"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="IcI+OSz0" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 19F692229C; Tue, 18 Jun 2019 09:26:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=Rt3QcVJM8eQX3 okQiwQgXzx2DQEIzr7dSVIBlr5O424=; b=DZ4d5Y7bi0U8KeX50iUQxLQxUi1O7 WHBiEdyzJFWEvW6krlUdvtSZraI6liBTp6Ne60aBPzslAl8TGCAhb61yPGhJ7j3G eryaBcYEFklVTFm8nqxgazQ/Xq2vXPq3xKmAdgr0tfrshYGfuzc6v0oc0Mbrbenr YHNZGniYMsQVWiCzjU3/ZiQqMcxA7aeeSY8gKAe959OKUFLqCTMobpVmisA9wSuZ VgTy+LEn3Igxiy7O9IjqLPq491xmoeimnGs09SWMdMX0GH8jZqek5h53YsIRto2+ DoRl3lKzmZ2B4lB3PMMSAtdEBoydf/LDQYDl9xQ7p8Jo+863wn9MBh1fQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Rt3QcVJM8eQX3okQiwQgXzx2DQEIzr7dSVIBlr5O424=; b=IcI+OSz0 VSr32XlnClxx1mWA4cTT3lvpnKnc76Lu5cYWwOj1q/BdUaB8rqHK0Pua1f2fi0Sn OmsfoeqilQD0cmzeCJ9BheaOSaGx7cH4aoNAPF9PegNe5kscQ0I4wYwJ4DGb8QQS 4RPkO25vEfQ3lqr18dC+42yrAwYQ4pEoNGPNT+3LMez0W1weY2e/+Y1T2LujLhD/ ZOOx/qXU4QjJTEAZkP3mRbRRL0JMy8RbOpHnkwiahL2HezIpdpHap6/ksD2YFuf8 GBBD0nwRD+3ZAAnDyRWpTUDOFu6KYiZ2VlMJZnk8xX2ZDFJU2gcnEeM55U+L3D62 D1eG8EDdoeRf3Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 72C99380088; Tue, 18 Jun 2019 09:26:27 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:15 +0900 Message-Id: <20190618132622.32659-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/8] ALSA: firewire-tascam: unify stop and release method for duplex streams X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From callbacks for pcm and rawmidi interfaces, the functions to stop and release duplex streams are called at the same time. This commit merges the two functions. Signed-off-by: Takashi Sakamoto --- sound/firewire/tascam/tascam-pcm.c | 1 - sound/firewire/tascam/tascam-stream.c | 14 +++++--------- sound/firewire/tascam/tascam.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c index 450711bef508..300683a82c68 100644 --- a/sound/firewire/tascam/tascam-pcm.c +++ b/sound/firewire/tascam/tascam-pcm.c @@ -118,7 +118,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) --tscm->substreams_counter; snd_tscm_stream_stop_duplex(tscm); - snd_tscm_stream_release_duplex(tscm); mutex_unlock(&tscm->mutex); diff --git a/sound/firewire/tascam/tascam-stream.c b/sound/firewire/tascam/tascam-stream.c index f572dfc15114..0e515b7be276 100644 --- a/sound/firewire/tascam/tascam-stream.c +++ b/sound/firewire/tascam/tascam-stream.c @@ -380,14 +380,6 @@ int snd_tscm_stream_reserve_duplex(struct snd_tscm *tscm, unsigned int rate) return 0; } -void snd_tscm_stream_release_duplex(struct snd_tscm *tscm) -{ - if (tscm->substreams_counter == 0) { - fw_iso_resources_free(&tscm->tx_resources); - fw_iso_resources_free(&tscm->rx_resources); - } -} - int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate) { unsigned int generation = tscm->rx_resources.generation; @@ -455,8 +447,12 @@ int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate) void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm) { - if (tscm->substreams_counter == 0) + if (tscm->substreams_counter == 0) { finish_session(tscm); + + fw_iso_resources_free(&tscm->tx_resources); + fw_iso_resources_free(&tscm->rx_resources); + } } void snd_tscm_stream_lock_changed(struct snd_tscm *tscm) diff --git a/sound/firewire/tascam/tascam.h b/sound/firewire/tascam/tascam.h index 1cb75c374f11..4ed88cceaedb 100644 --- a/sound/firewire/tascam/tascam.h +++ b/sound/firewire/tascam/tascam.h @@ -148,7 +148,6 @@ int snd_tscm_stream_init_duplex(struct snd_tscm *tscm); void snd_tscm_stream_update_duplex(struct snd_tscm *tscm); void snd_tscm_stream_destroy_duplex(struct snd_tscm *tscm); int snd_tscm_stream_reserve_duplex(struct snd_tscm *tscm, unsigned int rate); -void snd_tscm_stream_release_duplex(struct snd_tscm *tscm); int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate); void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm); From patchwork Tue Jun 18 13:26:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07A781398 for ; Tue, 18 Jun 2019 13:29:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB8E628B18 for ; Tue, 18 Jun 2019 13:29:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E004E28B22; Tue, 18 Jun 2019 13:29:10 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33DAE28B18 for ; Tue, 18 Jun 2019 13:29:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 653F916F2; Tue, 18 Jun 2019 15:28:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 653F916F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864548; bh=jSF7uBB+vgDnWbDkLvLI15Fufc+3gwTczpwSVbWr3B8=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vTqijtjN97qSsUukVxba3MXTIX9nnX5uKRtHDKHkKAMTqXNqnZ+RkvqoyOT8DQCPp Q3tTNEDEGXoHClBPBTmjq1Ba9RhdAVR7L20OmCBOxxplUQjRrG5Knwu6gSOj4w5YWs blV14tSddM+I0pZ7tWWMgZntcV2Q35bDtIeNpDeA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3BDDBF8971F; Tue, 18 Jun 2019 15:26:42 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6FA0DF8971F; Tue, 18 Jun 2019 15:26:36 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 04BADF896F4 for ; Tue, 18 Jun 2019 15:26:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 04BADF896F4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="cYONb+lO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="f3BpZ4pF" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CE03F2215D; Tue, 18 Jun 2019 09:26:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=oLzcsQnOBsq6m 0w5UUgPHX0uN8Fcy2u9w4yjZjLl9DI=; b=cYONb+lOp+NC8cAGdlanNVim70qSc KBUDopQ/wIppyzUiInWR+7rUF6o/S0Ko/2GvqOq6dzCsyUO7ZLncfUCs83rxyJJv ZA3IR0tkljlWNp/gHORWbhZOm3i+gkpqY6zDok6NoH4X/tyTbPCQseWR9ik60NWW Bd9qHgnvrslizQ/lZ6B/A5m9+gsNtyaVxB4TxxBPnbH+iF0ZLekuPbeV1Djq2pIM fPDnfvbEBSNQb5aNnayuTlWkBSAkDGs5r1QAcK4hcsS5gEGVbifH+ladRDXWbj7M LdIjAgdJNc0rrcEsC+SjU19uHWFqCPfGqIvj9pCw6a7Bpb6nhvEjXOWxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=oLzcsQnOBsq6m0w5UUgPHX0uN8Fcy2u9w4yjZjLl9DI=; b=f3BpZ4pF LjHXLJ/jD2Q6/sZuDdU/QHyWj7pNwaNvoYGPfIMWh1ALFD3l7zZpSk9z+ExxAw4Q 5K+HnGdD/0bTvMvh8ObJoSiTdwSL198AsjeuC6wITKxYC0sj06jkYIeJ1PXyFWvq XOdyIxxErURCGOHlyStxKgD0v2aD+DzD8QgvT9t1YrhSTReJbTpLITNorMCApAgk hbs2+9MwEml061z/bMVWixdQUdd0umfv7NVdtHbgko6BI1odkQ7DR0ATq3EDK1Pu wFRSnjbaYrGphKFrERd9/V97GAuqGE3zDuiB/CV5BBvhDykpv9+VmWJeYSoohitV WKuWSUtWvlG5Iw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 3AE15380084; Tue, 18 Jun 2019 09:26:29 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:16 +0900 Message-Id: <20190618132622.32659-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 2/8] ALSA: fireface: unify stop and release method for duplex streams X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From callbacks for pcm and rawmidi interfaces, the functions to stop and release duplex streams are called at the same time. This commit merges the two functions. Signed-off-by: Takashi Sakamoto --- sound/firewire/fireface/ff-pcm.c | 1 - sound/firewire/fireface/ff-stream.c | 14 +++++--------- sound/firewire/fireface/ff.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sound/firewire/fireface/ff-pcm.c b/sound/firewire/fireface/ff-pcm.c index 938985c2d4a8..75228e769687 100644 --- a/sound/firewire/fireface/ff-pcm.c +++ b/sound/firewire/fireface/ff-pcm.c @@ -233,7 +233,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) --ff->substreams_counter; snd_ff_stream_stop_duplex(ff); - snd_ff_stream_release_duplex(ff); mutex_unlock(&ff->mutex); diff --git a/sound/firewire/fireface/ff-stream.c b/sound/firewire/fireface/ff-stream.c index 884705ecf940..049920a6d43e 100644 --- a/sound/firewire/fireface/ff-stream.c +++ b/sound/firewire/fireface/ff-stream.c @@ -149,14 +149,6 @@ int snd_ff_stream_reserve_duplex(struct snd_ff *ff, unsigned int rate) return 0; } -void snd_ff_stream_release_duplex(struct snd_ff *ff) -{ - if (ff->substreams_counter == 0) { - fw_iso_resources_free(&ff->tx_resources); - fw_iso_resources_free(&ff->rx_resources); - } -} - int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate) { int err; @@ -217,8 +209,12 @@ int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate) void snd_ff_stream_stop_duplex(struct snd_ff *ff) { - if (ff->substreams_counter == 0) + if (ff->substreams_counter == 0) { finish_session(ff); + + fw_iso_resources_free(&ff->tx_resources); + fw_iso_resources_free(&ff->rx_resources); + } } void snd_ff_stream_update_duplex(struct snd_ff *ff) diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h index fe5739ee1c88..9b52c368f6de 100644 --- a/sound/firewire/fireface/ff.h +++ b/sound/firewire/fireface/ff.h @@ -139,7 +139,6 @@ int snd_ff_stream_get_multiplier_mode(enum cip_sfc sfc, int snd_ff_stream_init_duplex(struct snd_ff *ff); void snd_ff_stream_destroy_duplex(struct snd_ff *ff); int snd_ff_stream_reserve_duplex(struct snd_ff *ff, unsigned int rate); -void snd_ff_stream_release_duplex(struct snd_ff *ff); int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate); void snd_ff_stream_stop_duplex(struct snd_ff *ff); void snd_ff_stream_update_duplex(struct snd_ff *ff); From patchwork Tue Jun 18 13:26:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0C911398 for ; Tue, 18 Jun 2019 13:29:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0EB41FFBE for ; Tue, 18 Jun 2019 13:29:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C533A28B2D; Tue, 18 Jun 2019 13:29:55 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E5D4028ABF for ; Tue, 18 Jun 2019 13:29:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1C5BA16F9; Tue, 18 Jun 2019 15:29:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1C5BA16F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864593; bh=VLkydJJwtAKi1xQ8+IE19gWi6ZI4yI18N65RDieDuCQ=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NNuxzdT+z7K5qpL6yenLK/++wdsMWLb9b4XOm/D7yXi7ykIJIjowxFy5WXxVvMwgB r9a7jIKHz5JtIxEK54PsBtZc/x3I8EXX761Damq+9Ib6AYWfkY6GhpxBpse/JHWAAD eHvjUkiAYAnP5XhCfsgRKx0vpTFaA4PzuNu+WUWM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 764F2F89735; Tue, 18 Jun 2019 15:26:43 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97661F89729; Tue, 18 Jun 2019 15:26:37 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 690C4F8075C for ; Tue, 18 Jun 2019 15:26:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 690C4F8075C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="XfUyOZms"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YyQWlbzR" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 934D322243; Tue, 18 Jun 2019 09:26:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=HDuOf3QkBQFxM e1v3VUKzdugYI31cafIz2JSzxn6n6M=; b=XfUyOZmsgd8Za5jB13t6z0paWZOvv 2AhUBdq/XKcdzcEVBsXdQwGs+6rB56nketx8W8YQ+psjRgtFes3e08mVcFzq35Uw wmb3OD0DJjdd6tl/wciZ7zATx83fu+rdFCzP/a3JJqJs/03dqHofppH04Og9gfGX 93yxDDFVyzDyU6XFoPW1Z1V2SddXW0b7p/TqTqUF7povDpo/MIaxyfiM4QZceTch PhK4e94stLr1hcDINbAj91jowMKHm8FhYWZD71KgYQ71AG551WpGhwrbkzeCvCOE +rlH6iR9/cPV+vdvmrMtlTYfD5m+p2KvqXFbg7fLyaqm7iRTRyZV2cIVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=HDuOf3QkBQFxMe1v3VUKzdugYI31cafIz2JSzxn6n6M=; b=YyQWlbzR SWwEEfWWVAy0IyJTHzioNAbN+NNkblprdPgB4g25XmAiA/anKifuJI3b19C5wNeM Fh5kH5kGUNCsn2TPoawt5RQ5jNWz1+uCPAWGq/jwC7ztMoUuTYEQMKJEywSRIXs6 wRhYWeOwFNi5oYfTIPnFdPcaRWow3ZqwsfAEsgUt9Ovv6cRvzkJCifOGN6GCA7Zu GDvCfR7BvQZ42kDd6oWpSvGibAUPZO1ol6BnMb9/lYCljuhbSyHO/ehvC8RQid5U hrVG+kfHe1N5dCvxmJcQe9XIJOdIEjMiRyFDGDwmUb8/QBYGg82RGtazG9AO+wgU okgOfYsWDub4pA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id F1F00380084; Tue, 18 Jun 2019 09:26:30 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:17 +0900 Message-Id: <20190618132622.32659-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 3/8] ALSA: firewire-motu: unify stop and release method for duplex streams X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From callbacks for pcm and rawmidi interfaces, the functions to stop and release duplex streams are called at the same time. This commit merges the two functions. Signed-off-by: Takashi Sakamoto --- sound/firewire/motu/motu-midi.c | 1 - sound/firewire/motu/motu-pcm.c | 1 - sound/firewire/motu/motu-stream.c | 14 +++++--------- sound/firewire/motu/motu.h | 1 - 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/sound/firewire/motu/motu-midi.c b/sound/firewire/motu/motu-midi.c index a463730c72bc..4520c0060b83 100644 --- a/sound/firewire/motu/motu-midi.c +++ b/sound/firewire/motu/motu-midi.c @@ -40,7 +40,6 @@ static int midi_close(struct snd_rawmidi_substream *substream) --motu->substreams_counter; snd_motu_stream_stop_duplex(motu); - snd_motu_stream_release_duplex(motu); mutex_unlock(&motu->mutex); diff --git a/sound/firewire/motu/motu-pcm.c b/sound/firewire/motu/motu-pcm.c index b9852c911b98..60c691d18952 100644 --- a/sound/firewire/motu/motu-pcm.c +++ b/sound/firewire/motu/motu-pcm.c @@ -224,7 +224,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) --motu->substreams_counter; snd_motu_stream_stop_duplex(motu); - snd_motu_stream_release_duplex(motu); mutex_unlock(&motu->mutex); diff --git a/sound/firewire/motu/motu-stream.c b/sound/firewire/motu/motu-stream.c index 82891583b736..8aab5db71c0f 100644 --- a/sound/firewire/motu/motu-stream.c +++ b/sound/firewire/motu/motu-stream.c @@ -200,14 +200,6 @@ int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate) return 0; } -void snd_motu_stream_release_duplex(struct snd_motu *motu) -{ - if (motu->substreams_counter == 0) { - fw_iso_resources_free(&motu->tx_resources); - fw_iso_resources_free(&motu->rx_resources); - } -} - static int ensure_packet_formats(struct snd_motu *motu) { __be32 reg; @@ -301,8 +293,12 @@ int snd_motu_stream_start_duplex(struct snd_motu *motu) void snd_motu_stream_stop_duplex(struct snd_motu *motu) { - if (motu->substreams_counter == 0) + if (motu->substreams_counter == 0) { finish_session(motu); + + fw_iso_resources_free(&motu->tx_resources); + fw_iso_resources_free(&motu->rx_resources); + } } static int init_stream(struct snd_motu *motu, enum amdtp_stream_direction dir) diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h index 32cd42873fd0..a4ac320f2c9e 100644 --- a/sound/firewire/motu/motu.h +++ b/sound/firewire/motu/motu.h @@ -154,7 +154,6 @@ int snd_motu_stream_init_duplex(struct snd_motu *motu); void snd_motu_stream_destroy_duplex(struct snd_motu *motu); int snd_motu_stream_cache_packet_formats(struct snd_motu *motu); int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate); -void snd_motu_stream_release_duplex(struct snd_motu *motu); int snd_motu_stream_start_duplex(struct snd_motu *motu); void snd_motu_stream_stop_duplex(struct snd_motu *motu); int snd_motu_stream_lock_try(struct snd_motu *motu); From patchwork Tue Jun 18 13:26:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B987112C for ; Tue, 18 Jun 2019 13:30:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4802128994 for ; Tue, 18 Jun 2019 13:30:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C6562881C; Tue, 18 Jun 2019 13:30:29 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D4E028820 for ; Tue, 18 Jun 2019 13:30:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9F2E316DD; Tue, 18 Jun 2019 15:29:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F2E316DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864626; bh=bNPnh9C8r6mGcz/5JoAygOIik802/YPBIP/WCuwzJPI=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=K2a0Sv0FHvUJnqoIYSnh7LdujafGBmrOOG/NoMbuhYHuIZtg2hVU0CfivJmJxX01r Rx6FqBxP4RG17hG6qAAow2X74cspfH3XF5pJkHFb057psHsxfJEP1iELT4Jw23sCwG CpY8GrfuHzE9Hb93tbd+vHERRk4UHzHnJIcNF4sk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1E295F8973A; Tue, 18 Jun 2019 15:26:45 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B3883F89731; Tue, 18 Jun 2019 15:26:39 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 12F6CF80CC4 for ; Tue, 18 Jun 2019 15:26:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 12F6CF80CC4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="njC5afhx"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="exKe5BiG" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3A9F32229C; Tue, 18 Jun 2019 09:26:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=EVcmC5qZDBJTH rUqv/yi3h5vwPjZ7Dxb1YBLISjfqAE=; b=njC5afhxh3X0PnXoV09374XFA6bV4 Fk0sL0z+LGqgU/LtEH3TmL4nVgPAYRfv/OLEmOayDB+OfpmXql6ce1+Ew9nf916x aNYBiTuH/sqKsfh9Cg4tKIPxMcR57rBC5p3/4kI1cCmyV2fGKipkVv4ua7dgUShC X2whig6mzs19mGgDrBd7eBPdwIrXm8Zow1L9vcJK4rV2XyT0aXjwBKWdTfAjGGnj PcPzWaJQPRSQ3Zt0fszD19YjJOEMW9GBvZhfwTCKq91Tx92vlfcFbfSQC8XyfqHV uaw1zRqyJ+KMOYSuXLaHovLttfluNacl6aPZZ+ldH7abtm0NCH3x+TEpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=EVcmC5qZDBJTHrUqv/yi3h5vwPjZ7Dxb1YBLISjfqAE=; b=exKe5BiG u6TUpNNNPBSqJg5gzkfM3vLXgvNiHWnr4P1NEK0KQYN4LswxmjabVtXNF41Aeoje OoeDfu8dd5Xej0QMrkzop7wfzDdpD8uT1+2ugksat3vqQ5gueD6pjKAXRP8ZAY7V 5a8FZQKJ6enoiyfoKgfZexsP2HbDVhOfhrPBFgYzSzbolSCCxfF7aJs31ADu9G7L +JhxLyaoZOeVszVxoGGRjKQ3OowbYAJU+MbC09U28xglUkc04+hGkmhnokXVTwbA 1iLYkOvGIKMK3tetlVtENT+B7ydyi8NpQxjH/bhyZFszdm254HGmnqitqsrrKyoC Mu5E08TyV/mwnQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id BD545380083; Tue, 18 Jun 2019 09:26:32 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:18 +0900 Message-Id: <20190618132622.32659-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 4/8] ALSA: firewire-digi00x: unify stop and release method for duplex streams X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From callbacks for pcm and rawmidi interfaces, the functions to stop and release duplex streams are called at the same time. This commit merges the two functions. Signed-off-by: Takashi Sakamoto --- sound/firewire/digi00x/digi00x-midi.c | 1 - sound/firewire/digi00x/digi00x-pcm.c | 1 - sound/firewire/digi00x/digi00x-stream.c | 14 +++++--------- sound/firewire/digi00x/digi00x.h | 1 - 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/sound/firewire/digi00x/digi00x-midi.c b/sound/firewire/digi00x/digi00x-midi.c index cca888cce0d3..ca06ad318ed6 100644 --- a/sound/firewire/digi00x/digi00x-midi.c +++ b/sound/firewire/digi00x/digi00x-midi.c @@ -37,7 +37,6 @@ static int midi_close(struct snd_rawmidi_substream *substream) mutex_lock(&dg00x->mutex); --dg00x->substreams_counter; snd_dg00x_stream_stop_duplex(dg00x); - snd_dg00x_stream_release_duplex(dg00x); mutex_unlock(&dg00x->mutex); snd_dg00x_stream_lock_release(dg00x); diff --git a/sound/firewire/digi00x/digi00x-pcm.c b/sound/firewire/digi00x/digi00x-pcm.c index 9ed2ebdcf23a..c38fbd6ded9f 100644 --- a/sound/firewire/digi00x/digi00x-pcm.c +++ b/sound/firewire/digi00x/digi00x-pcm.c @@ -189,7 +189,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) --dg00x->substreams_counter; snd_dg00x_stream_stop_duplex(dg00x); - snd_dg00x_stream_release_duplex(dg00x); mutex_unlock(&dg00x->mutex); diff --git a/sound/firewire/digi00x/digi00x-stream.c b/sound/firewire/digi00x/digi00x-stream.c index 3c5e1c5a2e11..7c8e7ad48d03 100644 --- a/sound/firewire/digi00x/digi00x-stream.c +++ b/sound/firewire/digi00x/digi00x-stream.c @@ -293,14 +293,6 @@ int snd_dg00x_stream_reserve_duplex(struct snd_dg00x *dg00x, unsigned int rate) return 0; } -void snd_dg00x_stream_release_duplex(struct snd_dg00x *dg00x) -{ - if (dg00x->substreams_counter == 0) { - fw_iso_resources_free(&dg00x->tx_resources); - fw_iso_resources_free(&dg00x->rx_resources); - } -} - int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x) { unsigned int generation = dg00x->rx_resources.generation; @@ -372,8 +364,12 @@ int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x) void snd_dg00x_stream_stop_duplex(struct snd_dg00x *dg00x) { - if (dg00x->substreams_counter == 0) + if (dg00x->substreams_counter == 0) { finish_session(dg00x); + + fw_iso_resources_free(&dg00x->tx_resources); + fw_iso_resources_free(&dg00x->rx_resources); + } } void snd_dg00x_stream_update_duplex(struct snd_dg00x *dg00x) diff --git a/sound/firewire/digi00x/digi00x.h b/sound/firewire/digi00x/digi00x.h index 3fb1c49f6f9e..2d026b5b0079 100644 --- a/sound/firewire/digi00x/digi00x.h +++ b/sound/firewire/digi00x/digi00x.h @@ -143,7 +143,6 @@ int snd_dg00x_stream_init_duplex(struct snd_dg00x *dg00x); int snd_dg00x_stream_reserve_duplex(struct snd_dg00x *dg00x, unsigned int rate); int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_stop_duplex(struct snd_dg00x *dg00x); -void snd_dg00x_stream_release_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_update_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_destroy_duplex(struct snd_dg00x *dg00x); From patchwork Tue Jun 18 13:26:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7170112C for ; Tue, 18 Jun 2019 13:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B648F287C5 for ; Tue, 18 Jun 2019 13:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA84328ADD; Tue, 18 Jun 2019 13:31:02 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E906528AD6 for ; Tue, 18 Jun 2019 13:31:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4B28816FB; Tue, 18 Jun 2019 15:30:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4B28816FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864660; bh=eIf/Fg7sCNh6a+EDmqSRObxMIF75qZj6X0oXb3rz0Oo=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PorvcRx4ucUVaZ4y9/xvuxn1DF3R2IKRdpcg5yJymClzGkrnqskvl0eE3fedhwZwY mIh/9nP7BsZlSMGUQ1onSpIgMfxuq8SSOgxmIrhM6/46o3k1LyTih1OzzzdDNOieOp QV3ZRkqEMdIU/YwugBTi25SCOKOT9jLbP4R7bwNc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6976FF8973C; Tue, 18 Jun 2019 15:26:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 57185F89730; Tue, 18 Jun 2019 15:26:40 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 79D6CF89724 for ; Tue, 18 Jun 2019 15:26:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 79D6CF89724 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="HkCm0hHu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="W1WPSIqE" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A2B0721FE2; Tue, 18 Jun 2019 09:26:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=XYuflg2hhb+E7 JF2UenhcCvwqwGvcxXnRtvjt2muL4k=; b=HkCm0hHuOnjwN86wlYEGC9a72XcXV AsEjQ2he4uWPHHSUl2DYSfSA6IzLke1RcaYQH0E04RdgCnYihWX8ET1AbM6SUNx+ kNy2XwPYxUAk+xynFOk3usNAxYz6zlz/98kSTydnFlbVNcpFMkkyh/uqQIucAeRO iW/HoVR4sTtfPL9LqFAJvs3myxkd+8qUFr+6GucTW9JpjnNA1twtc0p7cf33FXlR cjWeq6w8XaygamkB0CwIyLx18tjugbtIL9Od3whPhucwmbq5EnG1Gndcou8IZ+u0 tqiADMc1yYFO/DWx8K66WVfREcbRac0JrJkIa3r2vw9pYT7AxEkfe8W3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=XYuflg2hhb+E7JF2UenhcCvwqwGvcxXnRtvjt2muL4k=; b=W1WPSIqE q6vJe+gVGyJf8CXt2ZHgnbYErAxpyTzJ+YBvVQZ0OZkHNQMcq1Dvr87Mv58VNfXS PdA0aqLFDU0nxDva+fcKr3n+3LGU7ZG/hwHNqFxdMDmzEOEmPGW5xnVga2k/9Eow ZbOu9dI3MbRITHCPGECcjYbrfs3Y1sdr6bGzUIEPMMTGraRogxcwFsBkNOW31YXY bemuIsDHOSA+K3kZzclHjSepYoe2H4iZw7i0TGCzGJp4soZyheoTsEtVCceKbq3c F/b4yOZPcxzDiEDymPETnEO01BektaWXLFLMIOtrcBfrvHhtAn3aITh5vKy12q6U wKvnUckDDNZC1Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A522380083; Tue, 18 Jun 2019 09:26:34 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:19 +0900 Message-Id: <20190618132622.32659-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 5/8] ALSA: dice: unify stop and release method for duplex streams X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From callbacks for pcm and rawmidi interfaces, the functions to stop and release duplex streams are called at the same time. This commit merges the two functions. Signed-off-by: Takashi Sakamoto --- sound/firewire/dice/dice-midi.c | 1 - sound/firewire/dice/dice-pcm.c | 1 - sound/firewire/dice/dice-stream.c | 8 ++------ sound/firewire/dice/dice.h | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/firewire/dice/dice-midi.c b/sound/firewire/dice/dice-midi.c index 6172dad87c4e..436f0c3c0fbb 100644 --- a/sound/firewire/dice/dice-midi.c +++ b/sound/firewire/dice/dice-midi.c @@ -40,7 +40,6 @@ static int midi_close(struct snd_rawmidi_substream *substream) --dice->substreams_counter; snd_dice_stream_stop_duplex(dice); - snd_dice_stream_release_duplex(dice); mutex_unlock(&dice->mutex); diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c index 00b55dfc3b2c..8368073f7fa0 100644 --- a/sound/firewire/dice/dice-pcm.c +++ b/sound/firewire/dice/dice-pcm.c @@ -265,7 +265,6 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) --dice->substreams_counter; snd_dice_stream_stop_duplex(dice); - snd_dice_stream_release_duplex(dice); mutex_unlock(&dice->mutex); diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c index e9e5c5fffb70..433714a117a0 100644 --- a/sound/firewire/dice/dice-stream.c +++ b/sound/firewire/dice/dice-stream.c @@ -336,12 +336,6 @@ int snd_dice_stream_reserve_duplex(struct snd_dice *dice, unsigned int rate) return err; } -void snd_dice_stream_release_duplex(struct snd_dice *dice) -{ - if (dice->substreams_counter == 0) - release_resources(dice); -} - static int start_streams(struct snd_dice *dice, enum amdtp_stream_direction dir, unsigned int rate, struct reg_params *params) { @@ -494,6 +488,8 @@ void snd_dice_stream_stop_duplex(struct snd_dice *dice) if (dice->substreams_counter == 0) { if (get_register_params(dice, &tx_params, &rx_params) >= 0) finish_session(dice, &tx_params, &rx_params); + + release_resources(dice); } } diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h index f95073b85010..fd3f483283d5 100644 --- a/sound/firewire/dice/dice.h +++ b/sound/firewire/dice/dice.h @@ -210,7 +210,6 @@ void snd_dice_stream_stop_duplex(struct snd_dice *dice); int snd_dice_stream_init_duplex(struct snd_dice *dice); void snd_dice_stream_destroy_duplex(struct snd_dice *dice); int snd_dice_stream_reserve_duplex(struct snd_dice *dice, unsigned int rate); -void snd_dice_stream_release_duplex(struct snd_dice *dice); void snd_dice_stream_update_duplex(struct snd_dice *dice); int snd_dice_stream_detect_current_formats(struct snd_dice *dice); From patchwork Tue Jun 18 13:26:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68D52112C for ; Tue, 18 Jun 2019 13:31:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5925D28ADC for ; Tue, 18 Jun 2019 13:31:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B77628AE0; Tue, 18 Jun 2019 13:31:54 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A752128AD3 for ; Tue, 18 Jun 2019 13:31:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0B62616D7; Tue, 18 Jun 2019 15:31:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0B62616D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864712; bh=TyEeMGp2WNwgGhepCpcSucRa0z8Hp/ZH6L5ti76HEYw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Hm6xU8aRihbq1jUbuVu6MVkFx+mToUcNmFQtqJPo00tMYQYnGgiBfZeuHo3ECbHHf apAkBUuCt8MLZx69Xv0YDkGEbzDEHXRkl3aYt/ohL7L521jd6XjtNAci5EREIOxyo6 R/0tbYRGDdjAtCrVOhqncjHkiN5DJ1XXPJNhTB2U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D9CC6F8974A; Tue, 18 Jun 2019 15:26:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D7D14F89732; Tue, 18 Jun 2019 15:26:41 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2D4D3F8971F for ; Tue, 18 Jun 2019 15:26:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2D4D3F8971F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="p6z8xwZN"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="BcBYGx7S" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4798022337; Tue, 18 Jun 2019 09:26:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=o3FCRXdA6Njct Dboj46v2dk6w9NIM9zaVugZCmHKDLI=; b=p6z8xwZN1UAlzIHCDp0mIgGT1Um3b aN261ix8a9V9PUPgQqMAE8U70wSUwNYi2yKpgwS9zBaA1J/YrGcsPkv3cOmPyxiz TTynmRZHQC0GOFo7TwHcvjSW97qwtZnTaT74t72eOHF+iol5YwgbDpQzM4JH/eGx 5T9GRNlXc+UxPWbo/xKfjfhWDDvnQnJ0tpOPl3WYoc1yRxf4pI7/b7zSIJbPnHq9 Z1RyGUsziQJDKYoSAzgAOdrHpOFIuUybENmhSpyWDdiUamHhqFnfKzyf0RjHE5oy J3IN+cDRvUPTbBA3DemuLqkEYO9+XBSfyZcjl7H5Y5ECN7AHzpUY4XT5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=o3FCRXdA6NjctDboj46v2dk6w9NIM9zaVugZCmHKDLI=; b=BcBYGx7S PCUzrmT5JScGGcwjkAAIzt5vHNjdbhYoe374yqHOe9U5kuYl/6jJZmFnzkvUIOYn /VAPF7fc6dzSPoz6zFkdALzm1p+sqfWAH8i7RUSOc4qkmicFapcCAW5BGFSTw1Q3 FT6rEPkiVswH5VVk3Y83KfEce1FQSQ8IBhe1rPAYkjtLo0EyrkGd9nzNhqeu2v5/ UxRjdI8Om7ke8AqRFDIaoGW69P+vwK0fuqeXUEty4b+pHfn90DwI9PdP6BdzYV6N P654FgM5U9srhi9gDZ1V1Woql9rgUtNR7LvDs0NnwACHJ+S3y5oP3je4aMn4a8gO 5d6ra63ReA8/Cw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id CDC56380083; Tue, 18 Jun 2019 09:26:35 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:20 +0900 Message-Id: <20190618132622.32659-7-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 6/8] ALSA: bebob: ensure to release isochronous resources in pcm.hw_params callback X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP When stopping packet streaming in reserve function for duplex streams, isochronous resources should be released. Fixes: 7bc93821a70a ("ALSA: firewire-lib: split allocation of isochronous resources from establishment of connection") Signed-off-by: Takashi Sakamoto --- sound/firewire/bebob/bebob_stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 1070a675179d..63e78fc8711d 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -571,6 +571,9 @@ int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate) amdtp_stream_stop(&bebob->rx_stream); break_both_connections(bebob); + + cmp_connection_release(&bebob->out_conn); + cmp_connection_release(&bebob->in_conn); } if (bebob->substreams_counter == 0 || curr_rate != rate) { From patchwork Tue Jun 18 13:26:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48E54112C for ; Tue, 18 Jun 2019 13:32:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37555287C5 for ; Tue, 18 Jun 2019 13:32:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B91528AB9; Tue, 18 Jun 2019 13:32:33 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 81CBB28A52 for ; Tue, 18 Jun 2019 13:32:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AA86116CE; Tue, 18 Jun 2019 15:31:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AA86116CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864750; bh=JzsXCELlxeVjHf+AH2qaJAuIbQrWsZ9md9HO3pmpIXc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=d2Ro8mhMUxfQPos8mp+M6x9GSqu8A7LXtqDrwW4bX8tcxEEkgIk01AlziS7/a8N2C 8or3OmVH34WdgDxxYfb97w5FBTHHqj0dgPZ0p7gANT0nbfUrbeigXoPAmgpLfUH04Q Vr2L/yMwfExjRmZgXkU9erakS/hbD6ddzDnmkHyc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EAC48F8974F; Tue, 18 Jun 2019 15:26:49 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D7AA3F89736; Tue, 18 Jun 2019 15:26:42 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B5D21F8972F for ; Tue, 18 Jun 2019 15:26:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B5D21F8972F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="viA2gO+S"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="w/SmAsA2" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DE3B6222B3; Tue, 18 Jun 2019 09:26:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=eL5bdHPMCjJti FpEh1pcQqyS22X+qAnP0MD9CL6uFW0=; b=viA2gO+S25burcQ93GDDUD0CDhjB9 wKLOlRENjJP/qxZUeGvYjvEtIbCd2+PvlDc4s+sfeOL6lpYW4hZHqch2UG/Vj1vE Qt46EB6gmHC8bf1oIiFn4huuvSWTtyC3dwOB+BtHCdjsOn5IXMAgGmdQerYSjuu3 1QL7v67Ek4phoh005tZxLl7qTOoya855aXQYJLjR8Rw9TD3opiV2pgqE18KFubRF TGQsO+llswcMOpdkDY1+2tDuQIRlySUtvVXLF2XzMuP7wBTVhf5uVfz2rAvt4qyN 95aIkz5VgS5VXogP88uXfAxbhiw+9dN+HXg1gxZ8V1mPufGUfSZSLNyzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=eL5bdHPMCjJtiFpEh1pcQqyS22X+qAnP0MD9CL6uFW0=; b=w/SmAsA2 2O9HxRpnN64RJMuHfA2Y1b4Ma8o16wIFHOI4LallUBDOUURu9LbyXcjAWwyt0uDQ 5+XBdHWnB9VWG1PskjhQ6MqyMB6gJe4yTMnQwxAB7w2PQtkVIIaSo3jtqaQSfG38 oUoCE0hDkkBKhuNB8eCO1rPKFnrjuxsQcLzg+qKYeLOZKXq3hTaVIX51B2xKSg16 xscyif0gsw6/3iti4TFOm24pGWtNRIigxZeeWZ7ZyI6maV7j7QV/hjVXaSllYlNw ByKsyZXQEa7uqvnh834HxsAQJ+9R4NCP2/GHNC2WYeV0pyhsUYu38iUmE+K/5VCT BdMcDA8RVG7SWg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 6961D380083; Tue, 18 Jun 2019 09:26:37 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:21 +0900 Message-Id: <20190618132622.32659-8-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 7/8] ALSA: fireworks: ensure to release isochronous resources in pcm.hw_params callback X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP When stopping packet streaming in reserve function for duplex streams, isochronous resources should be released. Fixes: 7bc93821a70a ("ALSA: firewire-lib: split allocation of isochronous resources from establishment of connection") Signed-off-by: Takashi Sakamoto --- sound/firewire/fireworks/fireworks_stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index 81c1bb209a89..16cf635a6f57 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c @@ -217,6 +217,9 @@ int snd_efw_stream_reserve_duplex(struct snd_efw *efw, unsigned int rate) if (rate != curr_rate) { stop_stream(efw, &efw->tx_stream); stop_stream(efw, &efw->rx_stream); + + cmp_connection_release(&efw->out_conn); + cmp_connection_release(&efw->in_conn); } if (efw->substreams_counter == 0 || rate != curr_rate) { From patchwork Tue Jun 18 13:26:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11001723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51C13112C for ; Tue, 18 Jun 2019 13:33:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41C5B28ACD for ; Tue, 18 Jun 2019 13:33:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3590228A44; Tue, 18 Jun 2019 13:33:14 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8315228806 for ; Tue, 18 Jun 2019 13:33:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BD3D816EA; Tue, 18 Jun 2019 15:32:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BD3D816EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560864791; bh=nkzh5BUDoKEmim8Klx8z+W90wWDCg4zDIjsF3LP7Abo=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ujHgIWypax/rhS4LytknbaniAT2uYOFpGyvdaktq2WlI7qUGngVG8lVYu0QHRCg/k Llx8MNpd2gSyCGiW/npOwfTl1UgVdOarRxhe2uXqH711ZreOLkVSvCnVuX7AUqhQI7 LkLTdSu2NCIpAP7S6NAsxGyxdoyCJCZCStyHgoIE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3A375F89751; Tue, 18 Jun 2019 15:26:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6EDD1F8973A; Tue, 18 Jun 2019 15:26:44 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 495B2F89732 for ; Tue, 18 Jun 2019 15:26:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 495B2F89732 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="Uvwg7yFQ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="iLXo61NI" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 70FC022201; Tue, 18 Jun 2019 09:26:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 09:26:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=XcJuu0yIYhTZ2 ARU4mxufPmxgfNHZiDt7U/grRJHqFU=; b=Uvwg7yFQcfUGbcN5KJJJW7POc9aCm VedECMogzWZcl5DmyCsP4+RU4v70ioo8zO55QVtE1uWbpLsTdcyAahQkhmHeryED tqXIz2Btr6Q4HB7CzQ94+NLY1hXfYfmUZa5J/jnCE9a96BH9SEwDHcWbesQ/SdH1 ZinpX57YNDP0VeiaTcHHwnrRmXF+hp4iO2p8RY+TJnd1uV9PbIiL8NwSPw5povQc 37Hy3zobHAZTSBiAPZNoDgFhrD10hpT6gq4A0TB/oIzzMasfzQKsAZQrSDzDAD5/ iuP20dlu48dKek5g3Ja62vx5t87eotaIZTm+6SAIdduT8Zc/5lLj1mP8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=XcJuu0yIYhTZ2ARU4mxufPmxgfNHZiDt7U/grRJHqFU=; b=iLXo61NI 4WoeGy0JiRiIfRfMqiy68bGlbY6dtj6xuZ2r9Mhq6EoaYHa011gLlgZRCs8Jb2JN /+OCVF/2sJJRTO5IK9nB6hCohN03uTTwStyrUTKG+U8GCeGsTD59lL7CMEWn44gX FXcj+gKWVu4uTCh1IQHT1ki5NSAoO7NHmfeZzUxfcPYhRLZQXy2+WynCe+HXlBru ZJWDEO8GXA4P0iqDwMGf0cw8AN8FN+V+QB6OXlSidQHfeEj4iD08Cr+vegV1xTsr y3muyPyqXkMCLSmebOmNvOuybH9P2yHFAfIzBwEZ8GEGPu4zzfSIPQbkQrTIeJhW Wk/Jd/8laYeeXA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekudenuc frrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhi rdhjphenucevlhhushhtvghrufhiiigvpeej X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 0395A380083; Tue, 18 Jun 2019 09:26:38 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 18 Jun 2019 22:26:22 +0900 Message-Id: <20190618132622.32659-9-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618132622.32659-1-o-takashi@sakamocchi.jp> References: <20190618132622.32659-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 8/8] ALSA: oxfw: ensure to release isochronous resources in pcm.hw_params callback X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP When stopping packet streaming in reserve function for duplex streams, isochronous resources should be released. Fixes: 7bc93821a70a ("ALSA: firewire-lib: split allocation of isochronous resources from establishment of connection") Signed-off-by: Takashi Sakamoto --- sound/firewire/oxfw/oxfw-stream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index a8bc798731ff..a7502810a3ad 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -283,10 +283,12 @@ int snd_oxfw_stream_reserve_duplex(struct snd_oxfw *oxfw, if (formation.rate != rate || formation.pcm != pcm_channels) { amdtp_stream_stop(&oxfw->rx_stream); cmp_connection_break(&oxfw->in_conn); + cmp_connection_release(&oxfw->in_conn); if (oxfw->has_output) { amdtp_stream_stop(&oxfw->tx_stream); cmp_connection_break(&oxfw->out_conn); + cmp_connection_release(&oxfw->out_conn); } }