kernel_optimize_test/sound/usb
Takashi Iwai d75a170fd8 ALSA: usb-audio: Fix UAC2/3 effect unit parsing
We've got a regression report about M-Audio Fast Track C400 device,
and the git bisection resulted in the commit e0ccdef926 ("ALSA:
usb-audio: Clean up check_input_term()").  This commit was about the
rewrite of the input terminal parser, and it's not too obvious from
the change what really broke.  The answer is: it's the interpretation
of UAC2/3 effect units.

In the original code, UAC2 effect unit is as if through UAC1
processing unit because both UAC1 PU and UAC2/3 EU share the same
number (0x07).  The old code went through a complex switch-case
fallthrough, finally bailing out in the middle:

  if (protocol == UAC_VERSION_2 &&
      hdr[2] == UAC2_EFFECT_UNIT) {
         /* UAC2/UAC1 unit IDs overlap here in an
          * uncompatible way. Ignore this unit for now.
          */
         return 0;
   }

... and this special handling was missing in the new code; the new
code treats UAC2/3 effect unit as if it were equivalent with the
processing unit.

Actually, the old code was too confusing.  The effect unit has an
incompatible unit description with the processing unit, so we
shouldn't have dealt with EU in the same way.

This patch addresses the regression by changing the effect unit
handling to the own parser function.  The own parser function makes
the clear distinct with PU, so it improves the readability, too.

The EU parser just sets the type and the id like the old kernels.
Once when the proper effect unit support is added, we can revisit this
parser function, but for now, let's keep this simple setup as is.

Fixes: e0ccdef926 ("ALSA: usb-audio: Clean up check_input_term()")
Cc: <stable@vger.kernel.org>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206147
Link: https://lore.kernel.org/r/20200211160521.31990-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-11 17:06:16 +01:00
..
6fire ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
bcd2000 ALSA: bcd2000: More constifications 2020-01-05 16:14:49 +01:00
caiaq ALSA: caiaq: More constifications 2020-01-05 16:14:37 +01:00
hiface ALSA: usb: Drop superfluous ioctl PCM ops 2019-12-11 07:25:34 +01:00
line6 ALSA: line6: Constify snd_ratden definitions 2020-01-03 09:24:40 +01:00
misc ALSA: usb: Drop superfluous ioctl PCM ops 2019-12-11 07:25:34 +01:00
usx2y ALSA: usx2y: More constifications 2020-01-05 16:14:47 +01:00
card.c ALSA: usb-audio: unlock on error in probe 2020-01-15 20:26:09 +01:00
card.h ALSA: usb-audio: set the interface format after resume on Dell WD19 2019-12-18 20:04:37 +01:00
clock.c ALSA: usb-audio: sound: usb: usb true/false for bool return type 2019-10-30 08:46:33 +01:00
clock.h
debug.h
endpoint.c ALSA: usb-audio: not submit urb for stopped endpoint 2019-11-13 10:49:31 +01:00
endpoint.h
format.c ALSA: usb-audio: Apply 48kHz fixed rate playback for Jabra Evolve 65 headset 2020-02-11 12:17:06 +01:00
format.h
helper.c ALSA: usb-audio: Fix gpf in snd_usb_pipe_sanity_check 2019-07-30 12:32:21 +02:00
helper.h ALSA: usb-audio: More validations of descriptor units 2019-08-22 10:35:59 +02:00
Kconfig sound: Fix Kconfig indentation 2019-10-07 03:53:03 +02:00
Makefile Merge branch 'topic/usb-validation' into for-next 2019-08-22 15:42:03 +02:00
media.c
media.h
midi.c ALSA: usb-audio: Use lower hex numbers for IDs 2020-01-05 09:20:44 +01:00
midi.h
mixer_maps.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
mixer_quirks.c ALSA: usb: update old-style static const declaration 2020-01-12 09:45:17 +01:00
mixer_quirks.h
mixer_scarlett_gen2.c ALSA: usb-audio: Annotate endianess in Scarlett gen2 quirk 2020-02-01 09:06:24 +01:00
mixer_scarlett_gen2.h ALSA: usb-audio: Scarlett Gen 2 mixer interface 2019-07-28 17:47:48 +02:00
mixer_scarlett.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
mixer_scarlett.h
mixer_us16x08.c ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
mixer_us16x08.h ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
mixer.c ALSA: usb-audio: Fix UAC2/3 effect unit parsing 2020-02-11 17:06:16 +01:00
mixer.h ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
pcm.c Merge branch 'for-linus' into for-next 2020-01-20 11:44:51 +01:00
pcm.h
power.c ALSA: usb-audio: More validations of descriptor units 2019-08-22 10:35:59 +02:00
power.h
proc.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
proc.h
quirks-table.h ALSA: usb-audio: set the interface format after resume on Dell WD19 2019-12-18 20:04:37 +01:00
quirks.c ALSA: usb-audio: Add boot quirk for MOTU M Series 2020-01-13 10:47:56 +01:00
quirks.h ALSA: usb-audio: Add boot quirk for MOTU M Series 2020-01-13 10:47:56 +01:00
stream.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
stream.h
usbaudio.h ALSA: usb-audio: set the interface format after resume on Dell WD19 2019-12-18 20:04:37 +01:00
validate.c ALSA: usb-audio: Fix endianess in descriptor validation 2020-02-01 09:06:11 +01:00