On STM32MP157C-DK2, when aborting the command "ums" using CTRL-C it may take a while to get the control back on the console, sometimes around 1 second.
By removing the if (k == 10) test, it increases the CTRL+C responsiveness (around 28 ms between 2 ctrl_c() calls) and UMS throughthput is not impacted. Tested on STM32MP157C-DK board Signed-off-by: Patrice Chotard <[email protected]> --- Changes in v2: - Decrease ctrl_c() call frequency to restore ums throughput - Link to v1: https://patch.msgid.link/20260917-ums_increase_ctrl-c_responsiveness-v1-1-95305f044...@foss.st.com To: [email protected] Cc: Lukasz Majewski <[email protected]> Cc: Mattijs Korpershoek <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Tom Rini <[email protected]> Cc: Patrice Chotard <[email protected]> --- drivers/usb/gadget/f_mass_storage.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 7eb667c130d..96581792031 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -651,7 +651,7 @@ static void busy_indicator(void) static int sleep_thread(struct fsg_common *common) { int rc = 0; - int i = 0, k = 0; + int i = 0; /* Wait until a signal arrives or we are woken up */ for (;;) { @@ -661,10 +661,7 @@ static int sleep_thread(struct fsg_common *common) if (++i == 20000) { busy_indicator(); i = 0; - k++; - } - if (k == 10) { /* Handle START-STOP UNIT */ if (common->eject) return -EPIPE; @@ -676,8 +673,6 @@ static int sleep_thread(struct fsg_common *common) /* Check cable connection */ if (!g_dnl_board_usb_cable_connected()) return -EIO; - - k = 0; } schedule(); --- base-commit: b4ac71db13a33c4e6532c60a781ddf34b7f4375a change-id: 20260917-ums_increase_ctrl-c_responsiveness-0824bf3ede7b Best regards, -- Patrice Chotard <[email protected]>
