<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/usb/gadget/config.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-08-22T12:48:33Z</updated>
<entry>
<title>usb: gadget: config: remove max speed check in usb_assign_descriptors()</title>
<updated>2023-08-22T12:48:33Z</updated>
<author>
<name>Linyu Yuan</name>
<email>quic_linyyuan@quicinc.com</email>
</author>
<published>2023-08-03T09:10:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4dfdd90b85f811fc2cbae0d5f87a8d3e9bee9b17'/>
<id>urn:sha1:4dfdd90b85f811fc2cbae0d5f87a8d3e9bee9b17</id>
<content type='text'>
usb_assign_descriptors() usally called inside function bind operation,
and gadget still have no working connection speed, let's support all
speed at this point, it may possible allocate extra memory to store
descriptors, but it is small and acceptable.

Remove gadget_is_{*}speed() API checking to allow support all speed.

Signed-off-by: Linyu Yuan &lt;quic_linyyuan@quicinc.com&gt;
Link: https://lore.kernel.org/r/20230803091053.9714-6-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: fix various gadget panics on 10gbps cabling</title>
<updated>2021-06-09T08:40:08Z</updated>
<author>
<name>Maciej Żenczykowski</name>
<email>maze@google.com</email>
</author>
<published>2021-06-09T02:44:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=032e288097a553db5653af552dd8035cd2a0ba96'/>
<id>urn:sha1:032e288097a553db5653af552dd8035cd2a0ba96</id>
<content type='text'>
usb_assign_descriptors() is called with 5 parameters,
the last 4 of which are the usb_descriptor_header for:
  full-speed (USB1.1 - 12Mbps [including USB1.0 low-speed @ 1.5Mbps),
  high-speed (USB2.0 - 480Mbps),
  super-speed (USB3.0 - 5Gbps),
  super-speed-plus (USB3.1 - 10Gbps).

The differences between full/high/super-speed descriptors are usually
substantial (due to changes in the maximum usb block size from 64 to 512
to 1024 bytes and other differences in the specs), while the difference
between 5 and 10Gbps descriptors may be as little as nothing
(in many cases the same tuning is simply good enough).

However if a gadget driver calls usb_assign_descriptors() with
a NULL descriptor for super-speed-plus and is then used on a max 10gbps
configuration, the kernel will crash with a null pointer dereference,
when a 10gbps capable device port + cable + host port combination shows up.
(This wouldn't happen if the gadget max-speed was set to 5gbps, but
it of course defaults to the maximum, and there's no real reason to
artificially limit it)

The fix is to simply use the 5gbps descriptor as the 10gbps descriptor,
if a 10gbps descriptor wasn't provided.

Obviously this won't fix the problem if the 5gbps descriptor is also
NULL, but such cases can't be so trivially solved (and any such gadgets
are unlikely to be used with USB3 ports any way).

Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20210609024459.1126080-1-zenczykowski@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: Fix double free of device descriptor pointers</title>
<updated>2021-04-22T06:57:48Z</updated>
<author>
<name>Hemant Kumar</name>
<email>hemantk@codeaurora.org</email>
</author>
<published>2021-04-21T19:47:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=43c4cab006f55b6ca549dd1214e22f5965a8675f'/>
<id>urn:sha1:43c4cab006f55b6ca549dd1214e22f5965a8675f</id>
<content type='text'>
Upon driver unbind usb_free_all_descriptors() function frees all
speed descriptor pointers without setting them to NULL. In case
gadget speed changes (i.e from super speed plus to super speed)
after driver unbind only upto super speed descriptor pointers get
populated. Super speed plus desc still holds the stale (already
freed) pointer. Fix this issue by setting all descriptor pointers
to NULL after freeing them in usb_free_all_descriptors().

Fixes: f5c61225cf29 ("usb: gadget: Update function for SuperSpeedPlus")
cc: stable@vger.kernel.org
Reviewed-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Signed-off-by: Hemant Kumar &lt;hemantk@codeaurora.org&gt;
Signed-off-by: Wesley Cheng &lt;wcheng@codeaurora.org&gt;
Link: https://lore.kernel.org/r/1619034452-17334-1-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: gadget: Remove redundant license text</title>
<updated>2017-11-07T14:45:02Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-06T14:37:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e79bfcb795f9cabc7d5903eb779bed3f4d14b364'/>
<id>urn:sha1:e79bfcb795f9cabc7d5903eb779bed3f4d14b364</id>
<content type='text'>
Now that the SPDX tag is in all USB files, that identifies the license
in a specific and legally-defined manner.  So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Acked-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: add SPDX identifiers to all remaining files in drivers/usb/</title>
<updated>2017-11-04T10:48:02Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-03T10:28:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460'/>
<id>urn:sha1:5fd54ace4721fc5ce2bb5aef6318fcf17f421460</id>
<content type='text'>
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Cc: Philippe Ombredanne &lt;pombredanne@nexb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Acked-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: Use (foo *) instead of (foo*).</title>
<updated>2016-06-21T08:16:15Z</updated>
<author>
<name>Sandhya Bankar</name>
<email>bankarsandhya512@gmail.com</email>
</author>
<published>2016-05-04T06:53:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=43202800010102a857ffb119429d7dc5b41b7096'/>
<id>urn:sha1:43202800010102a857ffb119429d7dc5b41b7096</id>
<content type='text'>
Use (foo *) instead of (foo*).

Signed-off-by: Sandhya Bankar &lt;bankarsandhya512@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: Update function for SuperSpeedPlus</title>
<updated>2016-03-04T13:14:23Z</updated>
<author>
<name>John Youn</name>
<email>John.Youn@synopsys.com</email>
</author>
<published>2016-02-06T01:06:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f5c61225cf29c4f97e544ad7bd088256303acf97'/>
<id>urn:sha1:f5c61225cf29c4f97e544ad7bd088256303acf97</id>
<content type='text'>
Add a ssp_descriptors member to struct usb_function and handle the
initialization and cleanup of it. This holds the SuperSpeedPlus
descriptors for a function that supports SuperSpeedPlus. This is added
by usb_assign_descriptors().

Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: Update usb_assign_descriptors for SuperSpeedPlus</title>
<updated>2016-03-04T13:14:23Z</updated>
<author>
<name>John Youn</name>
<email>John.Youn@synopsys.com</email>
</author>
<published>2016-02-06T01:06:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=eaef50c760576bca70b87fdc26eb87a3660529f8'/>
<id>urn:sha1:eaef50c760576bca70b87fdc26eb87a3660529f8</id>
<content type='text'>
Add the 'ssp_descriptors' parameter to the usb_assign_descriptors()
function. This allows a function driver to add descriptors for
SuperSpeedPlus speeds if it supports it.

Also update all uses of this function in the gadget subsystem so that
they pass NULL for the ssp_descriptors parameters.

Signed-off-by: John Youn &lt;johnyoun@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: add usb otg descriptor allocate and init interface</title>
<updated>2015-07-29T14:59:21Z</updated>
<author>
<name>Li Jun</name>
<email>jun.li@freescale.com</email>
</author>
<published>2015-07-09T07:18:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d1606dfb98e59221332704c05f5908d9116456ab'/>
<id>urn:sha1:d1606dfb98e59221332704c05f5908d9116456ab</id>
<content type='text'>
Allocate usb otg descriptor and initialize it according to gadget's otg
capabilities, if usb_otg_caps is not set, keep settings as current gadget
drivers. With this 2 new interfaces, gadget can use usb_otg_descriptor
for OTG 1.x, and usb_otg20_descriptor for OTG 2.0 or above, and otg
features can be decided by the combination of usb hardware property
and driver config.

Signed-off-by: Li Jun &lt;jun.li@freescale.com&gt;
Reviewed-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: always update HS/SS descriptors and create a copy of them</title>
<updated>2012-10-31T13:09:44Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2012-10-22T20:15:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=10287baec761d33f0a82d84b46e37a44030350d8'/>
<id>urn:sha1:10287baec761d33f0a82d84b46e37a44030350d8</id>
<content type='text'>
HS and SS descriptors are staticaly created. They are updated during the
bind process with the endpoint address, string id or interface numbers.

After that, the descriptor chain is linked to struct usb_function which
is used by composite in order to serve the GET_DESCRIPTOR requests,
number of available configs and so on.

There is no need to assign the HS descriptor only if the UDC supports
HS speed because composite won't report those to the host if HS support
has not been reached. The same reasoning is valid for SS.

This patch makes sure each function updates HS/SS descriptors
unconditionally and uses the newly introduced helper function to create a
copy the descriptors for the speed which is supported by the UDC.

While at that, also rename f-&gt;descriptors to f-&gt;fs_descriptors in order
to make it more explicit what that means.

Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
