[alsa-devel] [PATCH 08/16] ALSA: line6: Drop superfluous spinlock for trigger

Chris Rorvick chris at rorvick.com
Tue Jan 27 07:22:48 CET 2015


On Fri, Jan 23, 2015 at 11:13 AM, Takashi Iwai <tiwai at suse.de> wrote:
> The trigger callback is already spinlocked, so we need no more lock
> here (even for the linked substreams).  Let's drop it.

Are they linked?  It doesn't look like they are for my TonePort UX2.
I assumed this is why the trigger lock existed, to synchronize the
trigger callbacks between playback and capture because the group lock
was *not* being acquired.

And the purpose of this synchronization I assumed was to really
synchronize the calls to line6_pcm_acquire/release().  But then
hw_params() and hw_free() are calling into these seemingly without any
lock.

And line6_pcm_acquire/release() are updating line6pcm->flags
atomically, but elsewhere we're just using test_and_set_bit() and
such.

All of this looks racy to me.  Am I missing something?

Finally, what is the point of dispatching through this rather than to
the respective playback/capture callback directly?  Would this come
into play if I was seeing linked substreams?

Sorry, this is way beyond the scope of this patch.  But I've been
spending some time trying to sort this out and haven't answered the
above questions.  If I'm missing anything, a pointer to the relevant
source would be greatly appreciated!

Regards,

Chris


More information about the Alsa-devel mailing list