From patchwork Tue May 29 14:59:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 137177 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp4160435lji; Tue, 29 May 2018 08:00:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLroHGPqMJ+2bMnAJ4yd4A1FIG0jBL7e4fkOp7U79can6Ve9Lgz6+Lzi/ZYF45dpF2MBCP8 X-Received: by 2002:a1c:1549:: with SMTP id 70-v6mr1840037wmv.35.1527606040970; Tue, 29 May 2018 08:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527606040; cv=none; d=google.com; s=arc-20160816; b=ifPKuR2jm7OoB3rkIEyI4wkZAYTHzosXb5h1mvH1yCDnOxQBdx6uLJesKXWQudFfyj Ewq/SvqmPKQjN7TksxQv0/8gULPho9Omk87btzHtmF3TwqDY1djnMRrnVH+AdwBKqPsL N4/8L2CDiz1dor8mvleEivCIEoyI28/V57jDeEg7av/d50pnZeWWPqs8jm5+YXm273+g /xom814Od5uqs7rBiTouHV17YfmGgn0ZX7uivjLVDRjutHq1VrH0mjFwbPPuJ/KkS4E+ jYFOmkmkPZBWSQM9w4tttGEc7Nbuo5Yfm4Ne4pDn78blK6hTCA/TNDJlc8DQCDXq1cWd 9D2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=NKhGV6kGyZjJt7r64vQTMR5J//t6WmRx2yzeU3dTIW8=; b=QmQ+aAAYxCoJomshElUsgisOjFQkgMvc5FuaFnZEZm0w8mBzYa5xDTmccfWcOT9cJb d11OHHsBdbEw6SGoeJxEm7XV0tbGQqGvYv+hsCY99X05b5PjZaPRHdhq/3uzM6l++kMh Lv4qiU+6hHAJ6nbeiq7N15Mi/pegODFiNGbwnQ8MnRM+ZHtJFkfEVDEx8Lc1FUTgMtC+ 2aaBu50l1UR5MftakinxatlsfmnnDsJHYiSg7t2ABuYh1M8qTXY8vdXVk7YIbEyuwBbm DywZ5Djzx1ckD7GGrEFxq3Q03Pn2JECKh9d5Axv7ltXbWM6wqixovXz9xs388pjHY/KO sPOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=TobNBoKv; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id 32-v6si21934560wro.361.2018.05.29.08.00.40; Tue, 29 May 2018 08:00:40 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=TobNBoKv; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E05E1267742; Tue, 29 May 2018 16:59:57 +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 4D6D626773C; Tue, 29 May 2018 16:59:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id C9997267705 for ; Tue, 29 May 2018 16:59:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=bvnlUmKrVK1YJ5YCr0X81ZtLz61iJOA52Pz+JUdoF84=; b=TobNBoKv3Woh gFviimEFb9+X6parik8XQ4gjK3Gi6UhHr28mH7U8YmeBSPpaulqvXZxEvTwRVdgTQJv2wJKUQTM/s mG5vXrEz57XNMQnrIOVg5/N7jH6LF64eX12bBO4wuqzlKLO7kN0VtlMzmOMQupWOk0xFuxN1ub0YS cMIks=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fNg67-0005bl-Hr; Tue, 29 May 2018 14:59:39 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fNg67-00068C-3o; Tue, 29 May 2018 15:59:39 +0100 From: Mark Brown To: Kai Chieh Chuang In-Reply-To: <1527473899-23079-2-git-send-email-kaichieh.chuang@mediatek.com> Message-Id: Date: Tue, 29 May 2018 15:59:39 +0100 Cc: alsa-devel@alsa-project.org, broonie@kernel.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com, kaichieh.chuang@mediatek.com Subject: [alsa-devel] Applied "ASoC: dpcm: fix BE dai not hw_free and shutdown" to the asoc tree 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 The patch ASoC: dpcm: fix BE dai not hw_free and shutdown has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 9c0ac70ad24d76b873c1551e27790c7f6a815d5c Mon Sep 17 00:00:00 2001 From: Kai Chieh Chuang Date: Mon, 28 May 2018 10:18:18 +0800 Subject: [PATCH] ASoC: dpcm: fix BE dai not hw_free and shutdown In case, one BE is used by two FE1/FE2 FE1--->BE--> | FE2----] when FE1/FE2 call dpcm_be_dai_hw_free() together the BE users will be 2 (> 1), hence cannot be hw_free the be state will leave at, ex. SND_SOC_DPCM_STATE_STOP later FE1/FE2 call dpcm_be_dai_shutdown(), will be skip due to wrong state. leaving the BE not being hw_free and shutdown. The BE dai will be hw_free later when calling dpcm_be_dai_shutdown() if still in invalid state. Signed-off-by: KaiChieh Chuang Signed-off-by: Mark Brown --- sound/soc/soc-pcm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.17.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 2df4719a84db..2d846b3dd70c 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1866,8 +1866,10 @@ int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream) continue; if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && - (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) - continue; + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) { + soc_pcm_hw_free(be_substream); + be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; + } dev_dbg(be->dev, "ASoC: close BE %s\n", be->dai_link->name);