]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
usb: dwc2: Fix INTR OUT transfers in DDMA mode.
authorMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Thu, 24 Sep 2020 14:08:39 +0000 (18:08 +0400)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:48:52 +0000 (14:48 +0100)
commit2745d6c3c2d4420cf843c09f6289be0a4bde792e
tree108b7c3bee9d29e053d094e9147734230caf44d1
parent7e6492548b8d3baf6dc8f3ff5ce8501579053d26
usb: dwc2: Fix INTR OUT transfers in DDMA mode.

BugLink: https://bugs.launchpad.net/bugs/1902115
[ Upstream commit b2c586eb07efab982419f32b7c3bd96829bc8bcd ]

In DDMA mode if INTR OUT transfers mps not multiple of 4 then single packet
corresponds to single descriptor.

Descriptor limit set to mps and desc chain limit set to mps *
MAX_DMA_DESC_NUM_GENERIC. On that descriptors complete, to calculate
transfer size should be considered correction value for each descriptor.

In start request function, if "continue" is true then dma buffer address
should be incremmented by offset for all type of transfers, not only for
Control DATA_OUT transfers.

Fixes: cf77b5fb9b394 ("usb: dwc2: gadget: Transfer length limit checking for DDMA")
Fixes: e02f9aa6119e0 ("usb: dwc2: gadget: EP 0 specific DDMA programming")
Fixes: aa3e8bc81311e ("usb: dwc2: gadget: DDMA transfer start and complete")
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/usb/dwc2/gadget.c