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 moving schedule() in order to call it only every 10 loop iteration
it increases the CTRL+C reactivity.

Signed-off-by: Patrice Chotard <[email protected]>
---
Changes in v2:
- Update commit message with more details.
- Link to v1: 
https://patch.msgid.link/[email protected]

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_mass_storage.c 
b/drivers/usb/gadget/f_mass_storage.c
index 71dc58da3f0..fb0803e856f 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -676,10 +676,10 @@ static int sleep_thread(struct fsg_common *common)
                        if (!g_dnl_board_usb_cable_connected())
                                return -EIO;
 
+                       schedule();
                        k = 0;
                }
 
-               schedule();
                dm_usb_gadget_handle_interrupts(udcdev);
        }
        common->thread_wakeup_needed = 0;

---
base-commit: 1296a428c67cf103eca482d4a63349661c1b799f
change-id: 20260622-move_schedule-1f94c93e10cd

Best regards,
--  
Patrice Chotard <[email protected]>

Reply via email to