Skip to content

Commit

Permalink
FW/selftests: don't call log_platform_message in run function
Browse files Browse the repository at this point in the history
log_platform_message() is not thread-safe. See opendcdiag#153, which is closed as
"won't fix".

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
  • Loading branch information
thiagomacieira committed Feb 22, 2023
1 parent 8ae9772 commit 1cfeb17
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions framework/selftest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ static int selftest_logdata_run(struct test *test, int cpu)
return EXIT_SUCCESS;
}

static int selftest_log_platform_run(struct test *test, int cpu)
static int selftest_log_platform_init(struct test *test)
{
(void)test;
log_platform_message(SANDSTONE_LOG_INFO "This is an informational platform message from CPU %d", cpu);
log_platform_message(SANDSTONE_LOG_INFO "This is an informational platform message");
return EXIT_SUCCESS;
}

Expand Down Expand Up @@ -714,7 +714,8 @@ static struct test selftests_array[] = {
.id = "selftest_log_platform",
.description = "Logs platform messages (not related to the test)",
.groups = DECLARE_TEST_GROUPS(&group_positive),
.test_run = selftest_log_platform_run,
.test_init = selftest_log_platform_init,
.test_run = selftest_pass_run,
.desired_duration = -1,
},
{
Expand Down

0 comments on commit 1cfeb17

Please sign in to comment.