Skip to content

Commit

Permalink
ALSA: firewire-speakers: fix locking
Browse files Browse the repository at this point in the history
There is a lock inversion between fwspk->mutex and pcm->open_mutex
reported by lockdep when fwspk_hw_free is called.

Fixed by copying the fix from the same former issue in the isight
sound driver (commit f3f7c18
"ALSA: isight: fix locking").

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Stefan Richter authored and Takashi Iwai committed Oct 4, 2011
1 parent bb690c9 commit a0978e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/firewire/speakers.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,10 @@ static int __devexit fwspk_remove(struct device *dev)
{
struct fwspk *fwspk = dev_get_drvdata(dev);

mutex_lock(&fwspk->mutex);
amdtp_out_stream_pcm_abort(&fwspk->stream);
snd_card_disconnect(fwspk->card);

mutex_lock(&fwspk->mutex);
fwspk_stop_stream(fwspk);
mutex_unlock(&fwspk->mutex);

Expand All @@ -796,8 +797,8 @@ static void fwspk_bus_reset(struct fw_unit *unit)
fcp_bus_reset(fwspk->unit);

if (cmp_connection_update(&fwspk->connection) < 0) {
mutex_lock(&fwspk->mutex);
amdtp_out_stream_pcm_abort(&fwspk->stream);
mutex_lock(&fwspk->mutex);
fwspk_stop_stream(fwspk);
mutex_unlock(&fwspk->mutex);
return;
Expand Down

0 comments on commit a0978e8

Please sign in to comment.