Skip to content

Commit 9f9ea30

Browse files
tmlemanlgirdwood
authored andcommitted
platform: ace: watchdog: send primary timeout via ipc_service critical send
The primary-core watchdog timeout notification used the deprecated old-interface call intel_adsp_ipc_send_message_emergency() together with the Intel-specific INTEL_ADSP_IPC_HOST_DEV device handle. Route it instead through the generic ipc_platform_send_msg_direct(), which maps to ipc_service_send_critical() and the backend critical/emergency send, identical register behaviour (busy-wait, no ack, bypasses flow control), but expressed with the backend-agnostic ipc_service API and a struct ipc_msg, mirroring the secondary-core path. This removes the watchdog's dependency on the old interface and on the Intel host IPC device macro, dropping the intel_adsp_ipc*.h includes. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 3ba4b07 commit 9f9ea30

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

src/platform/intel/ace/lib/watchdog.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <sof/lib/uuid.h>
1010
#include <rtos/idc.h>
1111
#include <sof/schedule/ll_schedule_domain.h>
12+
#include <sof/ipc/driver.h>
1213
#include <sof/ipc/msg.h>
1314
#include <ipc4/notification.h>
1415

@@ -17,8 +18,6 @@
1718

1819
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adsp_watchdog), okay)
1920
#include <adsp_watchdog.h>
20-
#include <intel_adsp_ipc.h>
21-
#include <intel_adsp_ipc_devtree.h>
2221

2322
LOG_MODULE_REGISTER(wdt, CONFIG_SOF_LOG_LEVEL);
2423

@@ -27,6 +26,7 @@ SOF_DEFINE_REG_UUID(wdt);
2726
DECLARE_TR_CTX(wdt_tr, SOF_UUID(wdt_uuid), LOG_LEVEL_INFO);
2827

2928
static const struct device *const watchdog = DEVICE_DT_GET(DT_NODELABEL(adsp_watchdog));
29+
static struct ipc_msg primary_timeout_ipc;
3030
static struct ipc_msg secondary_timeout_ipc;
3131

3232
static void watchdog_primary_core_action_on_timeout(void)
@@ -35,8 +35,15 @@ static void watchdog_primary_core_action_on_timeout(void)
3535

3636
/* Send Watchdog Timeout IPC notification */
3737
ipc4_notification_watchdog_init(&notif, cpu_get_id(), true);
38-
intel_adsp_ipc_send_message_emergency(INTEL_ADSP_IPC_HOST_DEV,
39-
notif.primary.dat, notif.extension.dat);
38+
primary_timeout_ipc.header = notif.primary.dat;
39+
primary_timeout_ipc.extension = notif.extension.dat;
40+
41+
/*
42+
* The primary core low latency scheduler is stalled, so bypass the IPC
43+
* queue and push the notification straight to the host using the direct
44+
* (critical) send path.
45+
*/
46+
ipc_platform_send_msg_direct(&primary_timeout_ipc);
4047
}
4148

4249
static void watchdog_secondary_core_action_on_timeout(void)
@@ -83,6 +90,10 @@ __cold void watchdog_init(void)
8390

8491
assert_can_be_cold();
8592

93+
primary_timeout_ipc.tx_data = NULL;
94+
primary_timeout_ipc.tx_size = 0;
95+
list_init(&primary_timeout_ipc.list);
96+
8697
secondary_timeout_ipc.tx_data = NULL;
8798
secondary_timeout_ipc.tx_size = 0;
8899
list_init(&secondary_timeout_ipc.list);

0 commit comments

Comments
 (0)