aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: snd-usb-us122l: Delete calls to preempt_disableKarsten Wiese2012-01-251-4/+2
| | | | | | | | | | | commit d0f3a2eb9062560bebca8b923424f3ca02a331ba upstream. They are not needed here. Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: usb-audio - Fix the missing volume quirks at delayed initTakashi Iwai2011-11-211-50/+59
| | | | | | | | | | | | | | | | | | | commit dcaaf9f2c16b56f8bb316881fcd3f15c18fc71e7 upstream. In the recent usb-audio driver, the initialization of volume ranges may be delayed when the device doesn't respond well at the probing time. But the volume quirks for certain devices are applied only in mixer_ctl_feature_info() thus only at the very first probe and will be missing when the volume range is initialized later. This patch moves the volume quirk code to be always called from the volume-range extraction (get_min_max()), so that the quirks are properly applied in the later init time. Reported-and-tested-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: usb-audio - Check the dB-range validity in the later read, tooTakashi Iwai2011-11-211-2/+11
| | | | | | | | | | | | commit 9fcd0ab130579d9742538340edda3225f2b49a3e upstream. When the initial check of dB-range failed due to the read error, try to check again at the later read, too. When an invalid dB range is found, remove TLV flags and notify the mixer info change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: ua101: fix crash when unpluggingClemens Ladisch2011-11-111-7/+21
| | | | | | | | | | | | | | | | | | commit 862a6244eb9f9f5123fe819454fcfcae0ee1f2f9 upstream. If the device is unplugged while running, it is possible for a PCM device to be closed after the disconnect callback has returned. This means that kill_stream_urb() and disable_iso_interface() would try to access already-invalid or freed USB data structures. The function free_usb_related_resources() was intended to prevent this, but forgot to clear the affected variables. Reported-and-tested-by: Olivier Courtay <olivier@courtay.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: usb-audio: Check for possible chip NULL pointer before clearing ↵Thomas Pfaff2011-10-031-3/+5
| | | | | | | | | | | | | | probing flag commit 61a6a108d15213f5ee06332e1e7766d3860e4453 upstream. Before clearing the probing flag in the error exit path, check that the chip pointer is not NULL. Signed-off-by: Thomas Pfaff <tpfaff@gmx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: usb-audio - clear chip->probing on error exitThomas Pfaff2011-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 362e4e49abe53e89d87455dfcd7c1bbaf08a839d upstream. The Terratec Aureon 5.1 USB sound card support is broken since kernel 2.6.39. 2.6.39 introduced power management support for USB sound cards that added a probing flag in struct snd_usb_audio. During the probe of the card it gives following error message : usb 7-2: new full speed USB device number 2 using uhci_hcd cannot find UAC_HEADER snd-usb-audio: probe of 7-2:1.3 failed with error -5 input: USB Audio as /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.3/input/input6 generic-usb 0003:0CCD:0028.0001: input: USB HID v1.00 Device [USB Audio] on usb-0000:00:1d.1-2/input3 I can not comment about that "cannot find UAC_HEADER" error, but until 2.6.38 the card worked anyway. With 2.6.39 chip->probing remains 1 on error exit, and any later ioctl stops in snd_usb_autoresume with -ENODEV. Signed-off-by: Thomas Pfaff <tpfaff@gmx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: snd_usb_caiaq: track submitted output urbsDaniel Mack2011-08-292-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | commit da6094ea7d3c2295473d8f5134279307255d6ebf upstream. The snd_usb_caiaq driver currently assumes that output urbs are serviced in time and doesn't track when and whether they are given back by the USB core. That usually works fine, but due to temporary limitations of the XHCI stack, we faced that urbs were submitted more than once with this approach. As it's no good practice to fire and forget urbs anyway, this patch introduces a proper bit mask to track which requests have been submitted and given back. That alone however doesn't make the driver work in case the host controller is broken and doesn't give back urbs at all, and the output stream will stop once all pre-allocated output urbs are consumed. But it does prevent crashes of the controller stack in such cases. See http://bugzilla.kernel.org/show_bug.cgi?id=40702 for more details. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: Matej Laitl <matej@laitl.cz> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: usb-audio - Fix missing mixer dB informationTakashi Iwai2011-08-291-1/+2
| | | | | | | | | | | | | | | | | commit 38b65190c6ab0be8ce7cff69e734ca5b5e7fa309 upstream. The recent fix for testing dB range at the mixer creation time seems to cause regressions in some devices. In such devices, reading the dB info at probing time gives an error, thus both dBmin and dBmax are still zero, and TLV flag isn't set although the later read of dB info succeeds. This patch adds a workaround for such a case by assuming that the later read will succeed. In future, a similar test should be performed in a case where a wrong dB range is seen even in the later read. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: snd-usb-caiaq: Correct offset fields of outbound iso_frame_descDaniel Mack2011-08-171-2/+4
| | | | | | | | | | | | | | | | commit 15439bde3af7ff88459ea2b5520b77312e958df2 upstream. This fixes faulty outbount packets in case the inbound packets received from the hardware are fragmented and contain bogus input iso frames. The bug has been there for ages, but for some strange reasons, it was only triggered by newer machines in 64bit mode. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: William Light <wrl@illest.net> Reported-by: Pedro Ribeiro <pedrib@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: snd-usb: Accept UAC2 FORMAT_TYPE descriptors with bLength > 6Clemens Ladisch2011-08-151-1/+1
| | | | | | | | | | | | | | commit 824818b148db42173446707df4cbd61cd7133272 upstream. The Focusrite Scarlett 18i6 USB has them that way, which is probably a bug. Anyway, the driver should simply ignore this fact. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Nicolai Krakowiak <nicolai.krakowiak@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: snd-usb: operate on given mixer interface onlyDaniel Mack2011-08-152-12/+9
| | | | | | | | | | | | | | | | | commit 1faa5d07a93fc5b0a4a5254fc940a79e20b55540 upstream. When creating the mixers for an USB audio device, the current code looks at the host interface stored in mixer->chip->ctrl_if. Change this and rather keep a local pointer to the interface that was given when snd_usb_create_mixer() was called. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Nicolai Krakowiak <nicolai.krakowiak@gmail.com> Reported-by: Lean-Yves LENHOF <jean-yves@lenhof.eu.org> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: snd-usb: avoid dividing by zero on invalid inputNicolai Krakowiak2011-08-151-0/+5
| | | | | | | | | | | commit 60c961a9e1ed879a4d151df6076bf1203f595f73 upstream. Signed-off-by: Nicolai Krakowiak <nicolai.krakowiak@gmail.com> Acked-by: Daniel Mack <zonque@gmail.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: snd-usb-caiaq: Fix keymap for RigKontrol3Daniel Mack2011-08-151-1/+1
| | | | | | | | | | commit f4389489b5cbe60b3441869c68bb4afe760969c4 upstream. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Renato <naretobh@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ALSA: 6fire - Fix signedness bugTorsten Schenk2011-06-161-2/+2
| | | | | | | | | | Fixed remaining issues of the signedness bug discovered by Dan Carpenter. A check was remaining that tests if unsigned rt->rate is >= 0. Changed that so that rt->rate now consistently uses ARRAY_SIZE(rates) as invalid rate value and not -1. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: 6fire: Fix double-free bug in usb6fire_fw_ezusb_upload()Jesper Juhl2011-06-141-1/+0
| | | | | | | | | | | We have a double-free bug in sound/usb/6fire/firmware.c::usb6fire_fw_ezusb_upload(). We already call release_firmware(fw) on line 258, so when we then do it again after usb6fire_fw_ezusb_write() returns <0, we have a double-free. Easily fixed by just removing the last call to release_firmware(). Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb - turn off de-emphasis in s/pdif for cm6206Eric Lammerts2011-06-031-1/+1
| | | | | | | CM6206: Turn off de-emphasis channel status bit in S/PDIF output. Signed-off-by: Eric Lammerts <eric@lammerts.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: 6fire: Don't leak firmware in error pathJesper Juhl2011-06-021-0/+1
| | | | | | | | | | One of the error paths in sound/usb/6fire/firmware.c::usb6fire_fw_ezusb_upload() neglects to free the memory allocated for the firmware before returning, thus leaking the memory. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: more control quirks for M-Audio FastTrack devicesDaniel Mack2011-05-252-2/+72
| | | | | | | | | | Make use of the freshly introduced methods to re-use standard mixer handling and add some controls that are hidden but implemented in a standard conform way on M-Audio's FastTrack devices. Signed-off-by: Daniel Mack <zonque@gmail.com> Original-code-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: add new quirk type QUIRK_AUDIO_STANDARD_MIXERDaniel Mack2011-05-252-1/+17
| | | | | | | | | This quirk type will let the driver assume that there is a standard mixer on a given interface, or that a specific mixer quirks will handle the device. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: export snd_usb_feature_unit_ctlDaniel Mack2011-05-254-11/+15
| | | | | | | | | | | | In order to allow quirks functions to hook up to the standard feature unit op tables, this patch exports a pointer to the struct that is used internally. That way, all the code handling the control can be kept private, and external code can reference the symbol to re-use it. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: rework add_control_to_empty()Daniel Mack2011-05-252-9/+13
| | | | | | | | | | | | This patch renames add_control_to_empty() to snd_usb_mixer_add_control() and exports it, so the quirks functions can make use of it. Also, as "struct mixer_build" is private to mixer.c, rewrite the function to take an argument of type "struct usb_mixer_interface" instead. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: move assignment of chip->ctrl_intfDaniel Mack2011-05-251-8/+8
| | | | | | | This is needed for upcoming changes to the quirks mechanism. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/misc' into for-linusTakashi Iwai2011-05-2212-113/+273
|\
| * ALSA: usb-audio - Add support for USB X-Fi S51 ProMathieu Bouffard2011-05-181-0/+12
| | | | | | | | | | | | | | | | USB X-Fi S51 Pro volume and mute from the volume knob on the unit. Compiled and tested with 2.6.39-rc7-git12 Signed-off-by: Mathieu Bouffard <mbouffard@strangequarks.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: handle "Fast Track Ultra" with USB_DEVICE_VENDOR_SPEC()Daniel Mack2011-05-181-2/+2
| | | | | | | | | | | | | | | | That way, the class compliant MIDI interface is also handled. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: Grant Diffey <gdiffey@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: assume valid clockDaniel Mack2011-05-181-1/+10
| | | | | | | | | | | | | | | | | | If the interface can't report a clock's validity, assume that it's valid. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Vicente Joel <vicentejoel@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: add quirks for Roland GR-55Daniel Mack2011-05-181-0/+26
| | | | | | | | | | | | Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Jeffrey Scott Flesher <jeffrey.scott.flesher@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: Add quirk for KORG PANDORA PX5D MIDI interfaceDaniel Mack2011-05-181-0/+11
| | | | | | | | | | | | Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: Frédéric Jaume <frederic.jaume@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: remove invalid extra mixers for Komplete Audio 6Daniel Mack2011-05-183-19/+2
| | | | | | | | | | | | | | | | | | | | This was a flaw in the reading of the spec tables - Native Instrument's "Komplete Audio 6" device has no such extra controls. This patch also fixes the device name in two comments. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: include format.h in format.cDaniel Mack2011-05-181-0/+1
| | | | | | | | | | | | | | | | Just in case a prototype changes, we'll be warned. This also fixes a sparse warning. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not setDaniel Mack2011-05-181-1/+1
| | | | | | | | | | | | | | | | | | Just defining it to nothing is dangerous as it can alter the code execution flow, for example when used in as only function in a conditional code block. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio - Don't expose broken dB rangesTakashi Iwai2011-04-281-4/+6
| | | | | | | | | | | | | | | | | | Some crappy USB-audio devices give broken dB ranges, e.g. both min and max are 0dB. This confuses the volume control that prefers dB expression such as alsactl or PulseAudio. In such a case, it's much better not to expose the broken dB information. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: 6fire: use the kernel's built-in bit reverse tableDaniel Mack2011-04-262-27/+3
| | | | | | | | | | | | Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: Add quirks for Audio Kontrol 6Daniel Mack2011-04-143-0/+24
| | | | | | | | | | | | | | | | | | | | | | This new device by Native Instruments is also compliant to the USB standard v2.0, but hides this detail at when connected. It needs the same boot quirks than other models, and also has two non-class-compliant mixer controls. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: 6fire - Add support of digital-thru mixerTorsten Schenk2011-04-043-47/+137
| | | | | | | | | | | | | | Digital Thru mixer element added (device can act as converter optical<->coax) Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: 6fire - Improve firmware loaderTorsten Schenk2011-04-041-13/+31
| | | | | | | | | | | | | | | | | | Firmware loader: magical device bytes check updated (accepts all device versions now and accepts possibly loaded firmware, if it is knowing to be working) Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: 6fire - Add support for S32_LE formatTorsten Schenk2011-04-041-4/+18
| | | | | | | | | | | | | | Added support for sample format s32_le. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: 6fire - Fix pcm rate assignmentTorsten Schenk2011-04-041-8/+5
| | | | | | | | | | | | | | | | Completion of signedness bug for pcm_runtime.rate: variable will never get assigned a negative value now. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: 6fire - Update kernel configurationTorsten Schenk2011-04-041-6/+3
| | | | | | | | | | | | | | | | | | Kernel configuration updated: - experimental dependency removed - description updated Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: usb-audio - Terratec Aureon 7.1 USB ID as C-Media cm6206 quirksWolfgang Breyha2011-04-282-1/+4
| | | | | | | | | | | | | | | | This patch adds support for the Terratec Aureon 7.1 USB which uses a C-Media cm6206 and needs all the quirks already found in the past. Signed-off-by: Wolfgang Breyha <wbreyha@gmx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'for-linus' of ↵Linus Torvalds2011-04-101-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: hda - Don't query connections for widgets have no connections ALSA: HDA: Fix single internal mic on ALC275 (Sony Vaio VPCSB1C5E) ALSA: hda - HDMI: Fix MCP7x audio infoframe checksums ALSA: usb-audio: define another USB ID for a buggy USB MIDI cable ALSA: HDA: Fix dock mic for Lenovo X220-tablet ASoC: format_register_str: Don't clip register values ASoC: PXA: Fix oops in __pxa2xx_pcm_prepare ASoC: zylonite: set .codec_dai_name in initializer
| * | ALSA: usb-audio: define another USB ID for a buggy USB MIDI cableTarek Soliman2011-04-061-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | There are many USB MIDI cables out there that have buggy firmware that reports it can do more than 4 bytes in a packet when they can only properly handle 4 This patch adds the ID of yet another one of those cables Signed-off-by: Tarek Soliman <tarek@bashasoliman.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Fix common misspellingsLucas De Marchi2011-03-314-6/+6
|/ | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* ALSA: usb-audio - Support for Boss JS-8 Jam StationKeith A. Milner2011-03-231-0/+27
| | | | | Signed-off-by: Keith A. Milner <maillist@superlative.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: add Cakewalk UM-1G supportClemens Ladisch2011-03-231-0/+13
| | | | | | | | Add a quirk for the Cakewalk UM-1G USB MIDI interface in "advanced driver" mode. (It already works in standard mode.) Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb - Remove trailing spaces from USB card name stringsTakashi Iwai2011-03-211-4/+18
| | | | | | | | | Some USB devices give trailing spaces in strings returned from usb_string(). This confuses the automatic card-id creation, resulting always in "default". This patch fixes the behavior by removing trailing spaces. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usbaudio: implement USB autosuspendOliver Neukum2011-03-116-22/+118
| | | | | | | | | | | | Devices are autosuspended if no pcm nor midi channel is open Mixer devices may be opened. This way they are active when in use to play or record sound, but can be suspended while users have a mixer application running. [Small clean-ups using static inline by tiwai] Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usbaudio: fix suspend/resumeOliver Neukum2011-03-113-3/+34
| | | | | | | | - ESHUTDOWN must be correctly handled - the optional interrupt endpoint's URB must be stopped and restarted Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'fix/misc' into topic/miscTakashi Iwai2011-03-118-7/+23
|\
| * ALSA: usb-audio: fix oops due to cleanup race when disconnectingTakashi Iwai2011-02-233-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a USB audio device is disconnected, snd_usb_audio_disconnect() kills all audio URBs. At the same time, the application, after being notified of the disconnection, might close the device, in which case ALSA calls the .hw_free callback, which should free the URBs too. Commit de1b8b93a0ba "[ALSA] Fix hang-up at disconnection of usb-audio" prevented snd_usb_hw_free() from freeing the URBs to avoid a hang that resulted from this race, but this introduced another race because the URB callbacks could now be executed after snd_usb_hw_free() has returned, and try to access already freed data. Fix the first race by introducing a mutex to serialize the disconnect callback and all PCM callbacks that manage URBs (hw_free and hw_params). Reported-and-tested-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com> Cc: <stable@kernel.org> [CL: also serialize hw_params callback] Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>