Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp247938ybd; Tue, 25 Jun 2019 20:42:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyf5yGaF0VNZzdzom7Cs8uBoYUoIeRCizhAZUbMO9uTKnsEhNpaTr5vvOJ0WHtXnR3kuAz1 X-Received: by 2002:a17:90a:2506:: with SMTP id j6mr1801698pje.129.1561520520414; Tue, 25 Jun 2019 20:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561520520; cv=none; d=google.com; s=arc-20160816; b=TSkMGoJyOR6SWpTP6fnmK0j9+i0nGGU0Se3Iyxbp+rwY1bXop43ft9QuI0aM2B5X3A qHjjIcLv2bKUyINLfeGfx+J8sK3BtRM+IfQ3q0KVK7yK/sZAYLujKfL0wPOBgqd6Taap fR+oCOhE8rswWAQ2g4+rN4SSakfNVdpq15Yjmsh5Lo0Gjb0bwchsjBI4C9rjcNz2xJyi UtTUw3hpoqj3O2I2kwmjLe4e7UAMU8GLHeC/PVgbB2E9fuufq6Hc7mG1NgN6yUcKciVW DQmrUuxrtWuh1PJH2Vl7KVVdqYiLMsDOE68fuyQoFqLElkxA9PRLgZ+ZwXgpa6e6qH30 dzyA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tj/ci7soghxaMEdOvqhWyKAP1aHtCf9aBLIhZ/zTpGA=; b=I32mp3oIPJ3ohqJBGusoBlOs1kFukr2lxZ9Vc3OFvI9jXnnwz+P0I4QHpfCQD0RDwJ sVXik4MPfJLXiQnjNRNOkX+Uqi3ju3Rhlf5d8/dztuGxRw3byYONvzXtY80sQe+G2fBb xE/0OCpKwpZgKfmCfCaSdC01VejNG2mEKxGJI934d63PsrnCqRO31gy5vHqdc6Mow7Uc g1bE8KgwhFceeIC86w6Zkvv2Z4QJ/LtwW/P7GqSmGGX8edXQLKrcBjF9qQRdLfpPNxU4 JSkn3pq9oD0di8qus4amLMr9ObLZXcqyTcOzpYm3nxkNmQbP0C2q7kn9Sb/GpeCaCyHV uxPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YPoz5BhE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k71si798495pjb.83.2019.06.25.20.41.44; Tue, 25 Jun 2019 20:42:00 -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=YPoz5BhE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbfFZDl3 (ORCPT + 99 others); Tue, 25 Jun 2019 23:41:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbfFZDl2 (ORCPT ); Tue, 25 Jun 2019 23:41:28 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 378622146E; Wed, 26 Jun 2019 03:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520487; bh=2nXvnWy/pEcwckiMBbIBHScHP1PnX86MrzkbMvwCjX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPoz5BhEU4I/QnEgkYC2d4GYnR8KjRbRZ/gyEJwN8YYGfT8/k881q0qFxui4Iv6Ov b1N6WFWslpbIneMiNMs0/AQWytVY6VfTmIFxqBuo9Wu2WyXB67kyNuuQLlwLuaykv5 V/fBi8L3ZI5Llq92f5+aNo9HSvtaqL48zCK8uCzY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Libin Yang , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 5.1 04/51] ASoC: soc-pcm: BE dai needs prepare when pause release after resume Date: Tue, 25 Jun 2019 23:40:20 -0400 Message-Id: <20190626034117.23247-4-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Libin Yang [ 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