As the bind configuration is not complete during thread creation, defering the thread wake to end of bind. Signed-off-by: Sanjay Singh Rawat <snjsrwt@xxxxxxxxx> --- drivers/usb/gadget/function/f_mass_storage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 0e90e38..a996f3f 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -3013,8 +3013,6 @@ int fsg_common_run_thread(struct fsg_common *common) DBG(common, "I/O thread pid: %d\n", task_pid_nr(common->thread_task)); - wake_up_process(common->thread_task); - return 0; } EXPORT_SYMBOL_GPL(fsg_common_run_thread); @@ -3121,6 +3119,9 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f) if (ret) goto autoconf_fail; + /* wakeup the thread */ + wake_up_process(fsg->common->thread_task); + return 0; autoconf_fail: -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html