Skip to content

Commit

Permalink
ALSA: dice: fix locking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Richter authored and Clemens Ladisch committed Oct 20, 2013
1 parent 8709f1e commit a8c558f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/firewire/dice.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,12 +981,12 @@ static void dice_remove(struct fw_unit *unit)
{
struct dice *dice = dev_get_drvdata(&unit->device);

mutex_lock(&dice->mutex);

amdtp_out_stream_pcm_abort(&dice->stream);

snd_card_disconnect(dice->card);

mutex_lock(&dice->mutex);

dice_stream_stop(dice);
dice_owner_clear(dice);

Expand All @@ -999,8 +999,6 @@ static void dice_bus_reset(struct fw_unit *unit)
{
struct dice *dice = dev_get_drvdata(&unit->device);

mutex_lock(&dice->mutex);

/*
* On a bus reset, the DICE firmware disables streaming and then goes
* off contemplating its own navel for hundreds of milliseconds before
Expand All @@ -1011,6 +1009,8 @@ static void dice_bus_reset(struct fw_unit *unit)
*/
amdtp_out_stream_pcm_abort(&dice->stream);

mutex_lock(&dice->mutex);

dice->global_enabled = false;
dice_stream_stop_packets(dice);

Expand Down

0 comments on commit a8c558f

Please sign in to comment.