summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/trace.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2026-09-26 07:57:59 +1000
committerDave Airlie <airlied@redhat.com>2026-09-26 07:58:24 +1000
commita9ed3aa9b87ee41e8ab3ff471b1331c154767e45 (patch)
treecc62d74e0eb4905246978674461e78e2f9df2afd /sound/soc/sof/trace.c
downloadlinux-stable-a9ed3aa9b87ee41e8ab3ff471b1331c154767e45.tar.gz
linux-stable-a9ed3aa9b87ee41e8ab3ff471b1331c154767e45.zip
Merge tag 'drm-misc-fixes-2026-09-24' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixesgrafted
A number of fixes: - bridge: - samsung-dsim: fix GPIO lifetime - client: Null pointer dereference fix - imagination: error handling fix, page handling fix - nouveau: fix reference leaks, double-frees, out-of-bounds accesses, use-after-frees, don't reject config without SCDC, a number of workarounds - virtio: fix memory leak, reference leaks, null pointer dereference, add pixel blend mode, cache coherency fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <self@mripard.dev> Link: https://patch.msgid.link/arU22zzqUGDEco1y@houat
Diffstat (limited to 'sound/soc/sof/trace.c')
-rw-r--r--sound/soc/sof/trace.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/sound/soc/sof/trace.c b/sound/soc/sof/trace.c
new file mode 100644
index 000000000..fe6c67c01
--- /dev/null
+++ b/sound/soc/sof/trace.c
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0-only
+//
+// Copyright(c) 2022 Intel Corporation
+
+#include "sof-priv.h"
+
+int sof_fw_trace_init(struct snd_sof_dev *sdev)
+{
+ const struct sof_ipc_fw_tracing_ops *fw_tracing = sof_ipc_get_ops(sdev, fw_tracing);
+
+ if (!fw_tracing) {
+ dev_info(sdev->dev, "Firmware tracing is not available\n");
+ sdev->fw_trace_is_supported = false;
+
+ return 0;
+ }
+
+ return fw_tracing->init(sdev);
+}
+
+void sof_fw_trace_free(struct snd_sof_dev *sdev)
+{
+ if (!sdev->fw_trace_is_supported)
+ return;
+
+ if (sdev->ipc->ops->fw_tracing->free)
+ sdev->ipc->ops->fw_tracing->free(sdev);
+}
+
+void sof_fw_trace_fw_crashed(struct snd_sof_dev *sdev)
+{
+ if (!sdev->fw_trace_is_supported)
+ return;
+
+ if (sdev->ipc->ops->fw_tracing->fw_crashed)
+ sdev->ipc->ops->fw_tracing->fw_crashed(sdev);
+}
+
+void sof_fw_trace_suspend(struct snd_sof_dev *sdev, pm_message_t pm_state)
+{
+ if (!sdev->fw_trace_is_supported)
+ return;
+
+ sdev->ipc->ops->fw_tracing->suspend(sdev, pm_state);
+}
+
+int sof_fw_trace_resume(struct snd_sof_dev *sdev)
+{
+ if (!sdev->fw_trace_is_supported)
+ return 0;
+
+ return sdev->ipc->ops->fw_tracing->resume(sdev);
+}