Hi,
This patchset updates my previous post. [alsa-devel] [PATCH 0/4 v2] ALSA: dice: improve card registration processing http://mailman.alsa-project.org/pipermail/alsa-devel/2015-December/102460.ht...
The previous patchset includes some bugs. * Mutex structure can be destroyed within critical section with it in releasing sound card. * Bus reset handler doesn't execute transaction re-initialization as long as sound card instance is not registered. * Work of sound card registration is not postpone even if bus reset occurs. * Devices in sound card are not released when sound card registration fails.
This version fixes these bugs, according to discussions between Takash Iwai and Stefan Richter. Thanks for them.
Changes: * Use delayed workqueue API correctly. * Wait for registration work in .remove callback, instead of sound card free callback. * Obsolete mutex_lock()/mutex_unlock() for sound card registration purpose. * Keep devices of sound card and release them at registration failure.
In kerneldoc of 'mod_delayed_work', this function call has a side effect to queueing the work. It seems that this function can be used instead of schedule_delayed_work. https://www.kernel.org/doc/htmldocs/device-drivers/API-mod-delayed-work.html
But as long as I tested, my Linux 4.2 system is freezed. I have no further investigation. I use both of schedule_delayed_work() and mod_delayed_work() in this patchset.
Takashi Sakamoto (5): ALSA: dice: split subaddress check from category check ALSA: dice: postpone card registration ALSA: dice: ensure to release sound devices after sound card registration fails ALSA: dice: purge transaction initialization at timeout of Dice notification ALSA: dice: expand timeout to wait for Dice notification
sound/firewire/dice/dice-midi.c | 2 + sound/firewire/dice/dice-pcm.c | 2 + sound/firewire/dice/dice-transaction.c | 122 ++++++++++++-------- sound/firewire/dice/dice.c | 199 +++++++++++++++++---------------- sound/firewire/dice/dice.h | 5 + 5 files changed, 191 insertions(+), 139 deletions(-)