Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7150587ybi; Mon, 8 Jul 2019 15:39:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzkoqcWfI+pXjbZZ4S5ls0+lmlRVfsP6mDxGyKvFhpyviaJIuARtH4x7Ws0PbOEMgve0/w X-Received: by 2002:a17:90a:8d0c:: with SMTP id c12mr27618561pjo.140.1562625589648; Mon, 08 Jul 2019 15:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625589; cv=none; d=google.com; s=arc-20160816; b=swpxeEJy8RMFj4EgGI3NLHz/nxNoDFIwratRRQmDreD5I1yCuq7ZXgmHi9WrIDzhZJ MBRZh6DbLgQ4Iamtq9fOZbE44Vxhr0MMzJAztAJJRRM5kcGB0sF6TVrk0KNkGokPTvpr PnFe95oBLg4WaVM9br6+pOQ+FORcHZRNzcTI2FdFSpohCV5ZJ+QKwlTVwcpOkl16aBfx opMojYqKH4Lx7ouJP3GqSEqeaTKw3ATzLCnCIZqPJJPDHa72RP+Wc4dgzwe/hPtkSnew OA0JGbVxSxrX+By6fu1ceU6hC4TUMXocbtP+9fQ3W236/JLLzqEGeQoUOpCu6K7IGihH nNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W6MQTFaqWySkXaGCB0it1KB0u0iYu6o7R9Rs83frVdI=; b=pkP8JNu0sRNZMf2wSY8B94fzJmUCEKblDrs/K2OBqh74/Y0wWaRe8dA6itNxZMvJ/M hVWar72jIIGxZey/QfFrW328z+Wf8CbbYx0SGjH39TYj8FTCHfx6LZcs6wHTKHUrb2yW UeiAigMVbNipMC5zB2far9wp/3HCgzDVHfiKTT5ljOTib/sOswYlxkC2Wr4A8aFMXSrD ZiqpzuDdTiOLUjcCQALsVkfOwXCjuAk1ZkNRduy2NYRryIBrWoEoqrXoMbRYQdurZt/A iq9iTBCUU5AAl9KsK9nUJwDSwkd2PyUPP9ycE/qAIeWQuutLWorwe+MjamzInwd/Qm37 Drdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0YPliTCY; 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 w16si2191751pfi.31.2019.07.08.15.39.34; Mon, 08 Jul 2019 15:39:49 -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; dkim=pass header.i=@kernel.org header.s=default header.b=0YPliTCY; 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 S2389893AbfGHPaz (ORCPT + 99 others); Mon, 8 Jul 2019 11:30:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:60074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389880AbfGHPay (ORCPT ); Mon, 8 Jul 2019 11:30:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 259BD21537; Mon, 8 Jul 2019 15:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599853; bh=ADi30Ck50rzB1EE74vR/W3PpNndR0/wK5mF1gaaO3v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0YPliTCYG9UgEucHwjsRotX8shk8quUEfKegRkYCKGszA8JPTs0pem/tdos1fuBMP n5C/PRMFZ/gM02U+W/ygF/+OB8X+cTeVGmqh70qamdrykYl8mlQbvtFL+SlqUUoqB5 7chJU54O9S+y3H389SqbRVIOX/kqp7crpJu1GSSw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Libin Yang , Mark Brown , Sasha Levin Subject: [PATCH 5.1 11/96] ASoC: soc-pcm: BE dai needs prepare when pause release after resume Date: Mon, 8 Jul 2019 17:12:43 +0200 Message-Id: <20190708150526.955168693@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150526.234572443@linuxfoundation.org> References: <20190708150526.234572443@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 5087a8f17df868601cd7568299e91c28086d2b45 ] If playback/capture is paused and system enters S3, after system returns from suspend, BE dai needs to call prepare() callback when playback/capture is released from pause if RESUME_INFO flag is not set. Currently, the dpcm_be_dai_prepare() function will block calling prepare() if the pcm is in SND_SOC_DPCM_STATE_PAUSED state. This will cause the following test case fail if the pcm uses BE: playback -> pause -> S3 suspend -> S3 resume -> pause release The playback may exit abnormally when pause is released because the BE dai prepare() is not called. This patch allows dpcm_be_dai_prepare() to call dai prepare() callback in SND_SOC_DPCM_STATE_PAUSED state. Signed-off-by: Libin Yang Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-pcm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index be80a12fba27..2a3aacec8057 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2469,7 +2469,8 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && - (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) continue; dev_dbg(be->dev, "ASoC: prepare BE %s\n", -- 2.20.1