[PATCH] usb: gadget: f_mass_storage: Move schedule() in sleep_thread()

Patrice Chotard patrice.chotard at foss.st.com
Mon Jun 22 19:18:28 CEST 2026


Move schedule() in order to call it only every 10 loop iteration
to avoid useless overhead.

Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>
---
 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 <patrice.chotard at foss.st.com>



More information about the U-Boot mailing list