summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorWesley Cheng <quic_wcheng@quicinc.com>2022-05-24 00:39:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-10 12:10:43 +0300
commit9c1e916960c1192e746bf615e4dae25423473a64 (patch)
treec8337ab78849ff5f103b8763381df4cd17d98eb0 /net
parent1d9e615f1ab34c690d25b8742abe423219e5d3af (diff)
downloadlinux-9c1e916960c1192e746bf615e4dae25423473a64.tar.xz
usb: dwc3: gadget: Fix IN endpoint max packet size allocation
The current logic to assign the max packet limit for IN endpoints attempts to take the default HW value and apply the optimal endpoint settings based on it. However, if the default value reports a TxFIFO size large enough for only one max packet, it will divide the value and assign a smaller ep max packet limit. For example, if the default TxFIFO size fits 1024B, current logic will assign 1024/3 = 341B to ep max packet size. If function drivers attempt to request for an endpoint with a wMaxPacketSize of 1024B (SS BULK max packet size) then it will fail, as the gadget is unable to find an endpoint which can fit the requested size. Functionally, if the TxFIFO has enough space to fit one max packet, it will be sufficient, at least when initializing the endpoints. Fixes: d94ea5319813 ("usb: dwc3: gadget: Properly set maxpacket limit") Cc: stable <stable@kernel.org> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> Link: https://lore.kernel.org/r/20220523213948.22142-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions