On Wed, Jan 8, 2020 at 7:50 PM Marek Szyprowski m.szyprowski@samsung.com wrote:
Fixes: 62d5ae4cafb7 ("ASoC: max98090: save and restore SHDN when changing sensitive registers") Signed-off-by: Marek Szyprowski m.szyprowski@samsung.com
Reviewed-by: Tzung-Bi Shih tzungbi@google.com
Thanks for finding and fixing the bug.
The fix also reminded me: there are two possible "context" to call max98090_dapm_put_enum_double( ): DAPM and userspace mixer control. - max98090_shdn_save( ) is designed for mixer control because it acquires dapm_mutex. - max98090_shdn_save_locked( ) is designed for DAPM without acquiring lock.
Current code:
+static int max98090_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
[snip]
- max98090_shdn_save(max98090);
- ret = snd_soc_dapm_put_enum_double(kcontrol, ucontrol);
- max98090_shdn_restore(max98090);
Should it cause a deadlock if DAPM calls the max98090_dapm_put_enum_double( )? I didn't see a deadlock last time I tested the series. Will do further analysis on this.