Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: f_uac2: Populate SS descriptors' wBytesPerInterval

For Isochronous endpoints, the SS companion descriptor's
wBytesPerInterval field is required to reserve bus time in order
to transmit the required payload during the service interval.
If left at 0, the UAC2 function is unable to transact data on its
playback or capture endpoints in SuperSpeed mode.

Since f_uac2 currently does not support any bursting this value can
be exactly equal to the calculated wMaxPacketSize.

Tested with Windows 10 as a host.

Fixes: f8cb3d556be3 ("usb: f_uac2: adds support for SS and SSP")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Link: https://lore.kernel.org/r/20210909174811.12534-3-jackp@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jack Pham and committed by
Greg Kroah-Hartman
f0e8a206 595091a1

+3
+3
drivers/usb/gadget/function/f_uac2.c
··· 1178 1178 agdev->out_ep_maxpsize = max_t(u16, agdev->out_ep_maxpsize, 1179 1179 le16_to_cpu(ss_epout_desc.wMaxPacketSize)); 1180 1180 1181 + ss_epin_desc_comp.wBytesPerInterval = ss_epin_desc.wMaxPacketSize; 1182 + ss_epout_desc_comp.wBytesPerInterval = ss_epout_desc.wMaxPacketSize; 1183 + 1181 1184 // HS and SS endpoint addresses are copied from autoconfigured FS descriptors 1182 1185 hs_ep_int_desc.bEndpointAddress = fs_ep_int_desc.bEndpointAddress; 1183 1186 hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;