usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
authorPatrice Chotard <patrice.chotard@foss.st.com>
Mon, 2 Dec 2024 07:46:44 +0000 (08:46 +0100)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Tue, 11 Feb 2025 07:59:27 +0000 (08:59 +0100)
In case "ums" command is used on platforms which don't implement
g_dnl_board_usb_cable_connected() and USB cable is not connected,
we stay inside sleep_thread() forever and watchdog is triggered.

Add schedule() call to avoid this issue.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241202074644.5380-1-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/usb/gadget/f_mass_storage.c

index ffe1ae6..d3fc4ac 100644 (file)
@@ -682,6 +682,7 @@ static int sleep_thread(struct fsg_common *common)
                        k = 0;
                }
 
+               schedule();
                dm_usb_gadget_handle_interrupts(udcdev);
        }
        common->thread_wakeup_needed = 0;