linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: balbi@kernel.org
Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, pawell@cadence.com,
	rogerq@ti.com, gregkh@linuxfoundation.org, jun.li@nxp.com,
	Peter Chen <peter.chen@nxp.com>
Subject: [PATCH v2 8/8] usb: cdns3: gadget: enlarge the TRB ring length
Date: Thu, 10 Sep 2020 17:11:30 +0800	[thread overview]
Message-ID: <20200910091130.20937-9-peter.chen@nxp.com> (raw)
In-Reply-To: <20200910091130.20937-1-peter.chen@nxp.com>

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>
---
 drivers/usb/cdns3/gadget.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/gadget.h b/drivers/usb/cdns3/gadget.h
index 9f8bd452847e..1ccecd237530 100644
--- a/drivers/usb/cdns3/gadget.h
+++ b/drivers/usb/cdns3/gadget.h
@@ -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
 
-- 
2.17.1


      parent reply	other threads:[~2020-09-10  9:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10  9:11 [PATCH v2 0/8] usb: cdns3: improve the sg use case Peter Chen
2020-09-10  9:11 ` [PATCH v2 1/8] usb: cdns3: gadget: using correct sg operations Peter Chen
2020-09-24  7:27   ` Felipe Balbi
2020-09-24  9:33     ` Peter Chen
2020-09-29  3:40       ` Peter Chen
2020-09-29  6:29         ` Felipe Balbi
2020-09-10  9:11 ` [PATCH v2 2/8] usb: cdns3: gadget: improve the dump TRB operation at cdns3_ep_run_transfer Peter Chen
2020-09-10  9:11 ` [PATCH v2 3/8] usb: cdns3: gadget: calculate TDL correctly Peter Chen
2020-09-10  9:11 ` [PATCH v2 4/8] usb: cdns3: gadget: add CHAIN and ISP bit for sg list use case Peter Chen
2020-09-10  9:11 ` [PATCH v2 5/8] usb: cdns3: gadget: handle sg list use case at completion correctly Peter Chen
2020-09-10  9:11 ` [PATCH v2 6/8] usb: cdns3: gadget: need to handle sg case for workaround 2 case Peter Chen
2020-09-10  9:11 ` [PATCH v2 7/8] usb: cdns3: gadget: sg_support is only for DEV_VER_V2 or above Peter Chen
2020-09-10  9:11 ` Peter Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200910091130.20937-9-peter.chen@nxp.com \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.li@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=rogerq@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).