From 4fb48ede932a5510b38237daa4e38f62dd396a37 Mon Sep 17 00:00:00 2001 From: hulianqin Date: Sun, 12 May 2024 20:25:02 +0800 Subject: [PATCH] ANDROID: usb: Optimize the problem of slow transfer rate in USB accessory mode The data transfer rate using Google Restore in USB3.2 mode is slower, only about 140MB/s at 5Gbps. The bMaxBurst is not set, and num_fifos in dwc3_gadget_resize_tx_fifosis 1, which results in only 131btye of dwc3 ram space being allocated to ep. Modify bMaxBurst to 6. The 5Gbps rate increases from 140MB/s to 350MB/s. The 10Gbps rate is increased from 220MB/s to 500MB/s. Bug: 340049583 Change-Id: I5710af32c72d0b57afaecc00c4f0909af4b9a299 Signed-off-by: Lianqin Hu Signed-off-by: Lianqin Hu --- drivers/usb/gadget/function/android_f_accessory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/android_f_accessory.c b/drivers/usb/gadget/function/android_f_accessory.c index a5710287d64c..47f286c1e10b 100644 --- a/drivers/usb/gadget/function/android_f_accessory.c +++ b/drivers/usb/gadget/function/android_f_accessory.c @@ -156,7 +156,7 @@ static struct usb_ss_ep_comp_descriptor acc_superspeedplus_comp_desc = { .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, /* the following 2 values can be tweaked if necessary */ - /* .bMaxBurst = 0, */ + .bMaxBurst = 6, /* .bmAttributes = 0, */ }; @@ -181,7 +181,7 @@ static struct usb_ss_ep_comp_descriptor acc_superspeed_comp_desc = { .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, /* the following 2 values can be tweaked if necessary */ - /* .bMaxBurst = 0, */ + .bMaxBurst = 6, /* .bmAttributes = 0, */ };