Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minerva-ag: Fix unexpected sleep at init #2146

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meta-facebook/minerva-ag/src/platform/plat_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ void init_cpld_polling(void)
cpld_polling_tid = k_thread_create(
&cpld_polling_thread, cpld_polling_stack, K_THREAD_STACK_SIZEOF(cpld_polling_stack),
poll_cpld_registers, NULL, NULL, NULL, CONFIG_MAIN_THREAD_PRIORITY, 0,
K_MSEC(3000)); //sleep for 3 seconds to prevent dc status changing when reboot BIC
K_MSEC(2000)); //sleep for 3 seconds to prevent dc status changing when reboot BIC

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change the comment as well to reflect 2 instead of 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback. I have updated the comment to clarify the behavior. The total delay before accessing CPLD is 3 seconds, not 2. Here's the breakdown:

  1. 2-second delay comes from K_MSEC(2000) in k_thread_create.
  2. 1-second delay comes from CPLD_POLLING_INTERVAL_MS at the start of the thread handler loop.

k_thread_name_set(&cpld_polling_thread, "cpld_polling_thread");
}
1 change: 0 additions & 1 deletion meta-facebook/minerva-ag/src/platform/plat_mctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ void plat_mctp_init(void)
mctp_reg_msg_rx_func(p->mctp_inst, mctp_msg_recv);

mctp_start(p->mctp_inst);
k_msleep(5000);
}
}

Expand Down
Loading