Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1157896imm; Wed, 1 Aug 2018 11:08:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf5QvW+DNk5yxk9FMP2jxC2U0edHoCzcHXla0F/X/xX7ZNWxwZga6cwZEyOvky4PjhwKY09 X-Received: by 2002:a62:51:: with SMTP id 78-v6mr8616295pfa.135.1533146899839; Wed, 01 Aug 2018 11:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533146899; cv=none; d=google.com; s=arc-20160816; b=IE45GWm9t1QSRCxO5tt/RBrydkZxODg9X/sNrvcqO0pFOnW+cfjiBIERMor1plYtPb llpSfR52Qw7mKBG4YPMc+PbMb/MKQxx8L+JAFz679KbEsrOJTyZIAuJR7veuF9ppDZqX tuSRYUST2c7r6vtgAtaxpMov7zbfl8qedrhBwtYnf2z/HqoLSUzafxLJYe3BqsAgg3bn Dnr2mkavCzPr/anF3cMBlkPL6uL02r6nyewmbGbF/VeEr0X+FNGxh9W1RzFldpIIlyyh iNbl7iLtAeqU7PvGunBq/gIz/bQystcJqX9y2FhC2DRC7BWXrQn3baNxZdPdW2IrST83 VMHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yzoXddj8nxj/HV34Bm0e3u0PdaVHVlnnJAJGpvWJ3YA=; b=O/yJhFH75TfZP8hdFCDsgbR42zhyFv5EMnwskAl+jEUSn4MAS+8883GF5U/IMHCKYR M0xWEKa6tI8K+vKNM6/ra0gC+DohVVA+BqPv3hEjvXvFHPcU5gNU0Fp07Gtp+Ca0EQNM uQKcxxRkXBFW3/TWbaSZhqKr7SPLPaYbTdBrz1sX+0RAngWpXOaaV+5RKjAilK+AvFpQ n2h6EgeEdgVG0U3zyl9+YPQsc7Ic/bqw0GixwP0aXr7wNHa01UaU7MENNw0ytcQfuMoF gEVgmqvLFd41rm6OL8EB4cwUEgH92YmkfMNieIrAnKLM2pkoi9yj3DtWvTWo3y4fxu7/ x2ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4-v6si14730526pgp.580.2018.08.01.11.08.05; Wed, 01 Aug 2018 11:08:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387447AbeHATyF (ORCPT + 99 others); Wed, 1 Aug 2018 15:54:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49804 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405795AbeHATIh (ORCPT ); Wed, 1 Aug 2018 15:08:37 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EE7A013BD; Wed, 1 Aug 2018 17:15:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, KaiChieh Chuang , Mark Brown , Sasha Levin Subject: [PATCH 4.14 075/246] ASoC: dpcm: fix BE dai not hw_free and shutdown Date: Wed, 1 Aug 2018 18:49:45 +0200 Message-Id: <20180801165015.300533333@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kai Chieh Chuang [ Upstream commit 9c0ac70ad24d76b873c1551e27790c7f6a815d5c ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-pcm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1779,8 +1779,10 @@ int dpcm_be_dai_shutdown(struct snd_soc_ 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);