898dfe4687
The aloop driver tries to update the hw constraints of the connected
target on the cable of the opened PCM substream. This is done by
adding the extra hw constraints rules referring to the substream
runtime->hw fields, while the other substream may update the runtime
hw of another side on the fly.
This is, however, racy and may result in the inconsistent values when
both PCM streams perform the prepare concurrently. One of the reason
is that it overwrites the other's runtime->hw field; which is not only
racy but also broken when it's called before the open of another side
finishes. And, since the reference to runtime->hw isn't protected,
the concurrent write may give the partial value update and become
inconsistent.
This patch is an attempt to fix and clean up:
- The prepare doesn't change the runtime->hw of other side any longer,
but only update the cable->hw that is referred commonly.
- The extra rules refer to the loopback_pcm object instead of the
runtime->hw. The actual hw is deduced from cable->hw.
- The extra rules take the cable_lock to protect against the race.
Fixes:
|
||
---|---|---|
.. | ||
mpu401 | ||
opl3 | ||
opl4 | ||
pcsp | ||
vx | ||
Kconfig | ||
Makefile | ||
aloop.c | ||
dummy.c | ||
ml403-ac97cr.c | ||
mtpav.c | ||
mts64.c | ||
pcm-indirect2.c | ||
pcm-indirect2.h | ||
portman2x4.c | ||
serial-u16550.c | ||
virmidi.c |