Skip to content

Commit 7e32c23

Browse files
committed
alif/mpmetalport: Only notify after metal subsystem is init'd.
Signed-off-by: Damien George <[email protected]>
1 parent 68b1dae commit 7e32c23

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/alif/mpmetalport.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#include "se_services.h"
3838

3939
struct metal_state _metal;
40+
41+
static bool metal_active;
4042
static mp_sched_node_t rproc_notify_node;
4143

4244
int metal_sys_init(const struct metal_init_params *params) {
@@ -53,10 +55,13 @@ int metal_sys_init(const struct metal_init_params *params) {
5355
#endif
5456

5557
metal_bus_register(&metal_generic_bus);
58+
metal_active = true;
59+
5660
return 0;
5761
}
5862

5963
void metal_sys_finish(void) {
64+
metal_active = false;
6065
metal_bus_unregister(&metal_generic_bus);
6166
}
6267

@@ -91,6 +96,9 @@ int metal_rproc_notify(void *priv, uint32_t id) {
9196
}
9297

9398
void metal_rproc_notified(void) {
99+
if (!metal_active) {
100+
return;
101+
}
94102
// The remote core notified this core.
95103
mp_sched_schedule_node(&rproc_notify_node, openamp_remoteproc_notified);
96104
}

0 commit comments

Comments
 (0)