Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 17f3e6a3 authored by Ido Shayevitz's avatar Ido Shayevitz Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: bulk out endpoint optimization using CSP



For bulk transfers, the current implementation uses TRB allocation
"on demand". That is, it receives an XferNotReady event as the trigger
to prepare an array of TRBs to use for the upcoming transfer, with the
last TRB set with the LST bit which will trigger an XferComplete event.
A transfer, in many cases, consists of small packets. As such, for each
of the TRBs set up an XferComplete event is received.
This results in thousands of interrupts a second and a high CPU usage.
The optimization sets the CSP (continue on short packet) bit for all the
TRBs set up for the transfer to avoid those notifications, and relies on
the XferComplete event of the last TRB to denote the end of the transfer,
reducing the number of interrupts by orders of magnitude to several dozens.
To avoid potential starvation when small number of packets are transfered
a timer is added to notify on completed TRBs that are pending.

By default this optimization is disabled and below module param should be
used to enable it:
echo timer_freq_msec > /sys/module/dwc3/parameters/bulk_ep_xfer_timeout_ms
By default it is set to 0.

Change-Id: Ibd7ed518ef0f5100e1d1ed06fa3abb228af8706e
Signed-off-by: default avatarGilad Broner <gbroner@codeaurora.org>
Signed-off-by: default avatarIdo Shayevitz <idos@codeaurora.org>
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent d843cfb7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment