From aac4e2b35401bacb74e31a0208d05741cad8f6f1 Mon Sep 17 00:00:00 2001 From: "Xiaoyun Wu(Iris)" Date: Tue, 22 Mar 2022 16:17:48 +0800 Subject: [PATCH] lib.sh: disable sof-logger when running IPC4 mode Currently, sof-logger is not supported when running IPC4 mode. Thus, disable SOF logs collection globally when DUT runs IPC4 mode. This should be removed after sof-logger support for IPC4 has been provided. Signed-off-by: Xiaoyun Wu(Iris) --- case-lib/lib.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index cfcdf604..ab99042a 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -459,6 +459,32 @@ is_zephyr() test "$znum" -gt 10 } +is_IPC4() +{ + local ipc_type + + ipcFile=/sys/module/snd_sof_pci/parameters/ipc_type + # If no /sys/module/snd_sof_pci/parameters/ipc_type exists + # the DUT is running IPC3 mode + [ -e "$ipcFile" ] || { + dlogi 'No /sys/module/snd_sof_pci/parameters/ipc_type, DUT runs IPC3 mode' + return 1 + } + + # If /sys/module/snd_sof_pci/parameters/ipc_type exists + # If the value of file ipc_type is: + # 0: DUT runs IPC3 mode + # 1: DUT runs IPC4 mode + ipc_type=$(cat $ipcFile) + if [ $ipc_type -eq 1 ]; then + dlogi "/sys/module/snd_sof_pci/parameters/ipc_type is ${ipc_type}, DUT runs IPC4 mode" + return 0 + else + dlogi "/sys/module/snd_sof_pci/parameters/ipc_type is ${ipc_type}, DUT runs IPC3 mode" + return 1 + fi +} + logger_disabled() { local ldcFile @@ -481,6 +507,15 @@ logger_disabled() return 0 fi + is_IPC4 && { + # TODO: + # Need to remove disabling sof-logger + # after sof-logger support for IPC4 has been provided in the future + dlogi 'Currenly sof-logger is not supported when running IPC4 mode' + dlogi 'SOF logs collection globally disabled because DUT runs IPC4 mode' + return 0 + } + return 1 }