From 3e2e5e2ce72d2847e4f8540e382467fe93e760ab Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Thu, 3 Dec 2020 16:58:44 +0100 Subject: [PATCH 1/2] [OP-TEE hack] framework: introduce __fwk_run_event() Introduce __fwk_run_event() to process context pending events and exits once done. This is used by OP-TEE since OP-TEE does not run a background endless thread to process SCMI messages but rather request pending message to be processed and context thread to terminate once all pending SCMI messages are processed. Signed-off-by: Etienne Carriere Signed-off-by: Vincent Guittot --- framework/include/internal/fwk_thread.h | 10 ++++++++++ framework/src/fwk_module.c | 4 ++++ framework/src/fwk_thread.c | 18 ++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/framework/include/internal/fwk_thread.h b/framework/include/internal/fwk_thread.h index 0dc1e636d..2c489a547 100644 --- a/framework/include/internal/fwk_thread.h +++ b/framework/include/internal/fwk_thread.h @@ -32,6 +32,16 @@ int __fwk_thread_init(size_t event_count); */ noreturn void __fwk_thread_run(void); +#ifdef BUILD_OPTEE +/* Hack: Added by OP-TEE to process messages but not endlessly */ +/* + * \brief Processing events already raised by modules and interrupt handlers. + * + * \return The function does not return. + */ +void __fwk_run_event(void); +#endif + /* * \brief Get the event being currently processed. * diff --git a/framework/src/fwk_module.c b/framework/src/fwk_module.c index 06db7dcfe..b389c8ec9 100644 --- a/framework/src/fwk_module.c +++ b/framework/src/fwk_module.c @@ -426,7 +426,11 @@ int fwk_module_start(void) FWK_LOG_CRIT("[FWK] Module initialization complete!"); +#ifdef BUILD_OPTEE + __fwk_run_event(); +#else __fwk_thread_run(); +#endif return FWK_SUCCESS; } diff --git a/framework/src/fwk_thread.c b/framework/src/fwk_thread.c index e3bed4528..d523ae312 100644 --- a/framework/src/fwk_thread.c +++ b/framework/src/fwk_thread.c @@ -289,6 +289,24 @@ struct __fwk_thread_ctx *__fwk_thread_get_ctx(void) return &ctx; } +void __fwk_run_event(void) +{ + for (;;) { + while (!fwk_list_is_empty(ctx.event_queue)) + process_next_event(); + + if (fwk_list_is_empty(ctx.isr_event_queue)) { + fwk_log_unbuffer(); + return; + } + + if (process_isr()) + continue; + + fwk_log_unbuffer(); + } +} + const struct fwk_event *__fwk_thread_get_current_event(void) { return ctx.current_event; -- GitLab From 00099110de023c05d971b6e91ac46a018e8db8eb Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Thu, 3 Dec 2020 16:52:05 +0100 Subject: [PATCH 2/2] [OP-TEE hack] framework: Assign a thread context for message processing When built for OP-TEE Core, SCP-firmware modified to assign a OP-TEE thread context for an incoming message and ensure the message processing is tied to that thread. This change original implementation in that there can be several thread context whereas there was a only a single possible processing context prior this change. Signed-off-by: Etienne Carriere Signed-off-by: Vincent Guittot --- framework/include/fwk_thread.h | 9 + .../include/internal/fwk_single_thread.h | 36 ++++ framework/include/internal/fwk_thread.h | 5 + framework/src/fwk_module.c | 29 ++- framework/src/fwk_thread.c | 184 ++++++++++++------ module/scmi_clock/src/mod_scmi_clock.c | 1 + module/scmi_perf/src/mod_scmi_perf.c | 2 + module/scmi_sensor/src/mod_scmi_sensor.c | 1 + 8 files changed, 202 insertions(+), 65 deletions(-) diff --git a/framework/include/fwk_thread.h b/framework/include/fwk_thread.h index 222807b52..f85515d08 100644 --- a/framework/include/fwk_thread.h +++ b/framework/include/fwk_thread.h @@ -138,6 +138,15 @@ int fwk_thread_is_delayed_response_list_empty(fwk_id_t id, bool *is_empty); * \return Status code representing the result of the operation. */ int fwk_thread_get_first_delayed_response(fwk_id_t id, struct fwk_event *event); + +#ifdef BUILD_OPTEE +/*! + * \brief Set a thread context for processing incoming message. + * + * \param[in] id Identifier of the module/element that has a message to process. + */ +void fwk_set_thread_ctx(fwk_id_t id); +#endif /*! * \} */ diff --git a/framework/include/internal/fwk_single_thread.h b/framework/include/internal/fwk_single_thread.h index 0cfb92fb9..b5d30ca2d 100644 --- a/framework/include/internal/fwk_single_thread.h +++ b/framework/include/internal/fwk_single_thread.h @@ -73,4 +73,40 @@ struct __fwk_thread_ctx { */ struct __fwk_thread_ctx *__fwk_thread_get_ctx(void); +// Added OP-TEE +/*! + * \brief Put an event in a module or element thread queue and wait for it to + * be processed. + * + * \details This framework API function can only be called from a module or + * element's thread. The calling thread is suspended until the event + * has been completely processed. As a consequence, this function cannot + * be called during the pre-runtime phases. + * + * The identifier of the event's source is filled in by the framework + * with the identifier of the entity calling the function. Thus there is + * no need for the caller to fill this event's field in. + * + * The event identifier and target identifier are validated and must + * belong to the same module. + * + * Warning: As this API could have serious adverse effects on system + * performance and throughput, this API has been deprecated + * and should not be used in single-threaded mode. + * + * \param event Event to put into the queue for processing. Must not be \c NULL. + * \param[out] resp_event The response event. Must not be \c NULL. + * + * \retval FWK_SUCCESS The event was successfully processed. + * \retval FWK_E_STATE The execution is not started. + * \retval FWK_E_PARAM One or more of the parameters were invalid. + * \retval FWK_E_PARAM One or more fields in the \p event parameter were + * invalid. + * \retval FWK_E_ACCESS The API is called from an ISR, called from the common + * thread, or the event targets the calling thread. + */ +int fwk_thread_put_event_and_wait(struct fwk_event *event, + struct fwk_event *resp_event) + __attribute__((deprecated)); + #endif /* FWK_INTERNAL_SINGLE_THREAD_H */ diff --git a/framework/include/internal/fwk_thread.h b/framework/include/internal/fwk_thread.h index 2c489a547..3353eec54 100644 --- a/framework/include/internal/fwk_thread.h +++ b/framework/include/internal/fwk_thread.h @@ -22,7 +22,12 @@ * \retval ::FWK_SUCCESS The thread framework component was initialized. * \retval ::FWK_E_NOMEM Insufficient memory available for event queues. */ +#ifdef BUILD_OPTEE +/* Hack: thread as per context: add the device ID as argument */ +int __fwk_thread_init(size_t event_count, fwk_id_t id); +#else int __fwk_thread_init(size_t event_count); +#endif /* * \brief Begin waiting for and processing events raised by modules and diff --git a/framework/src/fwk_module.c b/framework/src/fwk_module.c index b389c8ec9..08b0d19cf 100644 --- a/framework/src/fwk_module.c +++ b/framework/src/fwk_module.c @@ -11,24 +11,36 @@ #include #include #include +#ifdef BUILD_HAS_MULTITHREADING +#include +#else +#include +#endif #include #include #include +#include #include #include #include #include #include #include +#include #include +#ifdef BUILD_OPTEE +/* Optimize a bit the integration */ +# define FWK_MODULE_EVENT_COUNT 16 +#else #if FMW_NOTIFICATION_MAX > 64 # define FWK_MODULE_EVENT_COUNT FMW_NOTIFICATION_MAX #else # define FWK_MODULE_EVENT_COUNT 64 #endif +#endif /*BUILD_OPTEE*/ #define FWK_MODULE_BIND_ROUND_MAX 1 @@ -189,6 +201,18 @@ static void fwk_module_init_elements(struct fwk_module_ctx *ctx) status = desc->element_init( element_id, element->sub_element_count, element->data); + +#ifdef BUILD_OPTEE + if (status == FWK_PENDING) { + fwk_id_t none_id = FWK_ID_NONE_INIT; + + ctx->thread_ctx = fwk_mm_calloc(1, sizeof(struct __fwk_thread_ctx)); + fwk_set_thread_ctx(element_id); + status = __fwk_thread_init(FWK_MODULE_EVENT_COUNT, element_id); + fwk_set_thread_ctx(none_id); + } +#endif + if (!fwk_expect(status == FWK_SUCCESS)) fwk_trap(); @@ -394,6 +418,7 @@ int fwk_module_start(void) { int status; unsigned int bind_round; + fwk_id_t none_id = FWK_ID_NONE_INIT; if (fwk_module_ctx.initialized) { FWK_LOG_CRIT(fwk_module_err_msg_func, FWK_E_STATE, __func__); @@ -402,7 +427,9 @@ int fwk_module_start(void) CLI_DEBUGGER(); - status = __fwk_thread_init(FWK_MODULE_EVENT_COUNT); + // OP-TEE hack: device ID as argument to set the thread context + fwk_set_thread_ctx(none_id); + status = __fwk_thread_init(FWK_MODULE_EVENT_COUNT, none_id); if (status != FWK_SUCCESS) return status; diff --git a/framework/src/fwk_thread.c b/framework/src/fwk_thread.c index d523ae312..327ff6bab 100644 --- a/framework/src/fwk_thread.c +++ b/framework/src/fwk_thread.c @@ -30,10 +30,20 @@ #include #include -static struct __fwk_thread_ctx ctx; +#ifdef BUILD_OPTEE +#include +#endif + +static struct __fwk_thread_ctx global_ctx; -static const char err_msg_line[] = "[FWK] Error %d in %s @%d"; -static const char err_msg_func[] = "[FWK] Error %d in %s"; +#if defined(BUILD_OPTEE) +#include +#else +#define __maybe_unused +#endif /* BUILD_OPTEE */ + +static const char __maybe_unused err_msg_line[] = "[FWK] Error %d in %s @%d"; +static const char __maybe_unused err_msg_func[] = "[FWK] Error %d in %s"; /* States for put_event_and_wait */ enum wait_states { @@ -47,6 +57,41 @@ enum thread_interrupt_states { NOT_INTERRUPT_THREAD = 2, }; +static struct __fwk_thread_ctx *thread_ctx[CFG_NUM_THREADS]; + +struct __fwk_thread_ctx *__fwk_thread_get_ctx(void) +{ + struct __fwk_thread_ctx *tmp; + int thread_id = thread_get_id(); + + return thread_ctx[thread_id]; +} + +void fwk_set_thread_ctx(fwk_id_t id) +{ + struct __fwk_thread_ctx *tmp = NULL; + int thread_id = thread_get_id(); + + /* Find a thread context */ + if (fwk_id_is_type(id, FWK_ID_TYPE_MODULE)) { + tmp = fwk_module_get_ctx(id)->thread_ctx; + } + + /* Find an element or sub-element context */ + if (!tmp && + (fwk_id_is_type(id, FWK_ID_TYPE_ELEMENT) || + fwk_id_is_type(id, FWK_ID_TYPE_SUB_ELEMENT))) { + tmp = fwk_module_get_element_ctx(id)->thread_ctx; + } + + /* Use global one if nothig else */ + if (!tmp) + tmp = &global_ctx; + + /* Save thread context */ + thread_ctx[thread_id] = tmp; +} + /* * Static functions */ @@ -64,12 +109,15 @@ enum thread_interrupt_states { static struct fwk_event *duplicate_event(struct fwk_event *event) { struct fwk_event *allocated_event = NULL; + struct __fwk_thread_ctx *ctx; fwk_assert(event != NULL); + ctx = __fwk_thread_get_ctx(); + fwk_interrupt_global_disable(); allocated_event = FWK_LIST_GET( - fwk_list_pop_head(&ctx.free_event_queue), struct fwk_event, slist_node); + fwk_list_pop_head(&ctx->free_event_queue), struct fwk_event, slist_node); fwk_interrupt_global_enable(); if (allocated_event == NULL) { @@ -86,6 +134,7 @@ static struct fwk_event *duplicate_event(struct fwk_event *event) } static int put_event( + struct __fwk_thread_ctx *ctx, struct fwk_event *event, enum thread_interrupt_states intr_state) { @@ -112,8 +161,8 @@ static int put_event( sizeof(allocated_event->params)); /* Is this the event put_event_and_wait is waiting for ? */ - if (ctx.waiting_event_processing_completion && - (ctx.cookie == event->cookie)) + if (ctx->waiting_event_processing_completion && + (ctx->cookie == event->cookie)) is_wakeup_event = true; } else { allocated_event = duplicate_event(event); @@ -121,10 +170,10 @@ static int put_event( return FWK_E_NOMEM; } - allocated_event->cookie = event->cookie = ctx.event_cookie_counter++; + allocated_event->cookie = event->cookie = ctx->event_cookie_counter++; if (is_wakeup_event) - ctx.cookie = event->cookie; + ctx->cookie = event->cookie; if (intr_state == UNKNOWN_THREAD) { status = fwk_interrupt_get_current(&interrupt); @@ -134,9 +183,9 @@ static int put_event( intr_state = INTERRUPT_THREAD; } if (intr_state == NOT_INTERRUPT_THREAD) - fwk_list_push_tail(&ctx.event_queue, &allocated_event->slist_node); + fwk_list_push_tail(&ctx->event_queue, &allocated_event->slist_node); else - fwk_list_push_tail(&ctx.isr_event_queue, &allocated_event->slist_node); + fwk_list_push_tail(&ctx->isr_event_queue, &allocated_event->slist_node); #if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_TRACE FWK_LOG_TRACE( @@ -152,12 +201,14 @@ static int put_event( static void free_event(struct fwk_event *event) { + struct __fwk_thread_ctx *ctx = __fwk_thread_get_ctx(); + fwk_interrupt_global_disable(); - fwk_list_push_tail(&ctx.free_event_queue, &event->slist_node); + fwk_list_push_tail(&ctx->free_event_queue, &event->slist_node); fwk_interrupt_global_enable(); } -static void process_next_event(void) +static void process_next_event(struct __fwk_thread_ctx *ctx) { int status; struct fwk_event *event, *allocated_event, async_response_event = { 0 }; @@ -165,9 +216,8 @@ static void process_next_event(void) int (*process_event)(const struct fwk_event *event, struct fwk_event *resp_event); - - ctx.current_event = event = FWK_LIST_GET( - fwk_list_pop_head(&ctx.event_queue), struct fwk_event, slist_node); + ctx->current_event = event = FWK_LIST_GET( + fwk_list_pop_head(&ctx->event_queue), struct fwk_event, slist_node); #if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_TRACE FWK_LOG_TRACE( @@ -195,7 +245,7 @@ static void process_next_event(void) async_response_event.is_response = true; async_response_event.response_requested = false; if (!async_response_event.is_delayed_response) - put_event(&async_response_event, UNKNOWN_THREAD); + put_event(ctx, &async_response_event, UNKNOWN_THREAD); else { allocated_event = duplicate_event(&async_response_event); if (allocated_event != NULL) { @@ -216,17 +266,17 @@ static void process_next_event(void) } } - ctx.current_event = NULL; + ctx->current_event = NULL; free_event(event); return; } -static bool process_isr(void) +static bool process_isr(struct __fwk_thread_ctx *ctx) { struct fwk_event *isr_event; fwk_interrupt_global_disable(); - isr_event = FWK_LIST_GET(fwk_list_pop_head(&ctx.isr_event_queue), + isr_event = FWK_LIST_GET(fwk_list_pop_head(&ctx->isr_event_queue), struct fwk_event, slist_node); fwk_interrupt_global_enable(); @@ -241,7 +291,7 @@ static bool process_isr(void) FWK_ID_STR(isr_event->target_id)); #endif - fwk_list_push_tail(&ctx.event_queue, &isr_event->slist_node); + fwk_list_push_tail(&ctx->event_queue, &isr_event->slist_node); return true; } @@ -250,57 +300,61 @@ static bool process_isr(void) * Private interface functions */ +#ifdef BUILD_OPTEE +int __fwk_thread_init(size_t event_count, fwk_id_t id) +#else int __fwk_thread_init(size_t event_count) +#endif { struct fwk_event *event_table, *event; + struct __fwk_thread_ctx *ctx = __fwk_thread_get_ctx(); event_table = fwk_mm_calloc(event_count, sizeof(struct fwk_event)); /* All the event structures are free to be used. */ - fwk_list_init(&ctx.free_event_queue); - fwk_list_init(&ctx.event_queue); - fwk_list_init(&ctx.isr_event_queue); + fwk_list_init(&ctx->free_event_queue); + fwk_list_init(&ctx->event_queue); + fwk_list_init(&ctx->isr_event_queue); for (event = event_table; event < (event_table + event_count); event++) - fwk_list_push_tail(&ctx.free_event_queue, &event->slist_node); + fwk_list_push_tail(&ctx->free_event_queue, &event->slist_node); - ctx.initialized = true; + ctx->initialized = true; return FWK_SUCCESS; } noreturn void __fwk_thread_run(void) { + struct __fwk_thread_ctx *ctx = __fwk_thread_get_ctx(); + for (;;) { - while (!fwk_list_is_empty(&ctx.event_queue)) - process_next_event(); + while (!fwk_list_is_empty(&ctx->event_queue)) + process_next_event(ctx); - if (process_isr()) + if (process_isr(ctx)) continue; fwk_log_unbuffer(); } } -struct __fwk_thread_ctx *__fwk_thread_get_ctx(void) -{ - return &ctx; -} - void __fwk_run_event(void) { + struct __fwk_thread_ctx *ctx = __fwk_thread_get_ctx(); + for (;;) { - while (!fwk_list_is_empty(ctx.event_queue)) - process_next_event(); + while (!fwk_list_is_empty(&ctx->event_queue)) + process_next_event(ctx); - if (fwk_list_is_empty(ctx.isr_event_queue)) { + if (fwk_list_is_empty(&ctx->isr_event_queue)) { fwk_log_unbuffer(); return; } - if (process_isr()) + if (process_isr(ctx)) continue; fwk_log_unbuffer(); @@ -309,7 +363,7 @@ void __fwk_run_event(void) const struct fwk_event *__fwk_thread_get_current_event(void) { - return ctx.current_event; + return __fwk_thread_get_ctx()->current_event; } #ifdef BUILD_HAS_NOTIFICATION @@ -318,7 +372,7 @@ int __fwk_thread_put_notification(struct fwk_event *event) event->is_response = false; event->is_notification = true; - return put_event(event, UNKNOWN_THREAD); + return put_event(__fwk_thread_get_ctx(), event, UNKNOWN_THREAD); } #endif @@ -331,9 +385,10 @@ int fwk_thread_put_event(struct fwk_event *event) int status = FWK_E_PARAM; unsigned int interrupt; enum thread_interrupt_states intr_state; + struct __fwk_thread_ctx *ctx = __fwk_thread_get_ctx(); #ifdef BUILD_MODE_DEBUG - if (!ctx.initialized) { + if (!ctx->initialized) { status = FWK_E_INIT; goto error; } @@ -348,8 +403,8 @@ int fwk_thread_put_event(struct fwk_event *event) else intr_state = INTERRUPT_THREAD; - if ((intr_state == NOT_INTERRUPT_THREAD) && (ctx.current_event != NULL)) - event->source_id = ctx.current_event->target_id; + if ((intr_state == NOT_INTERRUPT_THREAD) && (ctx->current_event != NULL)) + event->source_id = ctx->current_event->target_id; else if (!fwk_module_is_valid_entity_id(event->source_id)) { status = FWK_E_PARAM; goto error; @@ -382,7 +437,7 @@ int fwk_thread_put_event(struct fwk_event *event) } #endif - return put_event(event, intr_state); + return put_event(ctx, event, intr_state); error: FWK_LOG_CRIT(err_msg_func, status, __func__); @@ -400,10 +455,11 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, struct fwk_event *allocated_event; int status = FWK_E_PARAM; enum wait_states wait_state = WAITING_FOR_EVENT; + struct __fwk_thread_ctx *ctx = __fwk_thread_get_ctx(); #ifdef BUILD_MODE_DEBUG unsigned int interrupt; - if (!ctx.initialized) { + if (!ctx->initialized) { status = FWK_E_INIT; goto error; } @@ -420,8 +476,8 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, } #endif - if (ctx.current_event != NULL) - event->source_id = ctx.current_event->target_id; + if (ctx->current_event != NULL) + event->source_id = ctx->current_event->target_id; else if (!fwk_module_is_valid_entity_id(event->source_id)) { FWK_LOG_ERR( "[FWK] deprecated put_event_and_wait (%s: %s -> %s)\n", @@ -432,12 +488,12 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, } /* No support for nested put_event_and_wait calls */ - if (ctx.waiting_event_processing_completion) { + if (ctx->waiting_event_processing_completion) { status = FWK_E_BUSY; goto error; } - ctx.waiting_event_processing_completion = true; - ctx.previous_event = ctx.current_event; + ctx->waiting_event_processing_completion = true; + ctx->previous_event = ctx->current_event; #if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_TRACE FWK_LOG_TRACE( @@ -452,34 +508,34 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, event->response_requested = true; event->is_notification = false; - status = put_event(event, NOT_INTERRUPT_THREAD); + status = put_event(ctx, event, NOT_INTERRUPT_THREAD); if (status != FWK_SUCCESS) goto exit; - ctx.cookie = event->cookie; + ctx->cookie = event->cookie; for (;;) { - if (fwk_list_is_empty(&ctx.event_queue)) { - process_isr(); + if (fwk_list_is_empty(&ctx->event_queue)) { + process_isr(ctx); continue; } - ctx.current_event = next_event = FWK_LIST_GET(fwk_list_head( - &ctx.event_queue), struct fwk_event, slist_node); + ctx->current_event = next_event = FWK_LIST_GET(fwk_list_head( + &ctx->event_queue), struct fwk_event, slist_node); - if (next_event->cookie != ctx.cookie) { + if (next_event->cookie != ctx->cookie) { /* * Process any events waiting on the event_queue until * we get to the event from the waiting call. */ - process_next_event(); + process_next_event(ctx); continue; } /* This is either the original event or the response event */ next_event = FWK_LIST_GET( - fwk_list_pop_head(&ctx.event_queue), struct fwk_event, slist_node); + fwk_list_pop_head(&ctx->event_queue), struct fwk_event, slist_node); if (wait_state == WAITING_FOR_EVENT) { module = fwk_module_get_ctx(next_event->target_id)->desc; @@ -503,10 +559,10 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, response_event.is_response = true; response_event.response_requested = false; if (!response_event.is_delayed_response) { - status = put_event(&response_event, UNKNOWN_THREAD); + status = put_event(ctx, &response_event, UNKNOWN_THREAD); if (status != FWK_SUCCESS) goto exit; - ctx.cookie = response_event.cookie; + ctx->cookie = response_event.cookie; } else { allocated_event = duplicate_event(&response_event); if (allocated_event != NULL) { @@ -518,7 +574,7 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, status = FWK_E_NOMEM; goto exit; } - ctx.cookie = allocated_event->cookie; + ctx->cookie = allocated_event->cookie; } wait_state = WAITING_FOR_RESPONSE; @@ -528,7 +584,7 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, * Check for any interrupt events that might have been * queued while the event was being executed. */ - process_isr(); + process_isr(ctx); continue; } @@ -546,8 +602,8 @@ int fwk_thread_put_event_and_wait(struct fwk_event *event, } exit: - ctx.current_event = ctx.previous_event; - ctx.waiting_event_processing_completion = false; + ctx->current_event = ctx->previous_event; + ctx->waiting_event_processing_completion = false; if (status == FWK_SUCCESS) return status; error: diff --git a/module/scmi_clock/src/mod_scmi_clock.c b/module/scmi_clock/src/mod_scmi_clock.c index 02d852f3b..d12777a62 100644 --- a/module/scmi_clock/src/mod_scmi_clock.c +++ b/module/scmi_clock/src/mod_scmi_clock.c @@ -645,6 +645,7 @@ static int create_event_request( return FWK_E_BUSY; struct fwk_event event = { + .source_id = service_id, .target_id = fwk_module_id_scmi_clock, }; diff --git a/module/scmi_perf/src/mod_scmi_perf.c b/module/scmi_perf/src/mod_scmi_perf.c index aee18c01a..bf1ba5e80 100644 --- a/module/scmi_perf/src/mod_scmi_perf.c +++ b/module/scmi_perf/src/mod_scmi_perf.c @@ -617,6 +617,7 @@ static int scmi_perf_limits_get_handler(fwk_id_t service_id, /* The get_limits request is processed within the event being generated */ struct fwk_event event = { + .source_id = service_id, .target_id = fwk_module_id_scmi_perf, .id = scmi_perf_get_limits, }; @@ -735,6 +736,7 @@ static int scmi_perf_level_get_handler(fwk_id_t service_id, /* The get_level request is processed within the event being generated */ struct fwk_event event = { + .source_id = service_id, .target_id = fwk_module_id_scmi_perf, .id = scmi_perf_get_level, }; diff --git a/module/scmi_sensor/src/mod_scmi_sensor.c b/module/scmi_sensor/src/mod_scmi_sensor.c index 802c24553..016148e47 100644 --- a/module/scmi_sensor/src/mod_scmi_sensor.c +++ b/module/scmi_sensor/src/mod_scmi_sensor.c @@ -533,6 +533,7 @@ static int scmi_sensor_reading_get_handler(fwk_id_t service_id, /* The get_value request is processed within the event being generated */ struct fwk_event event = { + .source_id = service_id, .target_id = fwk_module_id_scmi_sensor, .id = mod_scmi_sensor_event_id_get_request, }; -- GitLab