From: Gergo Koteles Date: Fri, 8 Mar 2024 17:41:41 +0000 (+0100) Subject: ALSA: hda/tas2781: add lock to system_suspend X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c58e6ed55a1bb9811d6d936d001b068bb0419467;p=linux.git ALSA: hda/tas2781: add lock to system_suspend Add the missing lock around tasdevice_tuning_switch(). Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Signed-off-by: Gergo Koteles Signed-off-by: Takashi Iwai Message-ID: --- diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index ee3e0afc9b313..750e49fbb91e5 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -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.