Commit a8c558f6 authored by Stefan Richter's avatar Stefan Richter Committed by Clemens Ladisch

ALSA: dice: fix locking

Avoid a lock inversion between dice->mutex and pcm->open_mutex.
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent 8709f1e4
...@@ -981,12 +981,12 @@ static void dice_remove(struct fw_unit *unit) ...@@ -981,12 +981,12 @@ static void dice_remove(struct fw_unit *unit)
{ {
struct dice *dice = dev_get_drvdata(&unit->device); struct dice *dice = dev_get_drvdata(&unit->device);
mutex_lock(&dice->mutex);
amdtp_out_stream_pcm_abort(&dice->stream); amdtp_out_stream_pcm_abort(&dice->stream);
snd_card_disconnect(dice->card); snd_card_disconnect(dice->card);
mutex_lock(&dice->mutex);
dice_stream_stop(dice); dice_stream_stop(dice);
dice_owner_clear(dice); dice_owner_clear(dice);
...@@ -999,8 +999,6 @@ static void dice_bus_reset(struct fw_unit *unit) ...@@ -999,8 +999,6 @@ static void dice_bus_reset(struct fw_unit *unit)
{ {
struct dice *dice = dev_get_drvdata(&unit->device); struct dice *dice = dev_get_drvdata(&unit->device);
mutex_lock(&dice->mutex);
/* /*
* On a bus reset, the DICE firmware disables streaming and then goes * On a bus reset, the DICE firmware disables streaming and then goes
* off contemplating its own navel for hundreds of milliseconds before * off contemplating its own navel for hundreds of milliseconds before
...@@ -1011,6 +1009,8 @@ static void dice_bus_reset(struct fw_unit *unit) ...@@ -1011,6 +1009,8 @@ static void dice_bus_reset(struct fw_unit *unit)
*/ */
amdtp_out_stream_pcm_abort(&dice->stream); amdtp_out_stream_pcm_abort(&dice->stream);
mutex_lock(&dice->mutex);
dice->global_enabled = false; dice->global_enabled = false;
dice_stream_stop_packets(dice); dice_stream_stop_packets(dice);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment