<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget/function/f_uac2.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-09-05T07:16:20Z</updated>
<entry>
<title>usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'</title>
<updated>2018-09-05T07:16:20Z</updated>
<author>
<name>Eugeniu Rosca</name>
</author>
<published>2018-07-02T21:46:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b8e010e3a0c12e88adad7017f03aefd9532d2e3'/>
<id>urn:sha1:2b8e010e3a0c12e88adad7017f03aefd9532d2e3</id>
<content type='text'>
[ Upstream commit eec24f2a0d4dc3b1d95a3ccd2feb523ede3ba775 ]

The list [1] of commits doing endianness fixes in USB subsystem is long
due to below quote from USB spec Revision 2.0 from April 27, 2000:

------------
8.1 Byte/Bit Ordering

Multiple byte fields in standard descriptors, requests, and responses
are interpreted as and moved over the bus in little-endian order, i.e.
LSB to MSB.
------------

This commit belongs to the same family.

[1] Example of endianness fixes in USB subsystem:
commit 14e1d56cbea6 ("usb: gadget: f_uac2: endianness fixes.")
commit 42370b821168 ("usb: gadget: f_uac1: endianness fixes.")
commit 63afd5cc7877 ("USB: chaoskey: fix Alea quirk on big-endian hosts")
commit 74098c4ac782 ("usb: gadget: acm: fix endianness in notifications")
commit cdd7928df0d2 ("ACM gadget: fix endianness in notifications")
commit 323ece54e076 ("cdc-wdm: fix endianness bug in debug statements")
commit e102609f1072 ("usb: gadget: uvc: Fix endianness mismatches")
       list goes on

Fixes: 132fcb460839 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Eugeniu Rosca &lt;erosca@de.adit-jv.com&gt;
Reviewed-by: Ruslan Bilovol &lt;ruslan.bilovol@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;

Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: fix bFirstInterface in composite gadget</title>
<updated>2018-05-30T05:47:33Z</updated>
<author>
<name>John Keeping</name>
</author>
<published>2018-01-12T18:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a7976cd3cdb497f0a4c8f712b910d2e3915b1d1'/>
<id>urn:sha1:3a7976cd3cdb497f0a4c8f712b910d2e3915b1d1</id>
<content type='text'>
[ Upstream commit 8813a59ed892305b5ac1b5b901740b1ad4b5fefa ]

If there are multiple functions associated with a configuration, then
the UAC2 interfaces may not start at zero.  Set the correct first
interface number in the association descriptor so that the audio
interfaces are enumerated correctly in this case.

Reviewed-by: Krzysztof Opasiak &lt;k.opasiak@samsung.com&gt;
Signed-off-by: John Keeping &lt;john@metanate.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: fix calculation of uac2-&gt;p_interval</title>
<updated>2015-08-27T17:25:33Z</updated>
<author>
<name>Peter Chen</name>
</author>
<published>2015-07-27T06:51:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12c55ffc8168eec4773b927f761865e6f8f96f36'/>
<id>urn:sha1:12c55ffc8168eec4773b927f761865e6f8f96f36</id>
<content type='text'>
[ Upstream commit c41b7767673cb76adeb2b5fde220209f717ea13c ]

The p_interval should be less if the 'bInterval' at the descriptor
is larger, eg, if 'bInterval' is 5 for HS, the p_interval should be
8000 / 16 = 500.

It fixes the patch 9bb87f168931 ("usb: gadget: f_uac2: send
reasonably sized packets")

Cc: &lt;stable@vger.kernel.org&gt; # v3.18+
Fixes: 9bb87f168931 ("usb: gadget: f_uac2: send reasonably sized packets")
Acked-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: Remove redundant usb_free_all_descriptors</title>
<updated>2014-10-23T18:57:24Z</updated>
<author>
<name>Pavitrakumar Managutte</name>
</author>
<published>2014-10-22T13:54:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d12a8727171c770990c246f0682f0af7859bb245'/>
<id>urn:sha1:d12a8727171c770990c246f0682f0af7859bb245</id>
<content type='text'>
Removed usb_free_all_descriptors in the bind functions, which
results in double-free corruption of the descriptors on error path.
The usb descriptors are allocated by usb_assign_descriptors.

Signed-off-by: Pavitrakumar Managutte &lt;pavitra1729@gmail.com&gt;
Reviewed-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: uac2: add a release method</title>
<updated>2014-10-20T20:58:49Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2014-09-29T19:24:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de1e6e799fc4e6f0452737e454267c0bfdf88c62'/>
<id>urn:sha1:de1e6e799fc4e6f0452737e454267c0bfdf88c62</id>
<content type='text'>
devices are required to provide a release method. This
patch fixes the following WARN():

[   42.611159] ------------[ cut here ]------------
[   42.616025] WARNING: CPU: 0 PID: 1453 at drivers/base/core.c:250 device_release+0x94/0xa0()
[   42.624820] Device 'snd_uac2.0' does not have a release() function, it is broken and must be fixed.
[   42.634328] Modules linked in: usb_f_uac2 g_audio(-) libcomposite configfs xhci_hcd snd_soc_davinci_mcasp snd_soc_edma snd_soc_tlv320aic3x snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress omapdrm snd_pcm_dmaengine snd_pcm snd_timer snd fb_sys_fops lis3lv02d_i2c matrix_keypad dwc3_omap lis3lv02d panel_dpi input_polldev soundcore
[   42.665687] CPU: 0 PID: 1453 Comm: modprobe Tainted: G      D        3.17.0-rc6-00448-g9f3d0ec-dirty #188
[   42.675756] [&lt;c0017338&gt;] (unwind_backtrace) from [&lt;c0012fdc&gt;] (show_stack+0x20/0x24)
[   42.683911] [&lt;c0012fdc&gt;] (show_stack) from [&lt;c0647fbc&gt;] (dump_stack+0x8c/0xa4)
[   42.691526] [&lt;c0647fbc&gt;] (dump_stack) from [&lt;c0049950&gt;] (warn_slowpath_common+0x7c/0xa0)
[   42.700004] [&lt;c0049950&gt;] (warn_slowpath_common) from [&lt;c00499b4&gt;] (warn_slowpath_fmt+0x40/0x48)
[   42.709194] [&lt;c00499b4&gt;] (warn_slowpath_fmt) from [&lt;c0405f7c&gt;] (device_release+0x94/0xa0)
[   42.717794] [&lt;c0405f7c&gt;] (device_release) from [&lt;c032e8e8&gt;] (kobject_cleanup+0x4c/0x7c)
[   42.726189] [&lt;c032e8e8&gt;] (kobject_cleanup) from [&lt;c032e7c8&gt;] (kobject_put+0x60/0x90)
[   42.734316] [&lt;c032e7c8&gt;] (kobject_put) from [&lt;c0406320&gt;] (put_device+0x24/0x28)
[   42.741995] [&lt;c0406320&gt;] (put_device) from [&lt;c040c008&gt;] (platform_device_unregister+0x2c/0x30)
[   42.751061] [&lt;c040c008&gt;] (platform_device_unregister) from [&lt;bf2b6b70&gt;] (afunc_unbind+0x2c/0x68 [usb_f_uac2])
[   42.761523] [&lt;bf2b6b70&gt;] (afunc_unbind [usb_f_uac2]) from [&lt;bf29dbec&gt;] (remove_config.isra.8+0xe8/0x100 [libcomposite])
[   42.772868] [&lt;bf29dbec&gt;] (remove_config.isra.8 [libcomposite]) from [&lt;bf29f9a4&gt;] (__composite_unbind+0x48/0xb0 [libcomposite])
[   42.784855] [&lt;bf29f9a4&gt;] (__composite_unbind [libcomposite]) from [&lt;bf29fa28&gt;] (composite_unbind+0x1c/0x20 [libcomposite])
[   42.796446] [&lt;bf29fa28&gt;] (composite_unbind [libcomposite]) from [&lt;c04d229c&gt;] (usb_gadget_remove_driver+0x78/0xb0)
[   42.807224] [&lt;c04d229c&gt;] (usb_gadget_remove_driver) from [&lt;c04d2348&gt;] (usb_gadget_unregister_driver+0x74/0xb8)
[   42.817742] [&lt;c04d2348&gt;] (usb_gadget_unregister_driver) from [&lt;bf29db00&gt;] (usb_composite_unregister+0x1c/0x20 [libcomposite])
[   42.829632] [&lt;bf29db00&gt;] (usb_composite_unregister [libcomposite]) from [&lt;bf2b1084&gt;] (audio_driver_exit+0x14/0x1c [g_audio])
[   42.841430] [&lt;bf2b1084&gt;] (audio_driver_exit [g_audio]) from [&lt;c00c0fe0&gt;] (SyS_delete_module+0x120/0x1b0)
[   42.851415] [&lt;c00c0fe0&gt;] (SyS_delete_module) from [&lt;c000ed40&gt;] (ret_fast_syscall+0x0/0x48)
[   42.860075] ---[ end trace bb22e678d8d6db7b ]---
root@saruman:~#

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: uac2: prevent double ep disable</title>
<updated>2014-10-20T20:58:49Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2014-09-29T19:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3bb7b298120df8a9b7354e4f6d07e3185c15db7'/>
<id>urn:sha1:f3bb7b298120df8a9b7354e4f6d07e3185c15db7</id>
<content type='text'>
without this check, f_uac2 would try to disable
the same endpoint twice. Fix that.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: uac2: add wMaxPacketSize to ep desc</title>
<updated>2014-10-20T20:58:49Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2014-09-29T19:18:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=703a303c187ef7e3c8daf8a1be343576c9579eaf'/>
<id>urn:sha1:703a303c187ef7e3c8daf8a1be343576c9579eaf</id>
<content type='text'>
Endpoint descriptors should pass wMaxPacketSize. Note
that this also fixes USB20CV Other Speed Endpoint
Descriptor Tests.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: send reasonably sized packets</title>
<updated>2014-09-02T14:28:00Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9bb87f168931cf55738ed2fbda3639575cede886'/>
<id>urn:sha1:9bb87f168931cf55738ed2fbda3639575cede886</id>
<content type='text'>
The UAC2 function driver currently responds to all packets at all times
with wMaxPacketSize packets. That results in way too fast audio
playback as the function driver (which is in fact supposed to define
the audio stream pace) delivers as fast as it can.

Fix this by sizing each packet correctly with the following steps:

 a) Set the packet's size by dividing the nominal data rate by the
    playback endpoint's interval.

 b) If there is a residual value from the calculation in a), add
    it to a accumulator to keep track of it across packets.

 c) If the accumulator has gathered at least the number of bytes
    that are needed for one sample frame, increase the packet size.

This way, the packet size calculation will get rid of any kind of
imprecision that would otherwise occur with a simple division over
time.

Some of the variables that are needed while processing each packet
are pre-computed for performance reasons.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: handle partial dma area wrap</title>
<updated>2014-09-02T14:17:07Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec9e43138f1219966850477e056f6eb7fbcc4fa4'/>
<id>urn:sha1:ec9e43138f1219966850477e056f6eb7fbcc4fa4</id>
<content type='text'>
With packet sizes other than 512, payloads in the packets may wrap
around the ALSA dma buffer partially, which leads to memory corruption
and audible clicks and pops in the audio stream at the moment, because
there is no boundary check before the memcpy().

In preparation to an implementation for smaller and dynamically sized
packets, we have to address such cases, and copy the payload in two
steps conditionally.

The 'src' and 'dst' approach doesn't work here anymore, as different
behavior is necessary in playback and capture cases. Thus, this patch
open-codes the routine now.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: introduce agdev_to_uac2_opts</title>
<updated>2014-09-02T14:17:06Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2014-08-27T17:09:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=254b3bf68b65ac8f82da1c7e0c1a2bb17012aa7d'/>
<id>urn:sha1:254b3bf68b65ac8f82da1c7e0c1a2bb17012aa7d</id>
<content type='text'>
Add a simple container_of() wrapper to get a struct f_uac2_opts from a
struct struct audio_dev. Use it in two places where it is currently
open-coded.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
