aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/dice.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2011-08-27 14:05:15 -0400
committerClemens Ladisch <clemens@ladisch.de>2013-10-20 16:07:57 -0400
commita8c558f6a3eedfb9bfd7d9d82f9d00f2f807ce7c (patch)
treea9227b68ee4e89615c6fb973e94b55a5ec75032a /sound/firewire/dice.c
parent8709f1e4d68b0b3caf9783cf2463e5747943bff8 (diff)
ALSA: dice: fix locking
Avoid a lock inversion between dice->mutex and pcm->open_mutex. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/firewire/dice.c')
-rw-r--r--sound/firewire/dice.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/firewire/dice.c b/sound/firewire/dice.c
index 2d198aed6f94..2d3a04ef9840 100644
--- a/sound/firewire/dice.c
+++ b/sound/firewire/dice.c
@@ -981,12 +981,12 @@ static void dice_remove(struct fw_unit *unit)
981{ 981{
982 struct dice *dice = dev_get_drvdata(&unit->device); 982 struct dice *dice = dev_get_drvdata(&unit->device);
983 983
984 mutex_lock(&dice->mutex);
985
986 amdtp_out_stream_pcm_abort(&dice->stream); 984 amdtp_out_stream_pcm_abort(&dice->stream);
987 985
988 snd_card_disconnect(dice->card); 986 snd_card_disconnect(dice->card);
989 987
988 mutex_lock(&dice->mutex);
989
990 dice_stream_stop(dice); 990 dice_stream_stop(dice);
991 dice_owner_clear(dice); 991 dice_owner_clear(dice);
992 992
@@ -999,8 +999,6 @@ static void dice_bus_reset(struct fw_unit *unit)
999{ 999{
1000 struct dice *dice = dev_get_drvdata(&unit->device); 1000 struct dice *dice = dev_get_drvdata(&unit->device);
1001 1001
1002 mutex_lock(&dice->mutex);
1003
1004 /* 1002 /*
1005 * On a bus reset, the DICE firmware disables streaming and then goes 1003 * On a bus reset, the DICE firmware disables streaming and then goes
1006 * off contemplating its own navel for hundreds of milliseconds before 1004 * off contemplating its own navel for hundreds of milliseconds before
@@ -1011,6 +1009,8 @@ static void dice_bus_reset(struct fw_unit *unit)
1011 */ 1009 */
1012 amdtp_out_stream_pcm_abort(&dice->stream); 1010 amdtp_out_stream_pcm_abort(&dice->stream);
1013 1011
1012 mutex_lock(&dice->mutex);
1013
1014 dice->global_enabled = false; 1014 dice->global_enabled = false;
1015 dice_stream_stop_packets(dice); 1015 dice_stream_stop_packets(dice);
1016 1016