]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Sep 2021 17:01:23 +0000 (19:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Sep 2021 17:01:23 +0000 (19:01 +0200)
added patches:
usb-gadget-f_uac2-add-missing-companion-descriptor-for-feedback-ep.patch
usb-gadget-f_uac2-populate-ss-descriptors-wbytesperinterval.patch

queue-5.14/series
queue-5.14/usb-gadget-f_uac2-add-missing-companion-descriptor-for-feedback-ep.patch [new file with mode: 0644]
queue-5.14/usb-gadget-f_uac2-populate-ss-descriptors-wbytesperinterval.patch [new file with mode: 0644]

index 59cc5d8dba678d6304d2938272bf7e91be25bbcb..37d65e44663d3bc22dc32bf67b0b1c0e4d79f809 100644 (file)
@@ -158,3 +158,5 @@ software-node-balance-refcount-for-managed-software-nodes.patch
 xen-balloon-fix-balloon-kthread-freezing.patch
 qnx4-work-around-gcc-false-positive-warning-bug.patch
 nvmet-fix-a-width-vs-precision-bug-in-nvmet_subsys_attr_serial_show.patch
+usb-gadget-f_uac2-add-missing-companion-descriptor-for-feedback-ep.patch
+usb-gadget-f_uac2-populate-ss-descriptors-wbytesperinterval.patch
diff --git a/queue-5.14/usb-gadget-f_uac2-add-missing-companion-descriptor-for-feedback-ep.patch b/queue-5.14/usb-gadget-f_uac2-add-missing-companion-descriptor-for-feedback-ep.patch
new file mode 100644 (file)
index 0000000..3dbe637
--- /dev/null
@@ -0,0 +1,80 @@
+From 595091a1426a3b2625dad322f69fe569dc9d8943 Mon Sep 17 00:00:00 2001
+From: Jack Pham <jackp@codeaurora.org>
+Date: Thu, 9 Sep 2021 10:48:10 -0700
+Subject: usb: gadget: f_uac2: Add missing companion descriptor for feedback EP
+
+From: Jack Pham <jackp@codeaurora.org>
+
+commit 595091a1426a3b2625dad322f69fe569dc9d8943 upstream.
+
+The f_uac2 function fails to enumerate when connected in SuperSpeed
+due to the feedback endpoint missing the companion descriptor.
+Add a new ss_epin_fback_desc_comp descriptor and append it behind the
+ss_epin_fback_desc both in the static definition of the ss_audio_desc
+structure as well as its dynamic construction in setup_headers().
+
+Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Jack Pham <jackp@codeaurora.org>
+Link: https://lore.kernel.org/r/20210909174811.12534-2-jackp@codeaurora.org
+[jackp: Backport to 5.14 with minor conflict resolution]
+Signed-off-by: Jack Pham <jackp@codeaurora.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/gadget/function/f_uac2.c |   16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/gadget/function/f_uac2.c
++++ b/drivers/usb/gadget/function/f_uac2.c
+@@ -348,6 +348,14 @@ static struct usb_endpoint_descriptor ss
+       .bInterval = 4,
+ };
++static struct usb_ss_ep_comp_descriptor ss_epin_fback_desc_comp = {
++      .bLength                = sizeof(ss_epin_fback_desc_comp),
++      .bDescriptorType        = USB_DT_SS_ENDPOINT_COMP,
++      .bMaxBurst              = 0,
++      .bmAttributes           = 0,
++      .wBytesPerInterval      = cpu_to_le16(4),
++};
++
+ /* Audio Streaming IN Interface - Alt0 */
+ static struct usb_interface_descriptor std_as_in_if0_desc = {
+@@ -527,6 +535,7 @@ static struct usb_descriptor_header *ss_
+       (struct usb_descriptor_header *)&ss_epout_desc_comp,
+       (struct usb_descriptor_header *)&as_iso_out_desc,
+       (struct usb_descriptor_header *)&ss_epin_fback_desc,
++      (struct usb_descriptor_header *)&ss_epin_fback_desc_comp,
+       (struct usb_descriptor_header *)&std_as_in_if0_desc,
+       (struct usb_descriptor_header *)&std_as_in_if1_desc,
+@@ -604,6 +613,7 @@ static void setup_headers(struct f_uac2_
+ {
+       struct usb_ss_ep_comp_descriptor *epout_desc_comp = NULL;
+       struct usb_ss_ep_comp_descriptor *epin_desc_comp = NULL;
++      struct usb_ss_ep_comp_descriptor *epin_fback_desc_comp = NULL;
+       struct usb_endpoint_descriptor *epout_desc;
+       struct usb_endpoint_descriptor *epin_desc;
+       struct usb_endpoint_descriptor *epin_fback_desc;
+@@ -626,6 +636,7 @@ static void setup_headers(struct f_uac2_
+               epout_desc_comp = &ss_epout_desc_comp;
+               epin_desc_comp = &ss_epin_desc_comp;
+               epin_fback_desc = &ss_epin_fback_desc;
++              epin_fback_desc_comp = &ss_epin_fback_desc_comp;
+       }
+       i = 0;
+@@ -654,8 +665,11 @@ static void setup_headers(struct f_uac2_
+               headers[i++] = USBDHDR(&as_iso_out_desc);
+-              if (EPOUT_FBACK_IN_EN(opts))
++              if (EPOUT_FBACK_IN_EN(opts)) {
+                       headers[i++] = USBDHDR(epin_fback_desc);
++                      if (epin_fback_desc_comp)
++                              headers[i++] = USBDHDR(epin_fback_desc_comp);
++              }
+       }
+       if (EPIN_EN(opts)) {
+               headers[i++] = USBDHDR(&std_as_in_if0_desc);
diff --git a/queue-5.14/usb-gadget-f_uac2-populate-ss-descriptors-wbytesperinterval.patch b/queue-5.14/usb-gadget-f_uac2-populate-ss-descriptors-wbytesperinterval.patch
new file mode 100644 (file)
index 0000000..c014924
--- /dev/null
@@ -0,0 +1,43 @@
+From f0e8a206a2a53a919e1709c654cb65d519f7befb Mon Sep 17 00:00:00 2001
+From: Jack Pham <jackp@codeaurora.org>
+Date: Thu, 9 Sep 2021 10:48:11 -0700
+Subject: usb: gadget: f_uac2: Populate SS descriptors' wBytesPerInterval
+
+From: Jack Pham <jackp@codeaurora.org>
+
+commit f0e8a206a2a53a919e1709c654cb65d519f7befb upstream.
+
+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
+[jackp: Backport to 5.14 with minor conflict resolution]
+Signed-off-by: Jack Pham <jackp@codeaurora.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/gadget/function/f_uac2.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/gadget/function/f_uac2.c
++++ b/drivers/usb/gadget/function/f_uac2.c
+@@ -951,6 +951,9 @@ afunc_bind(struct usb_configuration *cfg
+       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;