Hi Simon,

On Sun, Jun 14, 2026 at 05:49, Simon Glass <[email protected]> wrote:

> Hi Sam,
>
> On 2026-06-02T08:45:46, Sam Day via B4 Relay
> <[email protected]> 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 <[email protected]>
>>
>> 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/[email protected]/

>
> Regards,
> Simon

Reply via email to