* [PATCH 0/2] Fastboot abort key support
@ 2026-06-02 8:45 ` Sam Day
0 siblings, 0 replies; 12+ messages in thread
From: Sam Day via B4 Relay @ 2026-06-02 8:45 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
UMS already offers CONFIG_CMD_UMS_ABORT_KEYED, which makes it possible
to bail out of that mode by pressing any button, rather than only
responding to ctrl-c. This is particularly useful for phones, where it's
not possible (yet... hmmmmm...) to send a ctrl-c command with the
available phone buttons.
This simple patch series introduces equivalent behaviour for fastboot,
and enables it in the qcom-phone.config fragment where it's most useful.
Signed-off-by: Sam Day <me@samcday.com>
---
Sam Day (2):
cmd: fastboot: Add keyed abort option
board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
board/qualcomm/qcom-phone.config | 1 +
board/qualcomm/qcom-phone.env | 2 +-
cmd/Kconfig | 6 ++++++
cmd/fastboot.c | 9 ++++++++-
4 files changed, 16 insertions(+), 2 deletions(-)
---
base-commit: 30b77f6aa146c96b831cb4ece038130b655b6a41
change-id: 20260602-fastboot-abort-keyed-1064ecc677de
Best regards,
--
Sam Day <me@samcday.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 0/2] Fastboot abort key support
@ 2026-06-02 8:45 ` Sam Day
0 siblings, 0 replies; 12+ messages in thread
From: Sam Day @ 2026-06-02 8:45 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
UMS already offers CONFIG_CMD_UMS_ABORT_KEYED, which makes it possible
to bail out of that mode by pressing any button, rather than only
responding to ctrl-c. This is particularly useful for phones, where it's
not possible (yet... hmmmmm...) to send a ctrl-c command with the
available phone buttons.
This simple patch series introduces equivalent behaviour for fastboot,
and enables it in the qcom-phone.config fragment where it's most useful.
Signed-off-by: Sam Day <me@samcday.com>
---
Sam Day (2):
cmd: fastboot: Add keyed abort option
board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
board/qualcomm/qcom-phone.config | 1 +
board/qualcomm/qcom-phone.env | 2 +-
cmd/Kconfig | 6 ++++++
cmd/fastboot.c | 9 ++++++++-
4 files changed, 16 insertions(+), 2 deletions(-)
---
base-commit: 30b77f6aa146c96b831cb4ece038130b655b6a41
change-id: 20260602-fastboot-abort-keyed-1064ecc677de
Best regards,
--
Sam Day <me@samcday.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] cmd: fastboot: Add keyed abort option
2026-06-02 8:45 ` Sam Day
@ 2026-06-02 8:45 ` Sam Day
-1 siblings, 0 replies; 12+ messages in thread
From: Sam Day via B4 Relay @ 2026-06-02 8:45 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
From: Sam Day <me@samcday.com>
Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
abort fastboot mode (rather than only ctrl-c).
Signed-off-by: Sam Day <me@samcday.com>
---
cmd/Kconfig | 6 ++++++
cmd/fastboot.c | 9 ++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index c71c6824a19..439409d6f2c 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1208,6 +1208,12 @@ config CMD_FASTBOOT
See doc/android/fastboot.rst for more information.
+config CMD_FASTBOOT_ABORT_KEYED
+ bool "fastboot abort with any key"
+ depends on CMD_FASTBOOT && USB_FUNCTION_FASTBOOT
+ help
+ Allow interruption of USB fastboot mode with any key pressed.
+
config CMD_FLASH
bool "flinfo, erase, protect"
default y
diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index e71f873527b..f3929f88dfa 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
while (1) {
if (g_dnl_detach())
break;
- if (ctrlc())
+ if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
+ if (tstc()) {
+ getchar();
+ puts("\rOperation aborted.\n");
+ break;
+ }
+ } else if (ctrlc()) {
break;
+ }
schedule();
dm_usb_gadget_handle_interrupts(udc);
}
--
2.54.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/2] cmd: fastboot: Add keyed abort option
@ 2026-06-02 8:45 ` Sam Day
0 siblings, 0 replies; 12+ messages in thread
From: Sam Day @ 2026-06-02 8:45 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
abort fastboot mode (rather than only ctrl-c).
Signed-off-by: Sam Day <me@samcday.com>
---
cmd/Kconfig | 6 ++++++
cmd/fastboot.c | 9 ++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index c71c6824a19..439409d6f2c 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1208,6 +1208,12 @@ config CMD_FASTBOOT
See doc/android/fastboot.rst for more information.
+config CMD_FASTBOOT_ABORT_KEYED
+ bool "fastboot abort with any key"
+ depends on CMD_FASTBOOT && USB_FUNCTION_FASTBOOT
+ help
+ Allow interruption of USB fastboot mode with any key pressed.
+
config CMD_FLASH
bool "flinfo, erase, protect"
default y
diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index e71f873527b..f3929f88dfa 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
while (1) {
if (g_dnl_detach())
break;
- if (ctrlc())
+ if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
+ if (tstc()) {
+ getchar();
+ puts("\rOperation aborted.\n");
+ break;
+ }
+ } else if (ctrlc()) {
break;
+ }
schedule();
dm_usb_gadget_handle_interrupts(udc);
}
--
2.54.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
2026-06-02 8:45 ` Sam Day
@ 2026-06-02 8:45 ` Sam Day
-1 siblings, 0 replies; 12+ messages in thread
From: Sam Day via B4 Relay @ 2026-06-02 8:45 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
From: Sam Day <me@samcday.com>
Thus users are able to exit from fastboot by pressing a key.
It's also possible to bail out by running `fastboot continue` from the
host, but it's nice to be consistent with UMS. Also convenient to be
able to bailout during testing if USB isn't working properly.
Signed-off-by: Sam Day <me@samcday.com>
---
board/qualcomm/qcom-phone.config | 1 +
board/qualcomm/qcom-phone.env | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/qualcomm/qcom-phone.config b/board/qualcomm/qcom-phone.config
index d24094eefdd..1387aa1dfa2 100644
--- a/board/qualcomm/qcom-phone.config
+++ b/board/qualcomm/qcom-phone.config
@@ -13,6 +13,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x1A000000
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_USB_FUNCTION_ACM=y
CONFIG_CMD_UMS_ABORT_KEYED=y
+CONFIG_CMD_FASTBOOT_ABORT_KEYED=y
# Record all console output and let it be dumped via fastboot
CONFIG_CONSOLE_RECORD=y
diff --git a/board/qualcomm/qcom-phone.env b/board/qualcomm/qcom-phone.env
index e91ae3ecdfb..566ce3c01ea 100644
--- a/board/qualcomm/qcom-phone.env
+++ b/board/qualcomm/qcom-phone.env
@@ -32,7 +32,7 @@ menucmd=setenv bootcmd run menucmd; bootmenu -1
bootmenu_0=Boot=bootefi bootmgr; pause
bootmenu_1=Enable serial console gadget=run serial_gadget
bootmenu_2=Enable USB mass storage=echo "Press any key to exit UMS mode"; ums 0 scsi 0
-bootmenu_3=Enable fastboot mode=run fastboot
+bootmenu_3=Enable fastboot mode=echo "Press any key to exit fastboot mode"; run fastboot
# Disabling bootretry means we'll just drop the shell
bootmenu_4=Drop to shell=setenv bootretry -1
bootmenu_5=Reset device=reset
--
2.54.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
@ 2026-06-02 8:45 ` Sam Day
0 siblings, 0 replies; 12+ messages in thread
From: Sam Day @ 2026-06-02 8:45 UTC (permalink / raw)
To: u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
Thus users are able to exit from fastboot by pressing a key.
It's also possible to bail out by running `fastboot continue` from the
host, but it's nice to be consistent with UMS. Also convenient to be
able to bailout during testing if USB isn't working properly.
Signed-off-by: Sam Day <me@samcday.com>
---
board/qualcomm/qcom-phone.config | 1 +
board/qualcomm/qcom-phone.env | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/qualcomm/qcom-phone.config b/board/qualcomm/qcom-phone.config
index d24094eefdd..1387aa1dfa2 100644
--- a/board/qualcomm/qcom-phone.config
+++ b/board/qualcomm/qcom-phone.config
@@ -13,6 +13,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x1A000000
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_USB_FUNCTION_ACM=y
CONFIG_CMD_UMS_ABORT_KEYED=y
+CONFIG_CMD_FASTBOOT_ABORT_KEYED=y
# Record all console output and let it be dumped via fastboot
CONFIG_CONSOLE_RECORD=y
diff --git a/board/qualcomm/qcom-phone.env b/board/qualcomm/qcom-phone.env
index e91ae3ecdfb..566ce3c01ea 100644
--- a/board/qualcomm/qcom-phone.env
+++ b/board/qualcomm/qcom-phone.env
@@ -32,7 +32,7 @@ menucmd=setenv bootcmd run menucmd; bootmenu -1
bootmenu_0=Boot=bootefi bootmgr; pause
bootmenu_1=Enable serial console gadget=run serial_gadget
bootmenu_2=Enable USB mass storage=echo "Press any key to exit UMS mode"; ums 0 scsi 0
-bootmenu_3=Enable fastboot mode=run fastboot
+bootmenu_3=Enable fastboot mode=echo "Press any key to exit fastboot mode"; run fastboot
# Disabling bootretry means we'll just drop the shell
bootmenu_4=Drop to shell=setenv bootretry -1
bootmenu_5=Reset device=reset
--
2.54.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Fastboot abort key support
2026-06-02 8:45 ` Sam Day
` (2 preceding siblings ...)
(?)
@ 2026-06-03 12:51 ` Casey Connolly
-1 siblings, 0 replies; 12+ messages in thread
From: Casey Connolly @ 2026-06-03 12:51 UTC (permalink / raw)
To: me, u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Neil Armstrong, Marek Vasut
On 6/2/26 10:45, Sam Day via B4 Relay wrote:
> UMS already offers CONFIG_CMD_UMS_ABORT_KEYED, which makes it possible
> to bail out of that mode by pressing any button, rather than only
> responding to ctrl-c. This is particularly useful for phones, where it's
> not possible (yet... hmmmmm...) to send a ctrl-c command with the
> available phone buttons.
>
> This simple patch series introduces equivalent behaviour for fastboot,
> and enables it in the qcom-phone.config fragment where it's most useful.
>
> Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
> ---
> Sam Day (2):
> cmd: fastboot: Add keyed abort option
> board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
>
> board/qualcomm/qcom-phone.config | 1 +
> board/qualcomm/qcom-phone.env | 2 +-
> cmd/Kconfig | 6 ++++++
> cmd/fastboot.c | 9 ++++++++-
> 4 files changed, 16 insertions(+), 2 deletions(-)
> ---
> base-commit: 30b77f6aa146c96b831cb4ece038130b655b6a41
> change-id: 20260602-fastboot-abort-keyed-1064ecc677de
>
> Best regards,
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] cmd: fastboot: Add keyed abort option
2026-06-02 8:45 ` Sam Day
(?)
@ 2026-06-14 11:49 ` Simon Glass
2026-06-15 12:30 ` Mattijs Korpershoek
-1 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2026-06-14 11:49 UTC (permalink / raw)
To: me
Cc: u-boot, Sumit Garg, u-boot-qcom, Tom Rini, Mattijs Korpershoek,
Quentin Schulz, Jerome Forissier, Kory Maincent (TI.com),
Mikhail Kshevetskiy, Ilias Apalodimas, Heinrich Schuchardt,
Heiko Schocher, Andrew Goodbody, Peter Robinson, Casey Connolly,
Neil Armstrong, Marek Vasut
Hi Sam,
On 2026-06-02T08:45:46, Sam Day via B4 Relay
<devnull+me.samcday.com@kernel.org> wrote:
> cmd: fastboot: Add keyed abort option
>
> Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
> abort fastboot mode (rather than only ctrl-c).
>
> Signed-off-by: Sam Day <me@samcday.com>
>
> cmd/Kconfig | 6 ++++++
> cmd/fastboot.c | 9 ++++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
> while (1) {
> if (g_dnl_detach())
> break;
> - if (ctrlc())
> + if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
> + if (tstc()) {
> + getchar();
> + puts("\rOperation aborted.\n");
> + break;
> + }
> + } else if (ctrlc()) {
> break;
> + }
I wonder if you could create a shared function (gadget_abort_check()
?) to keep this and the code in usb_mass_storage.c in sync?
> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
> + if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
> + if (tstc()) {
> + getchar();
> + puts("\rOperation aborted.\n");
> + break;
> + }
Can you please update doc/android/fastboot.rst to mention the new
Kconfig and the abort behaviour. There is currently nothing in that
file about how to leave fastboot mode at all.
Regards,
Simon
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
2026-06-02 8:45 ` Sam Day
(?)
@ 2026-06-14 11:50 ` Simon Glass
-1 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2026-06-14 11:50 UTC (permalink / raw)
To: me
Cc: u-boot, Sumit Garg, u-boot-qcom, Tom Rini, Mattijs Korpershoek,
Quentin Schulz, Jerome Forissier, Kory Maincent (TI.com),
Mikhail Kshevetskiy, Ilias Apalodimas, Heinrich Schuchardt,
Heiko Schocher, Andrew Goodbody, Peter Robinson, Casey Connolly,
Neil Armstrong, Marek Vasut
On 2026-06-02T08:45:46, Sam Day via B4 Relay
<devnull+me.samcday.com@kernel.org> wrote:
> board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
>
> Thus users are able to exit from fastboot by pressing a key.
>
> It's also possible to bail out by running fastboot continue from the
> host, but it's nice to be consistent with UMS. Also convenient to be
> able to bailout during testing if USB isn't working properly.
>
> Signed-off-by: Sam Day <me@samcday.com>
>
> board/qualcomm/qcom-phone.config | 1 +
> board/qualcomm/qcom-phone.env | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Fastboot abort key support
2026-06-02 8:45 ` Sam Day
` (3 preceding siblings ...)
(?)
@ 2026-06-15 12:11 ` Mattijs Korpershoek
-1 siblings, 0 replies; 12+ messages in thread
From: Mattijs Korpershoek @ 2026-06-15 12:11 UTC (permalink / raw)
To: Sam Day via B4 Relay, u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
Hi Sam,
Thank you for the series
On Tue, Jun 02, 2026 at 18:45, Sam Day via B4 Relay <devnull+me.samcday.com@kernel.org> wrote:
> UMS already offers CONFIG_CMD_UMS_ABORT_KEYED, which makes it possible
> to bail out of that mode by pressing any button, rather than only
> responding to ctrl-c. This is particularly useful for phones, where it's
> not possible (yet... hmmmmm...) to send a ctrl-c command with the
> available phone buttons.
>
> This simple patch series introduces equivalent behaviour for fastboot,
> and enables it in the qcom-phone.config fragment where it's most useful.
>
> Signed-off-by: Sam Day <me@samcday.com>
Tested on khadas VIM3 using khadas-vim3_android_defconfig.
Tested-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> Sam Day (2):
> cmd: fastboot: Add keyed abort option
> board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED
>
> board/qualcomm/qcom-phone.config | 1 +
> board/qualcomm/qcom-phone.env | 2 +-
> cmd/Kconfig | 6 ++++++
> cmd/fastboot.c | 9 ++++++++-
> 4 files changed, 16 insertions(+), 2 deletions(-)
> ---
> base-commit: 30b77f6aa146c96b831cb4ece038130b655b6a41
> change-id: 20260602-fastboot-abort-keyed-1064ecc677de
>
> Best regards,
> --
> Sam Day <me@samcday.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] cmd: fastboot: Add keyed abort option
2026-06-02 8:45 ` Sam Day
(?)
(?)
@ 2026-06-15 12:16 ` Mattijs Korpershoek
-1 siblings, 0 replies; 12+ messages in thread
From: Mattijs Korpershoek @ 2026-06-15 12:16 UTC (permalink / raw)
To: Sam Day via B4 Relay, u-boot, Sumit Garg, u-boot-qcom
Cc: Tom Rini, Mattijs Korpershoek, Quentin Schulz, Jerome Forissier,
Kory Maincent (TI.com), Mikhail Kshevetskiy, Ilias Apalodimas,
Heinrich Schuchardt, Heiko Schocher, Andrew Goodbody,
Peter Robinson, Casey Connolly, Neil Armstrong, Marek Vasut,
Sam Day
Hi Sam,
Thank you for the patch.
On Tue, Jun 02, 2026 at 18:45, Sam Day via B4 Relay <devnull+me.samcday.com@kernel.org> wrote:
> From: Sam Day <me@samcday.com>
>
> Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
> abort fastboot mode (rather than only ctrl-c).
>
> Signed-off-by: Sam Day <me@samcday.com>
> ---
> cmd/Kconfig | 6 ++++++
> cmd/fastboot.c | 9 ++++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index c71c6824a19..439409d6f2c 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -1208,6 +1208,12 @@ config CMD_FASTBOOT
>
> See doc/android/fastboot.rst for more information.
>
> +config CMD_FASTBOOT_ABORT_KEYED
> + bool "fastboot abort with any key"
> + depends on CMD_FASTBOOT && USB_FUNCTION_FASTBOOT
> + help
> + Allow interruption of USB fastboot mode with any key pressed.
> +
It seems that checkpatch is unhappy about this:
$ ./scripts/checkpatch.pl --git master..
-------------------------------------------------------------
Commit 9b68236a90bc ("cmd: fastboot: Add keyed abort option")
-------------------------------------------------------------
WARNING: please write a help paragraph that fully describes the config symbol with at least 2 lines
#26: FILE: cmd/Kconfig:1211:
+config CMD_FASTBOOT_ABORT_KEYED
+ bool "fastboot abort with any key"
+ depends on CMD_FASTBOOT && USB_FUNCTION_FASTBOOT
+ help
+ Allow interruption of USB fastboot mode with any key pressed.
+
total: 0 errors, 1 warnings, 0 checks, 28 lines checked
I'd suggest the following edit:
+ Allow interruption of USB fastboot mode with any key pressed
+ instead of just Ctrl-c.
If you wish, I can do this edit while applying.
With the above change included:
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> config CMD_FLASH
> bool "flinfo, erase, protect"
> default y
> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
> index e71f873527b..f3929f88dfa 100644
> --- a/cmd/fastboot.c
> +++ b/cmd/fastboot.c
> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
> while (1) {
> if (g_dnl_detach())
> break;
> - if (ctrlc())
> + if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
> + if (tstc()) {
> + getchar();
> + puts("\rOperation aborted.\n");
> + break;
> + }
> + } else if (ctrlc()) {
> break;
> + }
> schedule();
> dm_usb_gadget_handle_interrupts(udc);
> }
>
> --
> 2.54.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] cmd: fastboot: Add keyed abort option
2026-06-14 11:49 ` Simon Glass
@ 2026-06-15 12:30 ` Mattijs Korpershoek
0 siblings, 0 replies; 12+ messages in thread
From: Mattijs Korpershoek @ 2026-06-15 12:30 UTC (permalink / raw)
To: Simon Glass, me
Cc: u-boot, Sumit Garg, u-boot-qcom, Tom Rini, Mattijs Korpershoek,
Quentin Schulz, Jerome Forissier, Kory Maincent (TI.com),
Mikhail Kshevetskiy, Ilias Apalodimas, Heinrich Schuchardt,
Heiko Schocher, Andrew Goodbody, Peter Robinson, Casey Connolly,
Neil Armstrong, Marek Vasut
Hi Simon,
On Sun, Jun 14, 2026 at 05:49, Simon Glass <sjg@chromium.org> wrote:
> Hi Sam,
>
> On 2026-06-02T08:45:46, Sam Day via B4 Relay
> <devnull+me.samcday.com@kernel.org> wrote:
>> cmd: fastboot: Add keyed abort option
>>
>> Works the same as CONFIG_CMD_UMS_ABORT_KEYED does: any keypress will
>> abort fastboot mode (rather than only ctrl-c).
>>
>> Signed-off-by: Sam Day <me@samcday.com>
>>
>> cmd/Kconfig | 6 ++++++
>> cmd/fastboot.c | 9 ++++++++-
>> 2 files changed, 14 insertions(+), 1 deletion(-)
>
>> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
>> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
>> while (1) {
>> if (g_dnl_detach())
>> break;
>> - if (ctrlc())
>> + if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
>> + if (tstc()) {
>> + getchar();
>> + puts("\rOperation aborted.\n");
>> + break;
>> + }
>> + } else if (ctrlc()) {
>> break;
>> + }
>
> I wonder if you could create a shared function (gadget_abort_check()
> ?) to keep this and the code in usb_mass_storage.c in sync?
While I usually advocate to avoid code duplication, I don't think it's
needed to create a new function here. It's only a couple of very simple
lines.
To me this can stay as is.
>
>> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
>> @@ -103,8 +103,15 @@ static int do_fastboot_usb(int argc, char *const argv[],
>> + if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
>> + if (tstc()) {
>> + getchar();
>> + puts("\rOperation aborted.\n");
>> + break;
>> + }
>
> Can you please update doc/android/fastboot.rst to mention the new
> Kconfig and the abort behaviour. There is currently nothing in that
> file about how to leave fastboot mode at all.
For the current behaviour, I have send:
https://lore.kernel.org/all/20260615-fastboot-doc-ctrl-c-v1-1-f932dea17c0a@kernel.org/
>
> Regards,
> Simon
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-06-15 12:30 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 8:45 [PATCH 0/2] Fastboot abort key support Sam Day via B4 Relay
2026-06-02 8:45 ` Sam Day
2026-06-02 8:45 ` [PATCH 1/2] cmd: fastboot: Add keyed abort option Sam Day via B4 Relay
2026-06-02 8:45 ` Sam Day
2026-06-14 11:49 ` Simon Glass
2026-06-15 12:30 ` Mattijs Korpershoek
2026-06-15 12:16 ` Mattijs Korpershoek
2026-06-02 8:45 ` [PATCH 2/2] board: qualcomm: phone: enable CMD_FASTBOOT_ABORT_KEYED Sam Day via B4 Relay
2026-06-02 8:45 ` Sam Day
2026-06-14 11:50 ` Simon Glass
2026-06-03 12:51 ` [PATCH 0/2] Fastboot abort key support Casey Connolly
2026-06-15 12:11 ` Mattijs Korpershoek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.