ALSA: hda/tas2781: add lock to system_suspend
authorGergo Koteles <soyer@irl.hu>
Fri, 8 Mar 2024 17:41:41 +0000 (18:41 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 11 Mar 2024 08:14:39 +0000 (09:14 +0100)
Add the missing lock around tasdevice_tuning_switch().

Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Message-ID: <c666da13d4bc48cd1ab1357479e0c6096541372c.1709918447.git.soyer@irl.hu>

sound/pci/hda/tas2781_hda_i2c.c

index ee3e0afc9b31335aef436079ed35c0de81886a4b..750e49fbb91e5e3af10cef75e3efb2548ade8e9e 100644 (file)
@@ -885,9 +885,13 @@ static int tas2781_system_suspend(struct device *dev)
        if (ret)
                return ret;
 
+       mutex_lock(&tas_hda->priv->codec_lock);
+
        /* Shutdown chip before system suspend */
        tasdevice_tuning_switch(tas_hda->priv, 1);
 
+       mutex_unlock(&tas_hda->priv->codec_lock);
+
        /*
         * Reset GPIO may be shared, so cannot reset here.
         * However beyond this point, amps may be powered down.