* [PATCH] fastboot: avoid console_countdown_abort for getvar request
@ 2023-04-05 9:50 Marco Felsch
2023-06-22 16:53 ` Marco Felsch
0 siblings, 1 reply; 2+ messages in thread
From: Marco Felsch @ 2023-04-05 9:50 UTC (permalink / raw)
To: barebox
Don't abort the console countdown in case of 'fastboot getvar' requests.
Most the time the host just want to query information but don't want to
abort the boot. Therefore skip the abort in case of getvar requests and
abort it in all other cases.
Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
common/fastboot.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/common/fastboot.c b/common/fastboot.c
index ae7f132444..6c58195395 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -772,6 +772,11 @@ static void cb_erase(struct fastboot *fb, const char *cmd)
fastboot_tx_print(fb, FASTBOOT_MSG_OKAY, "");
}
+static bool fastboot_cmd_abort_allowed(const char *cmdbuf)
+{
+ return strcmp_l1("getvar:", cmdbuf) == 0 ? false : true;
+}
+
struct cmd_dispatch_info {
char *cmd;
void (*cb)(struct fastboot *fb, const char *opt);
@@ -783,7 +788,8 @@ static void fb_run_command(struct fastboot *fb, const char *cmdbuf,
const struct cmd_dispatch_info *cmd;
int i;
- console_countdown_abort();
+ if (fastboot_cmd_abort_allowed(cmdbuf))
+ console_countdown_abort();
for (i = 0; i < num_commands; i++) {
cmd = &cmds[i];
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fastboot: avoid console_countdown_abort for getvar request
2023-04-05 9:50 [PATCH] fastboot: avoid console_countdown_abort for getvar request Marco Felsch
@ 2023-06-22 16:53 ` Marco Felsch
0 siblings, 0 replies; 2+ messages in thread
From: Marco Felsch @ 2023-06-22 16:53 UTC (permalink / raw)
To: barebox
Hi,
gentle ping.
On 23-04-05, Marco Felsch wrote:
> Don't abort the console countdown in case of 'fastboot getvar' requests.
> Most the time the host just want to query information but don't want to
> abort the boot. Therefore skip the abort in case of getvar requests and
> abort it in all other cases.
>
> Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> common/fastboot.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/common/fastboot.c b/common/fastboot.c
> index ae7f132444..6c58195395 100644
> --- a/common/fastboot.c
> +++ b/common/fastboot.c
> @@ -772,6 +772,11 @@ static void cb_erase(struct fastboot *fb, const char *cmd)
> fastboot_tx_print(fb, FASTBOOT_MSG_OKAY, "");
> }
>
> +static bool fastboot_cmd_abort_allowed(const char *cmdbuf)
> +{
> + return strcmp_l1("getvar:", cmdbuf) == 0 ? false : true;
> +}
> +
> struct cmd_dispatch_info {
> char *cmd;
> void (*cb)(struct fastboot *fb, const char *opt);
> @@ -783,7 +788,8 @@ static void fb_run_command(struct fastboot *fb, const char *cmdbuf,
> const struct cmd_dispatch_info *cmd;
> int i;
>
> - console_countdown_abort();
> + if (fastboot_cmd_abort_allowed(cmdbuf))
> + console_countdown_abort();
>
> for (i = 0; i < num_commands; i++) {
> cmd = &cmds[i];
> --
> 2.39.2
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-22 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-05 9:50 [PATCH] fastboot: avoid console_countdown_abort for getvar request Marco Felsch
2023-06-22 16:53 ` Marco Felsch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox