From mboxrd@z Thu Jan 1 00:00:00 1970 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 C4C9011707 for ; Mon, 21 Aug 2023 19:53:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15AB1C433C8; Mon, 21 Aug 2023 19:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1692647583; bh=6LyPm8E7dfriTWP1h1Ebk90izTj3y652bKadQGrgXao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sb8J15zb2hO/ZpA5rGVIZaPxwW8osn47FRVU20gXJ3dwSdl8Qa5qmk+0f3LgEgRj2 8SrYM1Pbx8hZYgJMpxND7xt42Ju3YQWid+mOBBO/90uKZzWSuL1SA6MPIuardYg5b7 QNlXmDbeFwazKBcFwx93s9OdnxijaV9bdoMwnpd4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kai Vehmanen , Daniel Baluta , Ranjani Sridharan , Rander Wang , Bard Liao , Peter Ujfalusi , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 6.1 036/194] ASoC: SOF: core: Free the firmware trace before calling snd_sof_shutdown() Date: Mon, 21 Aug 2023 21:40:15 +0200 Message-ID: <20230821194124.382950607@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230821194122.695845670@linuxfoundation.org> References: <20230821194122.695845670@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Peter Ujfalusi [ Upstream commit d389dcb3a48cec4f03c16434c0bf98a4c635372a ] The shutdown is called on reboot/shutdown of the machine. At this point the firmware tracing cannot be used anymore but in case of IPC3 it is using and keeping a DMA channel active (dtrace). For Tiger Lake platforms we have a quirk in place to fix rare reboot issues when a DMA was active before rebooting the system. If the tracing is enabled this quirk will be always used and a print appears on the kernel log which might be misleading or not even correct. Release the fw tracing before executing the shutdown to make sure that this known DMA user is cleared away. Reviewed-by: Kai Vehmanen Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 625977a29d8a8..75a1e2c6539f2 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -479,8 +479,10 @@ int snd_sof_device_shutdown(struct device *dev) if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) cancel_work_sync(&sdev->probe_work); - if (sdev->fw_state == SOF_FW_BOOT_COMPLETE) + if (sdev->fw_state == SOF_FW_BOOT_COMPLETE) { + sof_fw_trace_free(sdev); return snd_sof_shutdown(sdev); + } return 0; } -- 2.40.1