All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
@ 2024-12-02  7:46 Patrice Chotard
  2024-12-03  1:02 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Patrice Chotard @ 2024-12-02  7:46 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Caleb Connolly,
	Lukasz Majewski, Marek Vasut, Mattijs Korpershoek, Neil Armstrong,
	Tom Rini

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>

---

Changes in v2:
  - move schedule() right before dm_usb_gadget_handle_interrupts()

 drivers/usb/gadget/f_mass_storage.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index ffe1ae6eb73..d3fc4acb401 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-02-11  8:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02  7:46 [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread() Patrice Chotard
2024-12-03  1:02 ` Marek Vasut
2024-12-03  8:53   ` Patrice CHOTARD
2024-12-03  9:47 ` Mattijs Korpershoek
2025-02-10 10:28   ` Patrice CHOTARD
2025-02-10 13:42     ` Marek Vasut
2025-02-11  7:54       ` Mattijs Korpershoek
2025-02-11  8:24         ` Patrice CHOTARD
2025-02-11  7:59 ` 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.