Skip to contentSkip to conversation

sound fixes for 5.2-rc1

GIT PULL Merged Takashi Iwai 2 participants 2 messages May 17, 2019 Sound

lore
Share & tools
lore
#0 lore raw

Linus,

please pull sound fixes for v5.2-rc1 from:

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-fix-5.2-rc1

The topmost commit is 56df90b631fc027fe28b70d41352d820797239bb

----------------------------------------------------------------

sound fixes for 5.2-rc1

Just a few HD-audio fixes, most of which are specific to Realtek codecs.

----------------------------------------------------------------

Amadeusz Sławiński (1):
ALSA: hda: Fix race between creating and refreshing sysfs entries

Jeremy Soller (1):
ALSA: hda/realtek - Corrected fixup for System76 Gazelle (gaze14)

Kailang Yang (1):
ALSA: hda/realtek - Fixup headphone noise via runtime suspend

Michał Wadowski (1):
ALSA: hda/realtek - Fix for Lenovo B50-70 inverted internal microphone bug

Takashi Iwai (1):
ALSA: hda/realtek - Avoid superfluous COEF EAPD setups

---
 include/sound/hdaudio.h       |  1 +
 sound/hda/hdac_device.c       |  7 ++++
 sound/hda/hdac_sysfs.c        |  3 ++
 sound/pci/hda/patch_realtek.c | 96 +++++++++++++++++++++++++++++++------------
 4 files changed, 80 insertions(+), 27 deletions(-)
include/sound/hdaudio.h +1 -0
index 896c3f45503b..e8346784cf3f 100644
@@ -81,6 +81,7 @@ struct hdac_device {
 	atomic_t in_pm;		/* suspend/resume being performed */
 
 	/* sysfs */
+	struct mutex widget_lock;
 	struct hdac_widget_tree *widgets;
 
 	/* regmap */
sound/hda/hdac_device.c +7 -0
index 95b073ee4b32..4769f4c03e14 100644
@@ -55,6 +55,7 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus,
 	codec->bus = bus;
 	codec->addr = addr;
 	codec->type = HDA_DEV_CORE;
+	mutex_init(&codec->widget_lock);
 	pm_runtime_set_active(&codec->dev);
 	pm_runtime_get_noresume(&codec->dev);
 	atomic_set(&codec->in_pm, 0);
@@ -141,7 +142,9 @@ int snd_hdac_device_register(struct hdac_device *codec)
 	err = device_add(&codec->dev);
 	if (err < 0)
 		return err;
+	mutex_lock(&codec->widget_lock);
 	err = hda_widget_sysfs_init(codec);
+	mutex_unlock(&codec->widget_lock);
 	if (err < 0) {
 		device_del(&codec->dev);
 		return err;
@@ -158,7 +161,9 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_register);
 void snd_hdac_device_unregister(struct hdac_device *codec)
 {
 	if (device_is_registered(&codec->dev)) {
+		mutex_lock(&codec->widget_lock);
 		hda_widget_sysfs_exit(codec);
+		mutex_unlock(&codec->widget_lock);
 		device_del(&codec->dev);
 		snd_hdac_bus_remove_device(codec->bus, codec);
 	}
@@ -404,7 +409,9 @@ int snd_hdac_refresh_widgets(struct hdac_device *codec, bool sysfs)
 	}
 
 	if (sysfs) {
+		mutex_lock(&codec->widget_lock);
 		err = hda_widget_sysfs_reinit(codec, start_nid, nums);
+		mutex_unlock(&codec->widget_lock);
 		if (err < 0)
 			return err;
 	}
sound/hda/hdac_sysfs.c +3 -0
index fb2aa344981e..909d5ef1179c 100644
@@ -395,6 +395,7 @@ static int widget_tree_create(struct hdac_device *codec)
 	return 0;
 }
 
+/* call with codec->widget_lock held */
 int hda_widget_sysfs_init(struct hdac_device *codec)
 {
 	int err;
@@ -411,11 +412,13 @@ int hda_widget_sysfs_init(struct hdac_device *codec)
 	return 0;
 }
 
+/* call with codec->widget_lock held */
 void hda_widget_sysfs_exit(struct hdac_device *codec)
 {
 	widget_tree_free(codec);
 }
 
+/* call with codec->widget_lock held */
 int hda_widget_sysfs_reinit(struct hdac_device *codec,
 			    hda_nid_t start_nid, int num_nodes)
 {
sound/pci/hda/patch_realtek.c +69 -27

200 lines not on this page · raw message

merge bot Merged
#1 lore raw
The pull request you sent on Fri, 17 May 2019 14:51:24 +0200:

The pull request you sent on Fri, 17 May 2019 14:51:24 +0200:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-fix-5.2-rc1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/72cf0b07418a9c8349aa9137194b1ccba6e54a9d

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker