linux/sound/firewire/dice
Takashi Sakamoto b59fb1900b ALSA: dice: postpone card registration
Some models based on ASIC for Dice II series (STD, CP) change their
hardware configurations after appearing on IEEE 1394 bus. This is due to
interactions of boot loader (RedBoot), firmwares (eCos) and vendor's
configurations. This causes current ALSA dice driver to get wrong
information about the hardware's capability because its probe function
runs just after detecting unit of the model.

As long as I investigated, it takes a bit time (less than 1 second) to load
the firmware after bootstrap. Just after loaded, the driver can get
information about the unit. Then the hardware is initialized according to
vendor's configurations. After, the got information becomes wrong.
Between bootstrap, firmware loading and post configuration, some bus resets
are observed.

This commit offloads most processing of probe function into workqueue and
schedules the workqueue after successive bus resets. This has an effect to
get correct hardware information and avoid involvement to bus reset storm.

For code simplicity, this change effects all of Dice-based models, i.e.
Dice II, Dice Jr., Dice Mini and Dice III.

I use a loose strategy to manage a race condition between the work and the
bus reset. This is due to a specification of dice transaction. When bus
reset occurs, registered address for the transaction is cleared. Drivers
must re-register their own address again. While, this operation is required
for the work because the work includes to wait for the transaction. This
commit uses no lock primitives for the race condition. Instead, checking
'registered' member of 'struct snd_dice' avoid executing the work again.
If sound card is not registered, the work can be scheduled again by bus
reset handler.

When .remove callback is executed, the sound card is going to be released.
The work should not be pending or executed in the releasing. This commit
uses cancel_delayed_work_sync() in .remove callback and wait till the
pending work finished. After .remove callback, .update callback is not
executed, therefore no works are scheduled again.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-06 10:18:53 +01:00
..
dice-hwdep.c ALSA: dice: Split hwdep functionality into a file 2014-11-29 20:08:19 +01:00
dice-interface.h Revert "ALSA: dice: fix wrong offsets for Dice interface" 2015-03-10 15:26:25 +01:00
dice-midi.c ALSA: firewire-lib: move MIDI trigger helper function to AM824 layer 2015-09-29 12:48:49 +02:00
dice-pcm.c ALSA: firewire-lib: rename macros with AM824 prefix 2015-09-29 12:50:23 +02:00
dice-proc.c Revert "ALSA: dice: fix wrong offsets for Dice interface" 2015-03-10 15:26:25 +01:00
dice-stream.c ALSA: dice: correct variable types for __be32 data 2015-10-19 11:57:01 +02:00
dice-transaction.c ALSA: dice: split subaddress check from category check 2016-01-06 10:18:52 +01:00
dice.c ALSA: dice: postpone card registration 2016-01-06 10:18:53 +01:00
dice.h ALSA: dice: postpone card registration 2016-01-06 10:18:53 +01:00
Makefile ALSA: fireworks/bebob/oxfw/dice: enable to make as built-in 2015-10-18 09:08:11 +02:00