Revert "lkl: Implement lkl_printf and lkl_bug internally"#627
Revert "lkl: Implement lkl_printf and lkl_bug internally"#627tavip wants to merge 1 commit intolkl:masterfrom
Conversation
This reverts commit 486afba. lkl_printf is called before Linux is initialized in several instances and this use-case is the main reason for this API's existence. Unfortunately, and suprisingly, the Linux vsnprintf uses WARN* macros which will prints information about the CPU, current process, stack trace etc. and some of this information does require Linux to be initialized. Signed-off-by: Octavian Purdila <tavip@google.com>
|
@lrh2000 If we really want to keep this we need to add a new Kconfig option and disable WARN_ON when that is selected. I want to avoid this as it adds maintenance effort to us. As mention in the original thread adding support via host_ops for your environment is the canonical way. |
|
Thanks for the mention!
OK. I saw the problem. Thanks for your explanation. I agree that if Linux methods require access to the process context, then the original commit is simply buggy. Disabling WARN_ON also does not seem to be an elegant solution.
In addition to adding support via host_ops, which has already been done in my environment, we will have to implement printf-related functionality manually in an environment without libc. It's unfortunate because printf functionality is not very trivial. This creates duplicate code and complexity. However, I cannot think of a better approach at the moment. I understand the decision made in this PR. |
A bit off-topic. But a big thanks for this! I just noticed that the recent PRs created by you bumped the kernel version, and I'm excited to see that we're bumping versions to catch the latest LTS! |
This reverts commit 486afba.
lkl_printf is called before Linux is initialized in several instances and this use-case is the main reason for this API's existence. Unfortunately, and suprisingly, the Linux vsnprintf uses WARN* macros which will prints information about the CPU, current process, stack trace etc. and some of this information does require Linux to be initialized.