summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Pham <jackp@codeaurora.org>2021-09-09 10:48:11 -0700
committerGreg Kroah-Hartman <gregkh@google.com>2021-09-15 06:55:02 +0000
commitba98a3a1bbcc2a672f2bb9b5a4eafdaf0867de60 (patch)
tree35ecd8e2c9fb4a51cfea233a417d7a84ac84a0a5
parentd9e738916e46eaf4ff6a612776af98667435d0c3 (diff)
downloadcommon-ba98a3a1bbcc2a672f2bb9b5a4eafdaf0867de60.tar.gz
BACKPORT: FROMGIT: 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> Bug: 199044440 Change-Id: Ibf183102d577aa02746822d145d63a1c767557d2 (cherry picked from commit f0e8a206a2a53a919e1709c654cb65d519f7befb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus) [jackp: Resolved merge conflict in f_uac2.c due to added code in upstream] Signed-off-by: Jack Pham <jackp@codeaurora.org>
-rw-r--r--drivers/usb/gadget/function/f_uac2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index abb8c1852bfb..53cb6b2637a0 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -957,6 +957,9 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
agdev->out_ep_maxpsize = max_t(u16, agdev->out_ep_maxpsize,
le16_to_cpu(ss_epout_desc.wMaxPacketSize));
+ ss_epin_desc_comp.wBytesPerInterval = ss_epin_desc.wMaxPacketSize;
+ ss_epout_desc_comp.wBytesPerInterval = ss_epout_desc.wMaxPacketSize;
+
hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;
hs_epin_fback_desc.bEndpointAddress = fs_epin_fback_desc.bEndpointAddress;
hs_epin_desc.bEndpointAddress = fs_epin_desc.bEndpointAddress;