From a4a1cd36041774b5b052d09aec86c50bcfcbf4f4 Mon Sep 17 00:00:00 2001 From: gujie Date: Thu, 5 Sep 2024 10:25:53 +0800 Subject: [PATCH] increase the cancel wait time between thread On our machine, the original timeout is insufficient, causing the USB gadget to close when attempting to cancel a file transfer. We've extended the timeout with additional redundancy to prevent this from happening. Signed-off-by: gujie --- src/usb_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb_gadget.c b/src/usb_gadget.c index 46af429..65bd487 100644 --- a/src/usb_gadget.c +++ b/src/usb_gadget.c @@ -523,7 +523,7 @@ static void handle_setup_request(usb_gadget * ctx, struct usb_ctrlrequest* setup while( mtp_context->cancel_req ) { // Still Waiting the end of the current transfer... - if( cnt > 500 ) + if( cnt > 2500 ) // wait 2.5s max for cancel_req from the io_thread { // Still blocked... Killing the link PRINT_DEBUG("MTP_REQ_CANCEL : Stalled ... Killing the link...");