<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/sound/usb/endpoint.c, branch linux-5.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-08-01T12:00:32Z</updated>
<entry>
<title>ALSA: usb-audio: remove redundant pointer 'urb'</title>
<updated>2018-08-01T12:00:32Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2018-08-01T10:47:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d36455a38ed82e7d1e6807573935874f0b279f45'/>
<id>urn:sha1:d36455a38ed82e7d1e6807573935874f0b279f45</id>
<content type='text'>
Pointer 'urb' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'urb' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion</title>
<updated>2017-01-05T06:35:17Z</updated>
<author>
<name>Ioan-Adrian Ratiu</name>
</author>
<published>2017-01-04T22:37:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13a6c8328e6056932dc680e447d4c5e8ad9add17'/>
<id>urn:sha1:13a6c8328e6056932dc680e447d4c5e8ad9add17</id>
<content type='text'>
Testing EP_FLAG_RUNNING in snd_complete_urb() before running the completion
logic allows us to save a few cpu cycles by returning early, skipping the
pending urb in case the stream was stopped; the stop logic handles the urb
and sets the completion callbacks to NULL.

Signed-off-by: Ioan-Adrian Ratiu &lt;adi@adirat.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: usb-audio: Fix irq/process data synchronization</title>
<updated>2017-01-05T06:35:00Z</updated>
<author>
<name>Ioan-Adrian Ratiu</name>
</author>
<published>2017-01-04T22:37:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d0f953086f090a022f2c0e1448300c15372db46'/>
<id>urn:sha1:1d0f953086f090a022f2c0e1448300c15372db46</id>
<content type='text'>
Commit 16200948d83 ("ALSA: usb-audio: Fix race at stopping the stream") was
incomplete causing another more severe kernel panic, so it got reverted.
This fixes both the original problem and its fallout kernel race/crash.

The original fix is to move the endpoint member NULL clearing logic inside
wait_clear_urbs() so the irq triggering the urb completion doesn't call
retire_capture/playback_urb() after the NULL clearing and generate a panic.

However this creates a new race between snd_usb_endpoint_start()'s call
to wait_clear_urbs() and the irq urb completion handler which again calls
retire_capture/playback_urb() leading to a new NULL dereference.

We keep the EP deactivation code in snd_usb_endpoint_start() because
removing it will break the EP reference counting (see [1] [2] for info),
however we don't need the "can_sleep" mechanism anymore because a new
function was introduced (snd_usb_endpoint_sync_pending_stop()) which
synchronizes pending stops and gets called inside the pcm prepare callback.

It also makes sense to remove can_sleep because it was also removed from
deactivate_urbs() signature in [3] so we benefit from more simplification.

[1] commit 015618b90 ("ALSA: snd-usb: Fix URB cancellation at stream start")
[2] commit e9ba389c5 ("ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream")
[3] commit ccc1696d5 ("ALSA: usb-audio: simplify endpoint deactivation code")

Fixes: f8114f8583bb ("Revert "ALSA: usb-audio: Fix race at stopping the stream"")

Signed-off-by: Ioan-Adrian Ratiu &lt;adi@adirat.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>Revert "ALSA: usb-audio: Fix race at stopping the stream"</title>
<updated>2016-12-21T17:48:14Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2016-12-21T10:28:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8114f8583bb18a467c04ddc1e8978330e445801'/>
<id>urn:sha1:f8114f8583bb18a467c04ddc1e8978330e445801</id>
<content type='text'>
This reverts commit 16200948d8353fe29a473a394d7d26790deae0e7.

The commit was intended to cover the race condition, but it introduced
yet another regression for devices with the implicit feedback, leading
to a kernel panic due to NULL-dereference in an irq context.

As the race condition that was addressed by the commit is very rare
and the regression is much worse, let's revert the commit for rc1, and
fix the issue properly in a later patch.

Fixes: 16200948d835 ("ALSA: usb-audio: Fix race at stopping the stream")
Reported-by: Ioan-Adrian Ratiu &lt;adi@adirat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ALSA: usb-audio: Eliminate noise at the start of DSD playback.</title>
<updated>2016-12-12T21:43:35Z</updated>
<author>
<name>Nobutaka Okabe</name>
</author>
<published>2016-12-12T17:52:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=012007309133d21a5a7eae3f552c03ac061a2b51'/>
<id>urn:sha1:012007309133d21a5a7eae3f552c03ac061a2b51</id>
<content type='text'>
[Problem]
In some USB DACs, a terrible pop noise comes to be heard
at the start of DSD playback (in the following situations).

- play first DSD track
- change from PCM track to DSD track
- change from DSD64 track to DSD128 track (and etc...)
- seek DSD track
- Fast-Forward/Rewind DSD track

[Cause]
At the start of playback, there is a little silence.
The silence bit pattern "0x69" is required on DSD mode,
but it is not like that.

[Solution]
This patch adds DSD silence pattern to the endpoint settings.

Signed-off-by: Nobutaka Okabe &lt;nob77413@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' into for-next</title>
<updated>2016-12-09T10:21:35Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2016-12-09T10:21:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d71bb23a81f80eeb5291e5c782377024e7265a23'/>
<id>urn:sha1:d71bb23a81f80eeb5291e5c782377024e7265a23</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ALSA: usb-audio: more tolerant packetsize</title>
<updated>2016-12-06T12:55:59Z</updated>
<author>
<name>Andreas Pape</name>
</author>
<published>2016-12-06T05:46:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd1a5059610cd3887f1050171a840ca864108730'/>
<id>urn:sha1:fd1a5059610cd3887f1050171a840ca864108730</id>
<content type='text'>
since commit 57e6dae1087b ("ALSA: usb-audio: do not trust too-big
wMaxPacketSize values"), the expected packetsize is always limited
to nominal + 25%. It was discovered, that some devices (Android audio
accessory) have a much higher jitter in used packetsizes than 25%
which would result in BABBLE condition and dropping of packets.
A better solution is so assume the jitter to be the nominal packetsize:
-one nearly empty packet followed by a almost 150% sized one.

V2: changed to assume max frequency is +50 of nominal packetsize.

Signed-off-by: Andreas Pape &lt;apape@de.adit-jv.com&gt;
Signed-off-by: Jiada Wang &lt;jiada_wang@mentor.com&gt;
Acked-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: usb-audio: Fix race at stopping the stream</title>
<updated>2016-12-05T10:19:38Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2016-12-05T10:19:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16200948d8353fe29a473a394d7d26790deae0e7'/>
<id>urn:sha1:16200948d8353fe29a473a394d7d26790deae0e7</id>
<content type='text'>
We've got a kernel crash report showing like:

  Unable to handle kernel NULL pointer dereference at virtual address 00000008 pgd = a1d7c000
  [00000008] *pgd=31c93831, *pte=00000000, *ppte=00000000
  Internal error: Oops: 17 [#1] PREEMPT SMP ARM
  CPU: 0 PID: 250 Comm: dbus-daemon Not tainted 3.14.51-03479-gf50bdf4 #1
  task: a3ae61c0 ti: a08c8000 task.ti: a08c8000
  PC is at retire_capture_urb+0x10/0x1f4 [snd_usb_audio]
  LR is at snd_complete_urb+0x140/0x1f0 [snd_usb_audio]
  pc : [&lt;7f0eb22c&gt;]    lr : [&lt;7f0e57fc&gt;]    psr: 200e0193
  sp : a08c9c98  ip : a08c9ce8  fp : a08c9ce4
  r10: 0000000a  r9 : 00000102  r8 : 94cb3000
  r7 : 94cb3000  r6 : 94d0f000  r5 : 94d0e8e8  r4 : 94d0e000
  r3 : 7f0eb21c  r2 : 00000000  r1 : 94cb3000  r0 : 00000000
  Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
  Control: 10c5387d  Table: 31d7c04a  DAC: 00000015
  Process dbus-daemon (pid: 250, stack limit = 0xa08c8238)
  Stack: (0xa08c9c98 to 0xa08ca000)
  ...
  Backtrace:
  [&lt;7f0eb21c&gt;] (retire_capture_urb [snd_usb_audio]) from [&lt;7f0e57fc&gt;] (snd_complete_urb+0x140/0x1f0 [snd_usb_audio])
  [&lt;7f0e56bc&gt;] (snd_complete_urb [snd_usb_audio]) from [&lt;80371118&gt;] (__usb_hcd_giveback_urb+0x78/0xf4)
  [&lt;803710a0&gt;] (__usb_hcd_giveback_urb) from [&lt;80371514&gt;] (usb_giveback_urb_bh+0x8c/0xc0)
  [&lt;80371488&gt;] (usb_giveback_urb_bh) from [&lt;80028e3c&gt;] (tasklet_hi_action+0xc4/0x148)
  [&lt;80028d78&gt;] (tasklet_hi_action) from [&lt;80028358&gt;] (__do_softirq+0x190/0x380)
  [&lt;800281c8&gt;] (__do_softirq) from [&lt;80028858&gt;] (irq_exit+0x8c/0xfc)
  [&lt;800287cc&gt;] (irq_exit) from [&lt;8000ea88&gt;] (handle_IRQ+0x8c/0xc8)
  [&lt;8000e9fc&gt;] (handle_IRQ) from [&lt;800085e8&gt;] (gic_handle_irq+0xbc/0xf8)
  [&lt;8000852c&gt;] (gic_handle_irq) from [&lt;80509044&gt;] (__irq_svc+0x44/0x78)
  [&lt;80508820&gt;] (_raw_spin_unlock_irq) from [&lt;8004b880&gt;] (finish_task_switch+0x5c/0x100)
  [&lt;8004b824&gt;] (finish_task_switch) from [&lt;805052f0&gt;] (__schedule+0x48c/0x6d8)
  [&lt;80504e64&gt;] (__schedule) from [&lt;805055d4&gt;] (schedule+0x98/0x9c)
  [&lt;8050553c&gt;] (schedule) from [&lt;800116c8&gt;] (do_work_pending+0x30/0xd0)
  [&lt;80011698&gt;] (do_work_pending) from [&lt;8000e160&gt;] (work_pending+0xc/0x20)
  Code: e1a0c00d e92ddff0 e24cb004 e24dd024 (e5902008)
  Kernel panic - not syncing: Fatal exception in interrupt

There is a race between retire_capture_urb() and stop_endpoints().
The latter is called at stopping the stream and it sets some endpoint
fields to NULL.  But its call is asynchronous, thus the pending
complete callback might get called after these NULL clears, and it
leads the NULL dereference like the above.

The fix is to move the NULL clearance after the synchronization,
i.e. wait_clear_urbs().  This is called at prepare and hw_free
callbacks, so it's assured to be called before the restart of the
stream or the release of the stream.

Also, while we're at it, put the EP_FLAG_RUNNING flag check at the
beginning of snd_complete_urb() to skip the pending complete after the
stream is stopped.

Fixes: b2eb950de2f0 ("ALSA: usb-audio: stop both data and sync...")
Reported-by: Jiada Wang &lt;jiada_wang@mentor.com&gt;
Reported-by: Mark Craske &lt;Mark_Craske@mentor.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: usb: fine-tune Tenor error compensation value</title>
<updated>2016-08-22T09:40:04Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2016-08-22T06:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36e1ac3cf880fb9dbb528c41ebde567ca17d4a84'/>
<id>urn:sha1:36e1ac3cf880fb9dbb528c41ebde567ca17d4a84</id>
<content type='text'>
Users of devices affected by the Tenor feedback data error report
buffer underruns, even with the +/- 0x1.0000 quirk applied.
Compensating the error with 0xf000 instead seems to reliably fix
that issue.

See

  https://sourceforge.net/p/alsa/mailman/message/35230259/

Reported-and-tested-by: Norman Nolte &lt;norman.nolte@gmx.net&gt;
Reported-and-tested-by: Thomas Gresens &lt;T.Gresens@intershop.de&gt;
Signed-off-by: Daniel Mack &lt;daniel@zonque.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: usb: use TEAC UD-H01 quirk for more devices</title>
<updated>2016-08-22T09:39:56Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2016-08-22T06:53:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca0dd2736a05d1df94c8657b4865f9d6c6637085'/>
<id>urn:sha1:ca0dd2736a05d1df94c8657b4865f9d6c6637085</id>
<content type='text'>
The quirk seems to be necessary not only for TEAC UD-H01 devices, but to
more that are based on the Tenor 8802TL chipset. Devices built by T+A
are affected too, and they apparently all use the same USB PID:PID.

Extend the quirky handling for that device as well, and rename the
quirks flag.

Reported-and-tested-by: Thomas Gresens &lt;T.Gresens@intershop.de&gt;
Signed-off-by: Daniel Mack &lt;daniel@zonque.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
