Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp172714lqo; Tue, 7 May 2024 16:36:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtx6CHB8dhrVOX/bdqyKThg/F0E2uQJHocN4DbM/1w9ONxb/dWSl1PAU5jvLpGzr0A+/mSM0gsUiE6bnVkbz9z3pEH3sUdn541oOmE3g== X-Google-Smtp-Source: AGHT+IGujKwkes4SH34TSTzzA/V/6haQ/2TAObLuh10WOOF/stFpafN9xY5i1Rr9Af4IsudUEJ8V X-Received: by 2002:a05:6358:93a7:b0:18e:6d51:dc39 with SMTP id e5c5f4694b2df-192d2e41fb2mr138543555d.16.1715124964078; Tue, 07 May 2024 16:36:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715124964; cv=pass; d=google.com; s=arc-20160816; b=r9pOoX7M8dXhpS7ZE8HXbFoFc8puzqZncIep5GHNYVUs23ZZ/t8Sr7Tb6Z0XT7zV2l JOpiWNdkaqnuRUsXTt4LzlCldnxnpeCq8Rp2KZ4XA3k/kihOXq6HUuTFyvwc1T18Vkga nwQE9HDcFZJo8jLds//l5lv/w+y33Q2LYDCGfOiypI/ja8YTiKjv5qXDU7IG6m8bcf9C GhWCaQwbX1acsYxF3NgC6xTzcrxVAvWsoOzbxPMSzP3VGOGKKl6W5KckJLW/0n6WuLK5 QegOvS/vIN0FG30XGBQHyp5PvOD/vKP2ZeJsT/ohKiDgiK2mQ7dxs3XM4HjHcW8/AnDn EgAw== 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=biB8xvU/t1KkZlC1cF3m5ibEWiq7BLqjMIyh15hYWoA=; fh=Yx1kxF5pZ9TMk3FsRXXTioh82DdT4rhnntIZwsUG1eQ=; b=niNVcuaup4Few1ejvWAv5s0aoVa/ACO8s6tOh3IFqkTXSvp0ssS1P5JiKGA7ChpnTv 9ZoQaXS8KTrCWbldfY08+kFijjbLDhw/VrhJuuamMGI5r9dV0flxinoy9ZooZAAPkGYP GaZnayn8B3cWohyxbqsAdm+6/FV7k9SNIHZnXdn1QJx80mNIavhRgkGtzB28xXQkfcV1 O0hruQule+7XYfL0R2AiHpb3xTmNDHqs/Ze3hfhFG0xnlnIDdDsvxGILt27rachciP3g iUwkViR6JIKkL1y4E88C4RaS4Ow81dKc0qsSVckh4TitoXHwR+KCgNK8cdUc1fJYx1iS PrvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ODmsWxcW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172399-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172399-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ca30-20020a056a02069e00b005e42b5db0ffsi12180300pgb.40.2024.05.07.16.36.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:36:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172399-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ODmsWxcW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172399-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172399-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A409128303C for ; Tue, 7 May 2024 23:36:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65963148838; Tue, 7 May 2024 23:10:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ODmsWxcW" 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 87A381487F7; Tue, 7 May 2024 23:10:41 +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=1715123441; cv=none; b=M2b+fyAT6TCey5ttkR3+T+k0y++tH5SUuC6h1DpVGXbp4+n9XfrNNtt06nnQBsvOAuE2lYNjwQnezCLDUYfKwn8/snBpBiRh98OhKTUD9Exw5vSr80YcKOBLb/t8bBc1UhTwMBEvPq4OKs7S8EWwYFwhR/5McamS50BsV2sAu0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123441; c=relaxed/simple; bh=x+ILaP9ypmyXCEp+Idha2KABu9yijatlZKhXKqcVmgc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mgUYMKXdyPnTQ5TUwgMeG7FXAoaEEQDPBZZwaFD6wOsyIAwzgKvY8U0ssEADsQcb4VjP8z5TVM+7f6+BYD3fUqSkzs9z5JNFA7ZM/UFCp0EhSnYHSuS5xa+38cAP3VBTk9a0jtZc70oOYXNmh2XF1dl6vCKYlxTQLhQQ+QpJP9g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ODmsWxcW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB81AC2BBFC; Tue, 7 May 2024 23:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123441; bh=x+ILaP9ypmyXCEp+Idha2KABu9yijatlZKhXKqcVmgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ODmsWxcWYnauCJ1o8HnRSqdBZKNqTrlSEVTBi2NZeZX0MYBN7GZ8f/unUOiQurilZ RbClThTC1G86iP+0NrxhMERi9Srnij3rDQ895Q/N5zsTh+kZGWaUAfZARnkfZ0+ozi LYbexmD9OvulG+v8Pp/s4GSnsTmJKjQ1ot0UvocVkpYBPlXafEagOKSaPL0wbP3pTj 4wTTMRnMybj97BkJiR8pWVXM6M8yuQnkPQDASOhdVTZOq511BFAN4UHMVFELPrXZnq VaLVHNLVR4NdtPcY9yaTxZtX8VwXUCYwoZql1QJ3s9XoLd7F+I4cvqr5SGd7Rb01Lu /padO5TLnx9XA== 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.6 04/43] ASoC: SOF: pcm: Restrict DSP D0i3 during S0ix to IPC3 Date: Tue, 7 May 2024 19:09:25 -0400 Message-ID: <20240507231033.393285-4-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507231033.393285-1-sashal@kernel.org> References: <20240507231033.393285-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.6.30 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 cb58ee8c158a5..720bd9bd2667a 100644 --- a/sound/soc/sof/ipc3-pcm.c +++ b/sound/soc/sof/ipc3-pcm.c @@ -398,4 +398,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 d778717cab10b..8e602e42afee2 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 a6d6bcd00ceec..3606595a7500c 100644 --- a/sound/soc/sof/sof-audio.h +++ b/sound/soc/sof/sof-audio.h @@ -113,6 +113,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, @@ -129,6 +130,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