diff options
author | Raul E Rangel <rrangel@chromium.org> | 2021-07-14 11:44:51 -0600 |
---|---|---|
committer | Raul Rangel <rrangel@chromium.org> | 2021-07-15 21:50:27 +0000 |
commit | 000138e6c1558b89b4e052966c303e08efcf2c14 (patch) | |
tree | 89d8a921e1adf12152da1d5c7545c29c6d686fb8 /.gitreview | |
parent | 577e146895d489d809b4d41da7f6f2d7428143a2 (diff) |
lib/thread: Verify threads are initialized before yielding
In hardwaremain.c we call console_init before threads_initialize. Part
of setting up the uart requires calling udelay which then calls
thread_yield_microseconds. Since threads have not been set up, trying to
yield will result in bad things happening. This change guards the thread
methods by making current_thread return NULL if the structures have not
been initialized.
BUG=b:179699789
TEST=Ramstage no longer hangs with serial enabled
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: If9e1eedfaebe584901d2937c8aa24e158706fa43
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56318
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to '.gitreview')
0 files changed, 0 insertions, 0 deletions