summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-05-02 08:46:51 -0600
committerSimon Glass <sjg@chromium.org>2025-05-30 09:49:32 +0100
commit5bca4798971a1ea32c43994e35f63f1964b2ddf6 (patch)
tree92c71dcf221519bfb4b3b8bf573b47d3ec4e1819
parent0dc8c7740c8f5a7155259f0e55618f8006c0d7af (diff)
expo: Adjust expo_poll() to avoid looping forever
If the user does not quickly provide some input, exit so that other things can be done, such as searching for the next OS. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--boot/expo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/boot/expo.c b/boot/expo.c
index 7dbcac78c22..ee8ffaf8920 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -326,12 +326,14 @@ int expo_poll(struct expo *exp, struct expo_action *act)
ichar = cli_ch_process(&exp->cch, 0);
if (!ichar) {
- while (!ichar && !tstc()) {
+ int i;
+
+ for (i = 0; i < 10 && !ichar && !tstc(); i++) {
schedule();
mdelay(2);
ichar = cli_ch_process(&exp->cch, -ETIMEDOUT);
}
- if (!ichar) {
+ while (!ichar && tstc()) {
ichar = getchar();
ichar = cli_ch_process(&exp->cch, ichar);
}