Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp168232lqo; Tue, 7 May 2024 16:23:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTWid3nz7i1KfJahMHXUDc6g0jGdJGs8pOfht3TKR8ypaA8b1QIdp4oFEEfDcDruwUdL5olWL8dOeLXYFBWQZho9o2Ws8ntRffmiuYOA== X-Google-Smtp-Source: AGHT+IFzt8dCzNzPsTRMWRy5h12U8KPwmCnkXYwcy3t48x4nW0Fcfy6PDqy7QuQzXS7OwI5bhGW9 X-Received: by 2002:a05:6122:469f:b0:4d3:3b1b:aa92 with SMTP id 71dfb90a1353d-4df69345c57mr1116528e0c.11.1715124210996; Tue, 07 May 2024 16:23:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715124210; cv=pass; d=google.com; s=arc-20160816; b=gXci2RxgXz0Zr+SPIpRD58+LMBJf4JfVPOpTrbIbQzcwhVXgQDhlrxRh7H/Qm/FmBS U+W0AizoscFwlN/93Z1HVZo+0mTjg8lBQrdKf+akdZpnzjT7NcDQslnfWx59rTLWLv2/ Otf0PJ/AWN4VIWDUo74zbJJNbUwBFSFnXR2yBpi7Vc2JLm/nZYAimrCsf15ZbxV7ghKE JsuwIctiHTYLS8IfEYxDXQJs5tM7BqhLcHQ/PHdONieE6nL1EKzIjx18SLRQ2P+midBA F0eIou/ThYv2XZbAagWKLLP9GM4Fsf171QIPtgYWWJ3BwumirD97uoH9zcJdxGcyptEA dToQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=fFfm38yH1KTnK+dMbvlVnXz64YaChjUO1WYUlKNwTcc=; fh=Yx1kxF5pZ9TMk3FsRXXTioh82DdT4rhnntIZwsUG1eQ=; b=pJbB+J/0MUmOOcEi78+8lPpWsxCT6C45t8U0/yRy3ZTbbYL5oMmuy+i+b66AN2gR8H RUcd1TO2bqUs9Txd1CI15USpbO//GoNVUyuaRJFhkszWQ7tWolzDHDEtsbo2Xz5SU0J3 /QYvwAQdtCm6CmxfBIMVt2sOyVROhtEGLp2jxYQqttTWLOKb9prbDQBybgfmOtHbFUw8 ziq84N+5p+P/12gq2v9lTqpLBf4IFNjDJnu3hJbYczLYv97LnprsMGnOx1DBTDGa8Me2 QoJG5NjpoSf1XKlt25ZlRudDjJ9v3My8VoWyPu9mz2pwd87Q7ufUALqlSn5q1m/BMzUR agYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ua2Ykv0U; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172349-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u22-20020ac858d6000000b0043af80f3078si12453476qta.494.2024.05.07.16.23.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:23:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ua2Ykv0U; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172349-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5B0671C22FFF for ; Tue, 7 May 2024 23:23:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13175130AF3; Tue, 7 May 2024 23:08:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ua2Ykv0U" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31825130AD3; Tue, 7 May 2024 23:08:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123295; cv=none; b=lIJXVYzcEj8idkLRSYmN83KwMD3n+0A45YlUujXfSGE4rwqrkMtrg36R7rSyKsn5cmAEmBmSSZnNc7LAq1A4tI/EN2CCfDDgMpoCzG7WEPLFxXHMgadYmwC1W2SLzyiQprobPqhUliiuLcvlvu+juLRFe6UeEYdrnJpYjrpI9Vg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123295; c=relaxed/simple; bh=wXz2BuXc74bmjDqhTEU40pxq26+fO6/UemXfc3UHyEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mUCP747FQXphwooBaLHyEXQKKiZUPUd1OvHca66wjYXJhdZ4S/dmudpEQH3B1zfPDNKm2nJDRDRnNM2P0j4x9gWvgoCdhBT0/GOb8AkYmwwjHYgb062qjy0LHN7K2iIn+FTkWbFzvPnNNSIkBRV6jP+fW3KV3ccYwOcrWBDUGfM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ua2Ykv0U; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 328E7C4AF17; Tue, 7 May 2024 23:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123294; bh=wXz2BuXc74bmjDqhTEU40pxq26+fO6/UemXfc3UHyEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ua2Ykv0U0ip/Ztes+WuPuqDw0QhbeiDFbjlhKMM2dWQCorc4sWYDx8Y3IsR9djBnV KGgwcC82Y3gIk4e/0NYRIvaQpouEBwwbCUtZPOspynWV4ijdqGr3PJKC6vS5FuV0d5 T1jeb9njt8PcfTI9SZMOiTI67nkdsR7GfgusBv7yfu9hE5sW5Ql4HNFpR7aPSsxh/a i/FCl8Bbe5eEoONa8GGqi1lJmcbVKRfURfx8WQVDwh1xA3iHyToO2x7L8jy3aR6p5U KyWIBW9w5rR7T1fATUFanrTN9O4ZkGI7qoXM8CK5OVXqTGHXostXJ33N13EIRH2Qyc kVoTnv1vfEqkA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ranjani Sridharan , Uday M Bhat , Bard Liao , Pierre-Louis Bossart , Mark Brown , Sasha Levin , lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com, daniel.baluta@nxp.com, perex@perex.cz, tiwai@suse.com, sound-open-firmware@alsa-project.org, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 07/52] ASoC: SOF: pcm: Restrict DSP D0i3 during S0ix to IPC3 Date: Tue, 7 May 2024 19:06:33 -0400 Message-ID: <20240507230800.392128-7-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507230800.392128-1-sashal@kernel.org> References: <20240507230800.392128-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.9 Content-Transfer-Encoding: 8bit From: Ranjani Sridharan [ Upstream commit 90a2353080eedec855d63f6aadfda14104ee9b06 ] Introduce a new field in struct sof_ipc_pcm_ops that can be used to restrict DSP D0i3 during S0ix suspend to IPC3. With IPC4, all streams must be stopped before S0ix suspend. Reviewed-by: Uday M Bhat Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://msgid.link/r/20240408194147.28919-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/ipc3-pcm.c | 1 + sound/soc/sof/pcm.c | 13 ++++++------- sound/soc/sof/sof-audio.h | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sound/soc/sof/ipc3-pcm.c b/sound/soc/sof/ipc3-pcm.c index 330f04bcd75d2..a7cf52fd76455 100644 --- a/sound/soc/sof/ipc3-pcm.c +++ b/sound/soc/sof/ipc3-pcm.c @@ -409,4 +409,5 @@ const struct sof_ipc_pcm_ops ipc3_pcm_ops = { .trigger = sof_ipc3_pcm_trigger, .dai_link_fixup = sof_ipc3_pcm_dai_link_fixup, .reset_hw_params_during_stop = true, + .d0i3_supported_in_s0ix = true, }; diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index f03cee94bce62..8804e00e7251b 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -325,14 +325,13 @@ static int sof_pcm_trigger(struct snd_soc_component *component, ipc_first = true; break; case SNDRV_PCM_TRIGGER_SUSPEND: - if (sdev->system_suspend_target == SOF_SUSPEND_S0IX && + /* + * If DSP D0I3 is allowed during S0iX, set the suspend_ignored flag for + * D0I3-compatible streams to keep the firmware pipeline running + */ + if (pcm_ops && pcm_ops->d0i3_supported_in_s0ix && + sdev->system_suspend_target == SOF_SUSPEND_S0IX && spcm->stream[substream->stream].d0i3_compatible) { - /* - * trap the event, not sending trigger stop to - * prevent the FW pipelines from being stopped, - * and mark the flag to ignore the upcoming DAPM - * PM events. - */ spcm->stream[substream->stream].suspend_ignored = true; return 0; } diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h index 85b26e3fefa8f..05e2a899d746c 100644 --- a/sound/soc/sof/sof-audio.h +++ b/sound/soc/sof/sof-audio.h @@ -116,6 +116,7 @@ struct snd_sof_dai_config_data { * triggers. The FW keeps the host DMA running in this case and * therefore the host must do the same and should stop the DMA during * hw_free. + * @d0i3_supported_in_s0ix: Allow DSP D0I3 during S0iX */ struct sof_ipc_pcm_ops { int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream, @@ -135,6 +136,7 @@ struct sof_ipc_pcm_ops { bool reset_hw_params_during_stop; bool ipc_first_on_start; bool platform_stop_during_hw_free; + bool d0i3_supported_in_s0ix; }; /** -- 2.43.0