Attention is currently required from: Patrick Rudolph, Angel Pons, Julius Werner, Kyösti Mälkki. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/49942 )
Change subject: console/printk.c: Prevent recursion in print functions ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
This problem isn't new. It happened a few times in the past already. […]
Maybe we should start by defining what the bug is.
* Is it that we use printk() in init code that may or may not be needed for the console (depending on platform, Kconfigs etc.)? * Or is it that we allow implicit initializations during printk()?
I think the latter is easier to fix by design, e.g. everything used by printk() should already be initialized before or during console_init().
For the last problem that led to this patch, that could be done by introducing an init function to the monotonic timer API (as a fall-back, timer_monotonic_get() could still call it if necessary).
In case we are still hit by a recursion (a printk() on the wrong path can always happen, no matter how well we are prepared), we could still print something very simple, using console_tx_byte() directly?