From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15D29C606BD for ; Mon, 8 Jul 2019 15:23:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1DB8216C4 for ; Mon, 8 Jul 2019 15:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599436; bh=FZxqh4LO5sleiDesi/CtbFNRaorh+bgW53p1xXQuq1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aQSXmaUcjjonEWl4l0JABNC6rBU+ByoIMfYxNMKDkmeXghxHQ1FlSmVx9L1S/NMA2 +X/s8tnc6kdIf4dYttcC8+3c6q9lTs6uMcqDoJPN3+fxu/HQOH7VyP8ozCFv3wdkRA 9IJ9H1dbEg+T/sViVErsYiyUP6qNszk9Rsv14A+8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388263AbfGHPXy (ORCPT ); Mon, 8 Jul 2019 11:23:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:50888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388239AbfGHPXp (ORCPT ); Mon, 8 Jul 2019 11:23:45 -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 A02F2204EC; Mon, 8 Jul 2019 15:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599425; bh=FZxqh4LO5sleiDesi/CtbFNRaorh+bgW53p1xXQuq1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W2hmvk+dmQ4TW9gYt4yXMmHhLhle9PQZy05LCgeM+9Q8FiXJCVfJZfLOi1NFDTOEu cVp6f4JzLpXKe26Hm4LYkLw8nkL5Mq1fQ89VFFzevCa2PsALJ2V9/uBUGhRGcL4LaY cNeYfdAMe/VgT7pgE57ycO1DfL31bg65mR5sRU/w= 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 4.14 03/56] ASoC: soc-pcm: BE dai needs prepare when pause release after resume Date: Mon, 8 Jul 2019 17:12:55 +0200 Message-Id: <20190708150517.274044300@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150514.376317156@linuxfoundation.org> References: <20190708150514.376317156@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 584b7ffe78f5..052b6294a428 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2233,7 +2233,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