<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget/function/f_uac2.c, branch linux-4.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-08-14T23:41:11Z</updated>
<entry>
<title>Merge tag 'usb-for-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next</title>
<updated>2015-08-14T23:41:11Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2015-08-14T23:41:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a3fbedf98fe9909cb2e406e2018ec437d64806f6'/>
<id>urn:sha1:a3fbedf98fe9909cb2e406e2018ec437d64806f6</id>
<content type='text'>
Felipe writes:

usb: patches for v4.3 merge window

New support for Allwinne SoC on the MUSB driver has been added to the list of
glue layers. MUSB also got support for building all DMA engines in one binary;
this will be great for distros.

DWC3 now has no trace of dev_dbg()/dev_vdbg() usage. We will rely solely on
tracing to debug DWC3. There was also a fix for memory corruption with EP0 when
maxpacket size transfers are &gt; 512 bytes.

Robert's EP capabilities flags is making EP selection a lot simpler. UDCs are
now required to set these flags up when adding endpoints to the framework.

Other than these, we have the usual set of miscelaneous cleanups and minor
fixes.

Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: fix build warning</title>
<updated>2015-08-04T16:02:45Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2015-08-04T16:02:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0f4315a8f1a73f130bbc5dde134b704ea6dda56c'/>
<id>urn:sha1:0f4315a8f1a73f130bbc5dde134b704ea6dda56c</id>
<content type='text'>
commit 913e4a90b6f9 ("usb: gadget: f_uac2:
finalize wMaxPacketSize according to bandwidth")
added a possible build warning when calling
min(). In order to fix the warning, we just
make sure to call min_t() and tell that its
arguments should be u16.

Cc: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth</title>
<updated>2015-07-30T16:43:38Z</updated>
<author>
<name>Peter Chen</name>
</author>
<published>2015-07-30T05:13:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=913e4a90b6f9687ac0f543e7b632753e4f51c441'/>
<id>urn:sha1:913e4a90b6f9687ac0f543e7b632753e4f51c441</id>
<content type='text'>
According to USB Audio Device 2.0 Spec, Ch4.10.1.1:
wMaxPacketSize is defined as follows:
Maximum packet size this endpoint is capable of sending or receiving
when this configuration is selected.
This is determined by the audio bandwidth constraints of the endpoint.

In current code, the wMaxPacketSize is defined as the maximum packet size
for ISO endpoint, and it will let the host reserve much more space than
it really needs, so that we can't let more endpoints work together at
one frame.

We find this issue when we try to let 4 f_uac2 gadgets work together [1]
at FS connection.

[1]http://www.spinics.net/lists/linux-usb/msg123478.html

Acked-by: Daniel Mack &lt;zonque@gmail.com&gt;
Cc: andrzej.p@samsung.com
Cc: Daniel Mack &lt;zonque@gmail.com&gt;
Cc: tiwai@suse.de
Cc: &lt;stable@vger.kernel.org&gt; #v3.18+
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: fix calculation of uac2-&gt;p_interval</title>
<updated>2015-07-27T15:18:06Z</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=c41b7767673cb76adeb2b5fde220209f717ea13c'/>
<id>urn:sha1:c41b7767673cb76adeb2b5fde220209f717ea13c</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>usb: gadget: function: f_uac2: fix sparse warnings</title>
<updated>2015-02-23T15:21:28Z</updated>
<author>
<name>Lad, Prabhakar</name>
</author>
<published>2015-02-04T18:01:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef16e7c8ba9cee07d2295de01bbdf921d20c4902'/>
<id>urn:sha1:ef16e7c8ba9cee07d2295de01bbdf921d20c4902</id>
<content type='text'>
this patch fixes following sparse warnings:
f_uac2.c:57:12: warning: symbol 'uac2_name' was not declared. Should it be static?
f_uac2.c:637:36: warning: symbol 'in_clk_src_desc' was not declared. Should it be static?
f_uac2.c:649:36: warning: symbol 'out_clk_src_desc' was not declared. Should it be static?
f_uac2.c:661:39: warning: symbol 'usb_out_it_desc' was not declared. Should it be static?
f_uac2.c:675:39: warning: symbol 'io_in_it_desc' was not declared. Should it be static?
f_uac2.c:689:40: warning: symbol 'usb_in_ot_desc' was not declared. Should it be static?
f_uac2.c:703:40: warning: symbol 'io_out_ot_desc' was not declared. Should it be static?
f_uac2.c:716:34: warning: symbol 'ac_hdr_desc' was not declared. Should it be static?
f_uac2.c:754:34: warning: symbol 'as_out_hdr_desc' was not declared. Should it be static?
f_uac2.c:767:38: warning: symbol 'as_out_fmt1_desc' was not declared. Should it be static?
f_uac2.c:775:32: warning: symbol 'fs_epout_desc' was not declared. Should it be static?
f_uac2.c:785:32: warning: symbol 'hs_epout_desc' was not declared. Should it be static?
f_uac2.c:831:34: warning: symbol 'as_in_hdr_desc' was not declared. Should it be static?
f_uac2.c:844:38: warning: symbol 'as_in_fmt1_desc' was not declared. Should it be static?
f_uac2.c:852:32: warning: symbol 'fs_epin_desc' was not declared. Should it be static?
f_uac2.c:862:32: warning: symbol 'hs_epin_desc' was not declared. Should it be static?
f_uac2.c:1566:21: warning: symbol 'afunc_alloc' was not declared. Should it be static?

Signed-off-by: Lad, Prabhakar &lt;prabhakar.csengg@gmail.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.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>
</feed>
