From patchwork Wed Mar 30 20:19:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12796319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D356C433EF for ; Wed, 30 Mar 2022 20:22:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 906FE1AB8; Wed, 30 Mar 2022 22:21:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 906FE1AB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648671755; bh=+CWO3E0FqqR57eXIy8K3/SJkwOMxql9KJrJ5lLu4+uU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mtk+A0Pjn/Gsd80e9c0HMYyfHLiPyXepGtK6mdhNl6mHRVrcR2cD3dcWM8abpnKGo dZJkENt1CoQzqmdLZaK0bsOpU6fQlr47Nxwa/RLNp3KjihpMnANpmgFLJVeq355Mxd lh5GuHwvXzKlCPlmkdBP21dyjNpoO/13ZXx6DsAI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 07207F8052F; Wed, 30 Mar 2022 22:19:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4D0AFF8051A; Wed, 30 Mar 2022 22:19:53 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1EE8BF800F2 for ; Wed, 30 Mar 2022 22:19:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1EE8BF800F2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AVnOn2EW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648671586; x=1680207586; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+CWO3E0FqqR57eXIy8K3/SJkwOMxql9KJrJ5lLu4+uU=; b=AVnOn2EWFapg48XzKz0LWWvbn3JpKgggYP6GotWZdmVESoDBWT1o+WOM nDaNVBBVUBTeUWIwXge3t/0dSEVJe4/KbX7o/8Bx/Vpt4Q9BawFO79SC+ FNooaeHlHT+QI4HfJBw8WlNz7goiCpG+qEb7+4ZRBjJ1OmBDFJuModcG2 cbDANNopkU/2g0EELcYx8NRs1eXDUc3IGpZGNFgfToTFZt1n+4P+TSuQy ghQUlIwC02x604M4NsK7ZYbkgq3+isEpw36mydOXc0k8TbgwFs1w5W3qg O8iyxBNtzHAs90ttN14cn8N/f+I/IHfjujJKwu12QGp/t5k6ptkEBrCXT A==; X-IronPort-AV: E=McAfee;i="6200,9189,10302"; a="322819832" X-IronPort-AV: E=Sophos;i="5.90,223,1643702400"; d="scan'208";a="322819832" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 13:19:38 -0700 X-IronPort-AV: E=Sophos;i="5.90,223,1643702400"; d="scan'208";a="522045039" Received: from ggunnam-mobl.amr.corp.intel.com (HELO rsridh2-mobl1.localdomain) ([10.254.28.195]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 13:19:37 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 07/11] ASoC: SOF: disable dma trace in s0ix Date: Wed, 30 Mar 2022 13:19:22 -0700 Message-Id: <20220330201926.1330402-8-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220330201926.1330402-1-ranjani.sridharan@linux.intel.com> References: <20220330201926.1330402-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: Libin Yang , tiwai@suse.de, Ranjani Sridharan , Kai Vehmanen , broonie@kernel.org, =?utf-8?q?P?= =?utf-8?q?=C3=A9ter_Ujfalusi?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Libin Yang When system enters s0ix, the dma trace won't be used. Otherwise, the DMA will access the host memory, which will prevent entering S0ix. Driver has notified firmware not to send message through dma trace. Let's also trigger stop dma trace in driver side. Signed-off-by: Libin Yang Reviewed-by: Kai Vehmanen Reviewed-by: Péter Ujfalusi Signed-off-by: Ranjani Sridharan --- sound/soc/sof/pm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index a1a645a13c6d..44008dd075c2 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -102,11 +102,18 @@ static int sof_resume(struct device *dev, bool runtime_resume) /* * Nothing further to be done for platforms that support the low power - * D0 substate. + * D0 substate. Resume trace and return when resuming from + * low-power D0 substate */ if (!runtime_resume && sof_ops(sdev)->set_power_state && - old_state == SOF_DSP_PM_D0) + old_state == SOF_DSP_PM_D0) { + ret = snd_sof_trace_resume(sdev); + if (ret < 0) + /* non fatal */ + dev_warn(sdev->dev, + "failed to enable trace after resume %d\n", ret); return 0; + } sof_set_fw_state(sdev, SOF_FW_BOOT_PREPARE); @@ -201,6 +208,7 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) /* Skip to platform-specific suspend if DSP is entering D0 */ if (target_state == SOF_DSP_PM_D0) { + snd_sof_trace_suspend(sdev, pm_state); /* Notify clients not managed by pm framework about core suspend */ sof_suspend_clients(sdev, pm_state); goto suspend;