OSDN Git Service

usb: dwc3: gadget: Revise setting IOC when no TRB left
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 1 Oct 2020 00:44:25 +0000 (17:44 -0700)
committerFelipe Balbi <balbi@kernel.org>
Fri, 2 Oct 2020 06:57:46 +0000 (09:57 +0300)
commit8dbbe48c7a9989c75e39bfb2a886e163fa21660a
tree25923f5d3040fba4e7f42c38191a2c6f9cf122ff
parentf9cc581badb144a3dcd841aee2d3bc2d242fcb2f
usb: dwc3: gadget: Revise setting IOC when no TRB left

To keep the setting of interrupt-on-completion (IOC) when out of TRBs
consistent and easier to read, the caller of dwc3_prepare_one_trb()
will determine if the TRB must have IOC bit set. This also reduces the
number of times we need to call dwc3_calc_trbs_left(). Note that we only
care about setting IOC from insufficient number of TRBs for SG and not
linear requests (because we don't need to split linear requests).

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c