12 Jan, 2017

1 commit

  • commit 4763601a56f155ddf94ef35fc2c41504a2de15f5 upstream.

    The function returns -EINVAL even if it builds the stream properly.
    The bogus error code sneaked in during the code refactoring, but it
    wasn't noticed until now since the returned error code itself is
    ignored in anyway. Kill it here, but there is no behavior change by
    this patch, obviously.

    Fixes: e5779998bf8b ('ALSA: usb-audio: refactor code')
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

15 Nov, 2016

1 commit

  • The usb-audio driver implements the deferred device disconnection for
    the device in use. In this mode, the disconnection callback returns
    immediately while the actual ALSA card object removal happens later
    when all files get closed. As Shuah reported, this code flow,
    however, leads to a use-after-free, detected by KASAN:

    BUG: KASAN: use-after-free in snd_usb_audio_free+0x134/0x160 [snd_usb_audio] at addr ffff8801c863ce10
    Write of size 8 by task pulseaudio/2244
    Call Trace:
    [] dump_stack+0x67/0x94
    [] kasan_object_err+0x21/0x70
    [] kasan_report_error+0x1fa/0x4e0
    [] ? kasan_slab_free+0x87/0xb0
    [] __asan_report_store8_noabort+0x43/0x50
    [] ? snd_usb_audio_free+0x134/0x160 [snd_usb_audio]
    [] snd_usb_audio_free+0x134/0x160 [snd_usb_audio]
    [] snd_usb_audio_dev_free+0x31/0x40 [snd_usb_audio]
    [] __snd_device_free+0x12a/0x210
    [] snd_device_free_all+0x85/0xd0
    [] release_card_device+0x34/0x130
    [] device_release+0x76/0x1e0
    [] kobject_release+0x107/0x370
    .....
    Object at ffff8801c863cc80, in cache kmalloc-2048 size: 2048
    Allocated:
    [] save_stack_trace+0x2b/0x50
    [] save_stack+0x46/0xd0
    [] kasan_kmalloc+0xad/0xe0
    [] kmem_cache_alloc_trace+0xfa/0x240
    [] usb_alloc_dev+0x57/0xc90
    [] hub_event+0xf1d/0x35f0
    ....
    Freed:
    [] save_stack_trace+0x2b/0x50
    [] save_stack+0x46/0xd0
    [] kasan_slab_free+0x71/0xb0
    [] kfree+0xd9/0x280
    [] usb_release_dev+0xde/0x110
    [] device_release+0x76/0x1e0
    ....

    It's the code trying to clear drvdata of the assigned usb_device where
    the usb_device itself was already released in usb_release_dev() after
    the disconnect callback.

    This patch fixes it by checking whether the code path is via the
    disconnect callback, i.e. chip->shutdown flag is set.

    Fixes: 79289e24194a ('ALSA: usb-audio: Refer to chip->usb_id for quirks...')
    Reported-and-tested-by: Shuah Khan
    Cc: # v4.6+
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

18 Jul, 2016

1 commit

  • snd_usb_{set_interface,ctl_msg}_quirk checks chip->usb_id to need
    calling a quirks code. But existed code path that not calling
    dev_set_drvdata in usb_audio_probe.

    Fixes: 79289e24194a ("ALSA: usb-audio: Refer to chip->usb_id for quirks and MIDI creation")
    Signed-off-by: Kazuki Oikawa
    Cc: # v4.6+
    Reviewed-by: Takashi Sakamoto
    Tested-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Kazuki Oikawa
     

10 May, 2016

1 commit


08 May, 2016

1 commit


01 Apr, 2016

1 commit

  • Unfortunately, this patch caused several regressions at au0828 and
    snd-usb-audio, like this one:
    https://bugzilla.kernel.org/show_bug.cgi?id=115561

    It also showed several troubles at the MC core that handles pretty
    poorly the memory protections and data lifetime management.

    So, better to revert it and fix the core before reapplying this
    change.

    This reverts commit aebb2b89bff0 ("[media] sound/usb: Use Media
    Controller API to share media resources")'

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

19 Mar, 2016

1 commit

  • Pull sound updates from Takashi Iwai:
    "After a heavy storm by syzkaller in 4.5 cycle, we have relatively few
    changes in the core at this time while a lot of changes are found in
    the driver side, unsurprisingly. Below are some highlights:

    ALSA core:
    - A few more hardening in ALSA timer codes
    - An extension of sequencer API for advertising the card / pid
    - Small fixes in compress-offload and jack layers

    HD-audio:
    - Dynamic PCM assignment in HDMI/DP codec; preparation for upcoming
    DP-MST support
    - Lots of code refactoring for sharing with ASoC SKL driver
    - Regression fixes for Intel HDMI/DP
    - Fixups for CX20724 codec, Lenovo AiO

    USB-audio:
    - Add quirk_alias option to make quirk debugging easier
    - Fixes for possible Oops by malformed firmware

    Firewire:
    - Add support for FW-1804 in tascam driver
    - Improvements / changes in card registration, multi stream handling,
    etc for DICE
    - Lots of code refactoring

    ASoC:
    - Enhancements of still ongoing topology API
    - Lots of commits for Intel Skylake support including HDMI support
    - A few Intel Atom driver updates for recent devices
    - Lots of improvements to the Renesas drivers
    - Capture support for Qualcomm drivers
    - Support for TI DaVinci DRA7xxx devices
    - New machine drivers for Freescale systems with Cirrus CODECs,
    Mediatek systems with RT5650 CODECs
    - New CPU drivers for Allwinner S/PDIF controllers
    - New CODEC drivers for Maxim MAX9867 and MAX98926 and Realtek RT5514"

    * tag 'sound-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (291 commits)
    ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug
    ALSA: ctl: change return value in compatibility layer so that it's the same value in core implementation
    ALSA: mixart: silence an uninitialized variable warning
    ALSA: usb-audio: Add sanity checks for endpoint accesses
    ALSA: usb-audio: Minor code cleanup in create_fixed_stream_quirk()
    ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()
    ALSA: hda - Limit i915 HDMI binding only for HSW and later
    ALSA: hda - Fix unconditional GPIO toggle via automute
    ALSA: mixart: silence unitialized variable warnings
    ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get_type
    ALSA: intel8x0: Add clock quirk entry for AD1981B on IBM ThinkPad X41.
    ALSA: hda - Add new GPU codec ID 0x10de0082 to snd-hda
    ASoC: rsnd: add simplified module explanation
    ASoC: hdac_hdmi: Add broxton device ID
    ASoC: Intel: Bxtn: Add Broxton PCI ID
    ASoC: Intel: Skylake: Move Skylake dsp ops & loader ops
    ASoC: Intel: add dmabuffer to common sst_dsp
    ASoC: Intel: Skylake: Unstatify skl_dsp_enable_core
    ASoC: Intel: Skylake: Fix whitepsace issues
    ASoC: Intel: Skylake: Move module id defines
    ...

    Linus Torvalds
     

04 Mar, 2016

1 commit

  • Change ALSA driver to use Media Controller API to share media resources
    with DVB and V4L2 drivers on a AU0828 media device. Media Controller
    specific initialization is done after sound card is registered. ALSA
    creates Media interface and entity function graph nodes for Control,
    Mixer, PCM Playback, and PCM Capture devices.

    snd_usb_hw_params() will call Media Controller enable source handler
    interface to request the media resource. If resource request is
    granted, it will release it from snd_usb_hw_free(). If resource is
    busy, -EBUSY is returned.

    Media specific cleanup is done in usb_audio_disconnect().

    Signed-off-by: Shuah Khan
    Acked-by: Takashi Iwai
    Signed-off-by: Mauro Carvalho Chehab

    Shuah Khan
     

29 Jan, 2016

2 commits

  • This patch adds a new option "quirk_alias" to snd-usb-audio driver for
    allowing user to pass the quirk alias list. A quirk alias consists of
    a string form like 0123abcd:5678beef, which makes to apply a quirk to
    a device with USB ID 0123:abcd treated as if it were 5678:beef.
    This feature is useful to test an existing quirk, typically for a
    newer model of the same vendor, without patching / rebuilding the
    kernel driver.

    The current implementation is fairly simplistic: since there is no API
    for matching a usb_device_id to the given ID pair, it has an open code
    to loop over the id table and matches only with vendor:product pair.
    So far, this is OK, as all existing entries are with vendor:product
    pairs, indeed. Once when we have another matching entry, however,
    we'd need to update get_alias_quirk() as well.

    Note that this option is provided only for testing / development. If
    you want to have a proper support, contact to upstream for adding the
    matching quirk in the driver code statically.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • This is a preliminary patch for the later change to allow a better
    quirk ID management. In the current USB-audio code, there are a few
    places looking at usb_device idVendor and idProduct fields directly
    even though we have already a static member in snd_usb_audio.usb_id.
    This patch modifies such codes to refer to the latter field.

    For achieving this, two slightly intensive changes have been done:
    - The snd_usb_audio object is set/reset via dev_getdrv() for the given
    USB device; it's needed for minimizing the changes for some existing
    quirks that take only usb_device object.

    - __snd_usbmidi_create() is introduced to receive the pre-given usb_id
    argument. The exported snd_usbmidi_create() is unchanged by calling
    this new function internally.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

12 Jan, 2016

1 commit

  • ALSA PCM may still have a leftover instance after disconnection and
    it delays its release. The problem is that the PCM close code path of
    USB-audio driver has a call of snd_usb_autosuspend(). This involves
    with the call of usb_autopm_put_interface() and it may lead to a
    kernel Oops due to the NULL object like:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000190
    IP: [] usb_autopm_put_interface+0xf/0x30 PGD 0
    Call Trace:
    [] snd_usb_autosuspend+0x14/0x20
    [] snd_usb_pcm_close.isra.14+0x5c/0x90
    [] snd_usb_playback_close+0xf/0x20
    [] snd_pcm_release_substream.part.36+0x3a/0x90
    [] snd_pcm_release+0xa3/0xb0
    [] snd_disconnect_release+0xd0/0xe0
    [] __fput+0x97/0x1d0
    [] ____fput+0x9/0x10
    [] task_work_run+0x72/0x90
    [] do_exit+0x280/0xa80
    [] do_group_exit+0x3a/0xa0
    [] get_signal+0x1df/0x540
    [] do_signal+0x23/0x620
    [] ? do_readv_writev+0x128/0x200
    [] prepare_exit_to_usermode+0x91/0xd0
    [] syscall_return_slowpath+0x9a/0x120
    [] ? __sys_recvmsg+0x5d/0x70
    [] ? ktime_get_ts64+0x45/0xe0
    [] ? SyS_poll+0x60/0xf0
    [] int_ret_from_sys_call+0x25/0x8f

    We have already a check of disconnection in snd_usb_autoresume(), but
    the check is missing its counterpart. The fix is just to put the same
    check in snd_usb_autosuspend(), too.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109431
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

26 Aug, 2015

3 commits

  • In theory, the device may get suspended even at runtime PM suspend.
    Currently we don't save the mixer state for autopm, and it may bring
    inconsistency.

    This patch removes the special handling for autosuspend.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • We can use active refcount for preventing autopm during probe.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • After the recent fix of runtime PM for USB-audio driver, we got a
    lockdep warning like:

    =============================================
    [ INFO: possible recursive locking detected ]
    4.2.0-rc8+ #61 Not tainted
    ---------------------------------------------
    pulseaudio/980 is trying to acquire lock:
    (&chip->shutdown_rwsem){.+.+.+}, at: [] snd_usb_autoresume+0x1d/0x52 [snd_usb_audio]
    but task is already holding lock:
    (&chip->shutdown_rwsem){.+.+.+}, at: [] snd_usb_autoresume+0x1d/0x52 [snd_usb_audio]

    This comes from snd_usb_autoresume() invoking down_read() and it's
    used in a nested way. Although it's basically safe, per se (as these
    are read locks), it's better to reduce such spurious warnings.

    The read lock is needed to guarantee the execution of "shutdown"
    (cleanup at disconnection) task after all concurrent tasks are
    finished. This can be implemented in another better way.

    Also, the current check of chip->in_pm isn't good enough for
    protecting the racy execution of multiple auto-resumes.

    This patch rewrites the logic of snd_usb_autoresume() & co; namely,
    - The recursive call of autopm is avoided by the new refcount,
    chip->active. The chip->in_pm flag is removed accordingly.
    - Instead of rwsem, another refcount, chip->usage_count, is introduced
    for tracking the period to delay the shutdown procedure. At
    the last clear of this refcount, wake_up() to the shutdown waiter is
    called.
    - The shutdown flag is replaced with shutdown atomic count; this is
    for reducing the lock.
    - Two new helpers are introduced to simplify the management of these
    refcounts; snd_usb_lock_shutdown() increases the usage_count, checks
    the shutdown state, and does autoresume. snd_usb_unlock_shutdown()
    does the opposite. Most of mixer and other codes just need this,
    and simply returns an error if it receives an error from lock.

    Fixes: 9003ebb13f61 ('ALSA: usb-audio: Fix runtime PM unbalance')
    Reported-and-tested-by: Alexnader Kuleshov
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

19 Aug, 2015

1 commit

  • The fix for deadlock in PM in commit [1ee23fe07ee8: ALSA: usb-audio:
    Fix deadlocks at resuming] introduced a new check of in_pm flag.
    However, the brainless patch author evaluated it in a wrong way
    (logical AND instead of logical OR), thus usb_autopm_get_interface()
    is wrongly called at probing, leading to unbalance of runtime PM
    refcount.

    This patch fixes it by correcting the logic.

    Reported-by: Hans Yang
    Fixes: 1ee23fe07ee8 ('ALSA: usb-audio: Fix deadlocks at resuming')
    Cc: [v3.15+]
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

05 Nov, 2014

2 commits

  • This merges the USB-audio disconnect fix and resolves the conflicts
    so that we can continue working on development of usb-audio stuff.

    Conflicts:
    sound/usb/card.c

    Takashi Iwai
     
  • Some USB-audio devices show weird sysfs warnings at disconnecting the
    devices, e.g.
    usb 1-3: USB disconnect, device number 3
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 973 at fs/sysfs/group.c:216 device_del+0x39/0x180()
    sysfs group ffffffff8183df40 not found for kobject 'midiC1D0'
    Call Trace:
    [] ? dump_stack+0x49/0x71
    [] ? warn_slowpath_common+0x82/0xb0
    [] ? warn_slowpath_fmt+0x45/0x50
    [] ? device_del+0x39/0x180
    [] ? device_unregister+0x9/0x20
    [] ? device_destroy+0x34/0x40
    [] ? snd_unregister_device+0x7f/0xd0 [snd]
    [] ? snd_rawmidi_dev_disconnect+0xce/0x100 [snd_rawmidi]
    [] ? snd_device_disconnect+0x62/0x90 [snd]
    [] ? snd_device_disconnect_all+0x3c/0x60 [snd]
    [] ? snd_card_disconnect+0x124/0x1a0 [snd]
    [] ? usb_audio_disconnect+0x88/0x1c0 [snd_usb_audio]
    [] ? usb_unbind_interface+0x5e/0x1b0 [usbcore]
    [] ? __device_release_driver+0x79/0xf0
    [] ? device_release_driver+0x25/0x40
    [] ? bus_remove_device+0xf1/0x130
    [] ? device_del+0x109/0x180
    [] ? usb_disable_device+0x95/0x1f0 [usbcore]
    [] ? usb_disconnect+0x8f/0x190 [usbcore]
    [] ? hub_thread+0x539/0x13a0 [usbcore]
    [] ? sched_clock_local+0x15/0x80
    [] ? sched_clock_cpu+0xb8/0xd0
    [] ? bit_waitqueue+0xb0/0xb0
    [] ? usb_port_resume+0x430/0x430 [usbcore]
    [] ? usb_port_resume+0x430/0x430 [usbcore]
    [] ? kthread+0xce/0xf0
    [] ? kthread_create_on_node+0x1c0/0x1c0
    [] ? ret_from_fork+0x7c/0xb0
    [] ? kthread_create_on_node+0x1c0/0x1c0
    ---[ end trace 40b1928d1136b91e ]---

    This comes from the fact that usb-audio driver may receive the
    disconnect callback multiple times, per each usb interface. When a
    device has both audio and midi interfaces, it gets called twice, and
    currently the driver tries to release resources at the last call.
    At this point, the first parent interface has been already deleted,
    thus deleting a child of the first parent hits such a warning.

    For fixing this problem, we need to call snd_card_disconnect() and
    cancel pending operations at the very first disconnect while the
    release of the whole objects waits until the last disconnect call.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80931
    Reported-and-tested-by: Tomas Gayoso
    Reported-and-tested-by: Chris J Arges
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

04 Nov, 2014

3 commits


06 Aug, 2014

1 commit

  • sound/usb/card.c registers USB suspend and resume but did not previously
    kill the input URBs. This means that USB MIDI devices left open across
    suspend/resume had non-functional input (output still usually worked,
    but it looks like that is another issue). Before this change, we would
    get ESHUTDOWN for each of the input URBs at suspend time, killing input.

    Signed-off-by: Adam Goode
    Signed-off-by: Takashi Iwai

    Adam Goode
     

26 Jun, 2014

1 commit

  • When a USB-audio device is disconnected while PCM is still running, we
    still see some race: the disconnect callback calls
    snd_usb_endpoint_free() that calls release_urbs() and then kfree()
    while a PCM stream would be closed at the same time and calls
    stop_endpoints() that leads to wait_clear_urbs(). That is, the EP
    object might be deallocated while a PCM stream is syncing with
    wait_clear_urbs() with the same EP.

    Basically calling multiple wait_clear_urbs() would work fine, also
    calling wait_clear_urbs() and release_urbs() would work, too, as
    wait_clear_urbs() just reads some fields in ep. The problem is the
    succeeding kfree() in snd_pcm_endpoint_free().

    This patch moves out the EP deallocation into the later point, the
    destructor callback. At this stage, all PCMs must have been already
    closed, so it's safe to free the objects.

    Reported-by: Alan Stern
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

03 May, 2014

2 commits

  • The recent addition of the USB audio mixer suspend/resume may lead to
    deadlocks when the driver tries to call usb_autopm_get_interface()
    recursively, since the function tries to sync with the finish of the
    other calls. For avoiding it, introduce a flag indicating the resume
    operation and avoids the recursive usb_autopm_get_interface() calls
    during the resume.

    Reported-and-tested-by: Bryan Quigley
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The suspend callback of usb-audio driver may be called multiple times
    per suspend when multiple USB interfaces are bound to a single sound
    card instance. In such a case, it's superfluous to save the mixer
    values multiple times. This patch fixes it by checking the counter.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

26 Feb, 2014

1 commit

  • Convert with dev_err() and co from snd_printk(), etc.
    As there are too deep indirections (e.g. ep->chip->dev->dev),
    a few new local macros, usb_audio_err() & co, are introduced.

    Also, the device numbers in some messages are dropped, as they are
    shown in the prefix automatically.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

12 Feb, 2014

1 commit


03 Feb, 2014

1 commit


09 Oct, 2013

1 commit


07 Oct, 2013

1 commit


26 Sep, 2013

1 commit

  • This patch changes the way URBs are allocated and their sizes are
    determined for PCM playback in the snd-usb-audio driver. Currently
    the driver allocates too few URBs for endpoints that don't use
    implicit sync, making underruns more likely to occur. This may be a
    holdover from before I/O delays could be measured accurately; in any
    case, it is no longer necessary.

    The patch allocates as many URBs as possible, subject to four
    limitations:

    The total number of URBs for the endpoint is not allowed to
    exceed MAX_URBS (which the patch increases from 8 to 12).

    The total number of packets per URB is not allowed to exceed
    MAX_PACKS (or MAX_PACKS_HS for high-speed devices), which is
    decreased from 20 to 6.

    The total duration of queued data is not allowed to exceed
    MAX_QUEUE, which is decreased from 24 ms to 18 ms.

    The total number of ALSA frames in the output queue is not
    allowed to exceed the ALSA buffer size.

    The last requirement is the hardest to implement. Currently the
    number of URBs needed to fill a buffer cannot be determined in
    advance, because a buffer contains a fixed number of frames whereas
    the number of frames in an URB varies to match shifts in the device's
    clock rate. To solve this problem, the patch changes the logic for
    deciding how many packets an URB should contain. Rather than using as
    many as possible without exceeding an ALSA period boundary, now the
    driver uses only as many packets as needed to transfer a predetermined
    number of frames. As a result, unless the device's clock has an
    exceedingly variable rate, the number of URBs making up each period
    (and hence each buffer) will remain constant.

    The overall effect of the patch is that playback works better in
    low-latency settings. The user can still specify values for
    frames/period and periods/buffer that exceed the capabilities of the
    hardware, of course. But for values that are within those
    capabilities, the performance will be improved. For example, testing
    shows that a high-speed device can handle 32 frames/period and 3
    periods/buffer at 48 KHz, whereas the current driver starts to get
    glitchy at 64 frames/period and 2 periods/buffer.

    A side effect of these changes is that the "nrpacks" module parameter
    is no longer used. The patch removes it.

    Signed-off-by: Alan Stern
    CC: Clemens Ladisch
    Tested-by: Daniel Mack
    Tested-by: Eldad Zack
    Signed-off-by: Takashi Iwai

    Alan Stern
     

17 Jun, 2013

1 commit

  • When the Android firmware enables the audio interfaces in accessory
    mode, it always declares in the control interface's baInterfaceNr array
    that interfaces 0 and 1 belong to the audio function. However, the
    accessory interface itself, if also enabled, already is at index 0 and
    shifts the actual audio interface numbers to 1 and 2, which prevents the
    PCM streaming interface from being seen by the host driver.

    To get the PCM interface interface to work, detect when the descriptors
    point to the (for this driver useless) accessory interface, and redirect
    to the correct one.

    Reported-by: Jeremy Rosen
    Tested-by: Jeremy Rosen
    Cc:
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

25 Apr, 2013

1 commit

  • We've got strange errors in get_ctl_value() in mixer.c during
    probing, e.g. on Hercules RMX2 DJ Controller:

    ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4
    ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
    ....

    It turned out that the culprit is autopm: snd_usb_autoresume() returns
    -ENODEV when called during card->probing = 1.

    Since the call itself during card->probing = 1 is valid, let's fix the
    return value of snd_usb_autoresume() as success.

    Reported-and-tested-by: Daniel Schürmann
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

04 Apr, 2013

3 commits


12 Mar, 2013

1 commit

  • The NuForce UDH-100 numbers its interfaces incorrectly, which makes the
    interface associations come out wrong, which results in the driver
    erroring out with the message "Audio class v2 interfaces need an
    interface association".

    Work around this by searching for the interface association descriptor
    also in some other place where it might have ended up.

    Reported-and-tested-by: Dave Helstroom
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

29 Jan, 2013

1 commit


21 Nov, 2012

1 commit


14 Nov, 2012

1 commit

  • The recent change for USB-audio disconnection race fixes introduced a
    mutex deadlock again. There is a circular dependency between
    chip->shutdown_rwsem and pcm->open_mutex, depicted like below, when a
    device is opened during the disconnection operation:

    A. snd_usb_audio_disconnect() ->
    card.c::register_mutex ->
    chip->shutdown_rwsem (write) ->
    snd_card_disconnect() ->
    pcm.c::register_mutex ->
    pcm->open_mutex

    B. snd_pcm_open() ->
    pcm->open_mutex ->
    snd_usb_pcm_open() ->
    chip->shutdown_rwsem (read)

    Since the chip->shutdown_rwsem protection in the case A is required
    only for turning on the chip->shutdown flag and it doesn't have to be
    taken for the whole operation, we can reduce its window in
    snd_usb_audio_disconnect().

    Reported-by: Jiri Slaby
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

30 Oct, 2012

1 commit