]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
usb: cdns3: gadget: enlarge the TRB ring length
authorPeter Chen <peter.chen@nxp.com>
Thu, 10 Sep 2020 09:11:30 +0000 (17:11 +0800)
committerFelipe Balbi <balbi@kernel.org>
Fri, 2 Oct 2020 06:57:46 +0000 (09:57 +0300)
At Android ADB and MTP use case, it uses f_fs which supports scatter list,
it means one request may need several TRBs for it. Besides, TRB consumes
very fast compared to TRB has prepared for above use case, there are at
most 120 pending requests, the date size is 16KB for each request, so four
TRBs (4KB per TRB) per sg entry at worst case. so we need to enlarge the
TRB ring length to avoid "no free TRB error". Since each TRB only consumes
12 bytes (3 * 32 bits), we enlarge the TRB length to 600, it leaves some
buffers for potential "no free TRB error", and only increases a little
memory cost.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/cdns3/gadget.h

index 9f8bd452847e3f2fda0628afa167b45891fae429..1ccecd23753034edda19df66ab31910c4e14f752 100644 (file)
@@ -966,7 +966,7 @@ struct cdns3_usb_regs {
 /*
  * USBSS-DEV DMA interface.
  */
-#define TRBS_PER_SEGMENT       40
+#define TRBS_PER_SEGMENT       600
 
 #define ISO_MAX_INTERVAL       10