From: Stefan Richter Date: Sat, 27 Aug 2011 14:45:28 +0000 (+0200) Subject: ALSA: firewire-speakers: fix locking X-Git-Tag: firefly_0821_release~3680^2~4182^2~23^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a0978e8039f1b1bfb9fbc68f682b14313bb4f9ad;p=firefly-linux-kernel-4.4.55.git ALSA: firewire-speakers: fix locking 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 f3f7c1837f6bcae3601fc535b339426868bf1549 "ALSA: isight: fix locking"). Signed-off-by: Stefan Richter Signed-off-by: Clemens Ladisch Signed-off-by: Takashi Iwai --- diff --git a/sound/firewire/speakers.c b/sound/firewire/speakers.c index 3fc257da180c..cbe6bb9e53b6 100644 --- a/sound/firewire/speakers.c +++ b/sound/firewire/speakers.c @@ -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); @@ -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;