Skip to contentSkip to conversation

Sound fixes for 3.9-rc6

GIT PULL Takashi Iwai 3 participants 4 messages Apr 5, 2013

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

Linus,

please pull sound fixes for v3.9-rc6 from:

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-linus

The topmost commit is fed61fb5275cf1fa4915d6415b4e376c87089d83

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

Sound fixes for 3.9-rc6

This contains slightly more volumes than usual at this stage, mostly because of my vacation in the last week.
Nothing to scare, all small and/or trivial fixes:

- Fix loop path handling in ASoC DAPM
- Some memory handling fixes in ASoC core
- Fix spear_pcm to adapt to the updated API
- HD-audio HDMI ELD handling fixes
- Fix for CM6331 USB-audio SRC change bugs
- Revert power_save_controller option change due to user-space usage
- A few other small ASoC and HD-audio fixes

Thanks!

Takashi

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

Axel Lin (1):
ASoC: si476x: Add missing break for SNDRV_PCM_FORMAT_S8 switch case

David Henningsson (1):
ALSA: hda - fix typo in proc output

Jiri Slaby (1):
ALSA: hda/generic - fix uninitialized variable

Joe Perches (1):
ASoC:: max98090: Remove executable bit

Lars-Peter Clausen (2):
ASoC: spear_pcm: Update to new pcm_new() API
ASoC: dma-sh7760: Fix compile error

Mark Brown (1):
ASoC: dapm: Fix handling of loops

Markus Pargmann (1):
ASoC: pcm030 audio fabric: remove __init from probe

Mengdong Lin (2):
ALSA: hda - bug fix on return value when getting HDMI ELD info
ALSA: hda - bug fix on HDMI ELD debug message

Peter Ujfalusi (1):
ASoC: dapm: Fix pointer dereference in is_connected_output_ep()

Rainer Koenig (1):
ALSA: hda - Enabling Realtek ALC 671 codec

Sascha Hauer (1):
ASoC: imx-ssi: Fix occasional AC97 reset failure

Silviu-Mihai Popescu (1):
ASoC: core: fix invalid free of devm_ allocated data

Takashi Iwai (1):
Revert "ALSA: hda - Allow power_save_controller option override DCAPS"

Torstein Hegge (1):
ALSA: usb: Work around CM6631 sample rate change bug

Wei Yongjun (2):
ASoC: wm_adsp: fix possible memory leak in wm_adsp_load_coeff()
ASoC: core: fix possible memory leak in snd_soc_bytes_put()

---
 Documentation/sound/alsa/ALSA-Configuration.txt |  5 ++-
 include/sound/max98090.h                        |  0
 include/sound/soc-dapm.h                        |  1 +
 sound/pci/hda/hda_codec.c                       |  2 +-
 sound/pci/hda/hda_eld.c                         |  2 +-
 sound/pci/hda/hda_generic.c                     |  2 +-
 sound/pci/hda/hda_intel.c                       |  6 ++--
 sound/pci/hda/patch_hdmi.c                      |  2 +-
 sound/pci/hda/patch_realtek.c                   |  4 ++-
 sound/soc/codecs/max98090.c                     |  0
 sound/soc/codecs/max98090.h                     |  0
 sound/soc/codecs/si476x.c                       |  1 +
 sound/soc/codecs/wm_adsp.c                      |  5 +--
 sound/soc/fsl/imx-ssi.c                         |  5 +++
 sound/soc/fsl/pcm030-audio-fabric.c             |  2 +-
 sound/soc/sh/dma-sh7760.c                       |  4 +--
 sound/soc/soc-core.c                            |  8 ++---
 sound/soc/soc-dapm.c                            | 14 ++++++++
 sound/soc/spear/spear_pcm.c                     | 12 +++----
 sound/usb/clock.c                               | 45 +++++++++++++++++++------
 20 files changed, 83 insertions(+), 37 deletions(-)
 mode change 100755 => 100644 include/sound/max98090.h
 mode change 100755 => 100644 sound/soc/codecs/max98090.c
 mode change 100755 => 100644 sound/soc/codecs/max98090.h
Documentation/sound/alsa/ALSA-Configuration.txt +2 -3
index 4499bd9..95731a0 100644
@@ -890,9 +890,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
     enable_msi	- Enable Message Signaled Interrupt (MSI) (default = off)
     power_save	- Automatic power-saving timeout (in second, 0 =
 		disable)
-    power_save_controller - Support runtime D3 of HD-audio controller
-		(-1 = on for supported chip (default), false = off,
-		 true = force to on even for unsupported hardware)
+    power_save_controller - Reset HD-audio controller in power-saving mode
+		(default = on)
     align_buffer_size - Force rounding of buffer/period sizes to multiples
     		      of 128 bytes. This is more efficient in terms of memory
 		      access but isn't required by the HDA spec and prevents
include/sound/max98090.h +0 -0
old mode 100755
new mode 100644
include/sound/soc-dapm.h +1 -0
index e1ef63d..44a30b1 100644
@@ -488,6 +488,7 @@ struct snd_soc_dapm_path {
 	/* status */
 	u32 connect:1;	/* source and sink widgets are connected */
 	u32 walked:1;	/* path has been walked */
+	u32 walking:1;  /* path is in the process of being walked */
 	u32 weak:1;	/* path ignored for power management */
 
 	int (*connected)(struct snd_soc_dapm_widget *source,
sound/pci/hda/hda_codec.c +1 -1
index ecdf30e..4aba764 100644
@@ -173,7 +173,7 @@ const char *snd_hda_get_jack_type(u32 cfg)
 		"Line Out", "Speaker", "HP Out", "CD",
 		"SPDIF Out", "Digital Out", "Modem Line", "Modem Hand",
 		"Line In", "Aux", "Mic", "Telephony",
-		"SPDIF In", "Digitial In", "Reserved", "Other"
+		"SPDIF In", "Digital In", "Reserved", "Other"
 	};
 
 	return jack_types[(cfg & AC_DEFCFG_DEVICE)
sound/pci/hda/hda_eld.c +1 -1
index 7dd8463..d0d7ac1 100644
@@ -320,7 +320,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
 		     unsigned char *buf, int *eld_size)
 {
 	int i;
-	int ret;
+	int ret = 0;
 	int size;
 
 	/*
sound/pci/hda/hda_generic.c +1 -1
index 43c2ea5..2dbe767 100644
@@ -740,7 +740,7 @@ EXPORT_SYMBOL_HDA(snd_hda_activate_path);
 static void path_power_down_sync(struct hda_codec *codec, struct nid_path *path)
 {
 	struct hda_gen_spec *spec = codec->spec;
-	bool changed;
+	bool changed = false;
 	int i;
 
 	if (!spec->power_down_unused || path->active)
sound/pci/hda/hda_intel.c +2 -4
index 418bfc0..bcd40ee 100644
@@ -134,8 +134,8 @@ MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
  * this may give more power-saving, but will take longer time to
  * wake up.
  */
-static int power_save_controller = -1;
-module_param(power_save_controller, bint, 0644);
+static bool power_save_controller = 1;
+module_param(power_save_controller, bool, 0644);
 MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode.");
 #endif /* CONFIG_PM */
 
@@ -2931,8 +2931,6 @@ static int azx_runtime_idle(struct device *dev)
 	struct snd_card *card = dev_get_drvdata(dev);
 	struct azx *chip = card->private_data;
 
-	if (power_save_controller > 0)
-		return 0;
 	if (!power_save_controller ||
 	    !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
 		return -EBUSY;
sound/pci/hda/patch_hdmi.c +1 -1
index 78e1827..de8ac5c 100644
@@ -1196,7 +1196,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
 
 	_snd_printd(SND_PR_VERBOSE,
 		"HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
-		codec->addr, pin_nid, eld->monitor_present, eld->eld_valid);
+		codec->addr, pin_nid, pin_eld->monitor_present, eld->eld_valid);
 
 	if (eld->eld_valid) {
 		if (snd_hdmi_get_eld(codec, pin_nid, eld->eld_buffer,
sound/pci/hda/patch_realtek.c +3 -1
index 563c24d..f15c36b 100644
@@ -3440,7 +3440,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
 	const hda_nid_t *ssids;
 
 	if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
-	    codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670)
+	    codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670 ||
+	    codec->vendor_id == 0x10ec0671)
 		ssids = alc663_ssids;
 	else
 		ssids = alc662_ssids;
@@ -3894,6 +3895,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
 	{ .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 },
 	{ .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 },
 	{ .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 },
+	{ .id = 0x10ec0671, .name = "ALC671", .patch = patch_alc662 },
 	{ .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 },
 	{ .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 },
 	{ .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
sound/soc/codecs/max98090.c +0 -0
old mode 100755
new mode 100644
sound/soc/codecs/max98090.h +0 -0
old mode 100755
new mode 100644
sound/soc/codecs/si476x.c +1 -0
index f2d61a1..566ea32 100644
@@ -159,6 +159,7 @@ static int si476x_codec_hw_params(struct snd_pcm_substream *substream,
 	switch (params_format(params)) {
 	case SNDRV_PCM_FORMAT_S8:
 		width = SI476X_PCM_FORMAT_S8;
+		break;
 	case SNDRV_PCM_FORMAT_S16_LE:
 		width = SI476X_PCM_FORMAT_S16_LE;
 		break;
sound/soc/codecs/wm_adsp.c +3 -2
index f3f7e75..9af1bdd 100644
@@ -828,7 +828,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
 						&buf_list);
 			if (!buf) {
 				adsp_err(dsp, "Out of memory\n");
-				return -ENOMEM;
+				ret = -ENOMEM;
+				goto out_fw;
 			}
 
 			adsp_dbg(dsp, "%s.%d: Writing %d bytes at %x\n",
@@ -865,7 +866,7 @@ out_fw:
 	wm_adsp_buf_free(&buf_list);
 out:
 	kfree(file);
-	return 0;
+	return ret;
 }
 
 int wm_adsp1_init(struct wm_adsp *adsp)
sound/soc/fsl/imx-ssi.c +5 -0
index 55464a5..810c7ee 100644
@@ -496,6 +496,8 @@ static void imx_ssi_ac97_reset(struct snd_ac97 *ac97)
 
 	if (imx_ssi->ac97_reset)
 		imx_ssi->ac97_reset(ac97);
+	/* First read sometimes fails, do a dummy read */
+	imx_ssi_ac97_read(ac97, 0);
 }
 
 static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97)
@@ -504,6 +506,9 @@ static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97)
 
 	if (imx_ssi->ac97_warm_reset)
 		imx_ssi->ac97_warm_reset(ac97);
+
+	/* First read sometimes fails, do a dummy read */
+	imx_ssi_ac97_read(ac97, 0);
 }
 
 struct snd_ac97_bus_ops soc_ac97_ops = {
sound/soc/fsl/pcm030-audio-fabric.c +1 -1
index 8e52c14..eb43738 100644
@@ -51,7 +51,7 @@ static struct snd_soc_card pcm030_card = {
 	.num_links = ARRAY_SIZE(pcm030_fabric_dai),
 };
 
-static int __init pcm030_fabric_probe(struct platform_device *op)
+static int pcm030_fabric_probe(struct platform_device *op)
 {
 	struct device_node *np = op->dev.of_node;
 	struct device_node *platform_np;
sound/soc/sh/dma-sh7760.c +2 -2
index 19eff8f..1a8b03e 100644
@@ -342,8 +342,8 @@ static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
-static struct snd_soc_platform sh7760_soc_platform = {
-	.pcm_ops 	= &camelot_pcm_ops,
+static struct snd_soc_platform_driver sh7760_soc_platform = {
+	.ops		= &camelot_pcm_ops,
 	.pcm_new	= camelot_pcm_new,
 	.pcm_free	= camelot_pcm_free,
 };
sound/soc/soc-core.c +4 -4
index b7e84a7..507d251 100644
@@ -3140,7 +3140,7 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
 	if (params->mask) {
 		ret = regmap_read(codec->control_data, params->base, &val);
 		if (ret != 0)
-			return ret;
+			goto out;
 
 		val &= params->mask;
 
@@ -3158,13 +3158,15 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
 			((u32 *)data)[0] |= cpu_to_be32(val);
 			break;
 		default:
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 	}
 
 	ret = regmap_raw_write(codec->control_data, params->base,
 			       data, len);
 
+out:
 	kfree(data);
 
 	return ret;
@@ -4197,7 +4199,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
 			dev_err(card->dev,
 				"ASoC: Property '%s' index %d could not be read: %d\n",
 				propname, 2 * i, ret);
-			kfree(routes);
 			return -EINVAL;
 		}
 		ret = of_property_read_string_index(np, propname,
@@ -4206,7 +4207,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
 			dev_err(card->dev,
 				"ASoC: Property '%s' index %d could not be read: %d\n",
 				propname, (2 * i) + 1, ret);
-			kfree(routes);
 			return -EINVAL;
 		}
 	}
sound/soc/soc-dapm.c +14 -0
index 1d6a9b3..d6d9ba2 100644
@@ -831,6 +831,9 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
 		if (path->weak)
 			continue;
 
+		if (path->walking)
+			return 1;
+
 		if (path->walked)
 			continue;
 
@@ -838,6 +841,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
 
 		if (path->sink && path->connect) {
 			path->walked = 1;
+			path->walking = 1;
 
 			/* do we need to add this widget to the list ? */
 			if (list) {
@@ -847,11 +851,14 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
 					dev_err(widget->dapm->dev,
 						"ASoC: could not add widget %s\n",
 						widget->name);
+					path->walking = 0;
 					return con;
 				}
 			}
 
 			con += is_connected_output_ep(path->sink, list);
+
+			path->walking = 0;
 		}
 	}
 
@@ -931,6 +938,9 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
 		if (path->weak)
 			continue;
 
+		if (path->walking)
+			return 1;
+
 		if (path->walked)
 			continue;
 
@@ -938,6 +948,7 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
 
 		if (path->source && path->connect) {
 			path->walked = 1;
+			path->walking = 1;
 
 			/* do we need to add this widget to the list ? */
 			if (list) {
@@ -947,11 +958,14 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
 					dev_err(widget->dapm->dev,
 						"ASoC: could not add widget %s\n",
 						widget->name);
+					path->walking = 0;
 					return con;
 				}
 			}
 
 			con += is_connected_input_ep(path->source, list);
+
+			path->walking = 0;
 		}
 	}
 
sound/soc/spear/spear_pcm.c +6 -6
index 9b76cc5..5e7aebe 100644
@@ -149,9 +149,9 @@ static void spear_pcm_free(struct snd_pcm *pcm)
 
 static u64 spear_pcm_dmamask = DMA_BIT_MASK(32);
 
-static int spear_pcm_new(struct snd_card *card,
-		struct snd_soc_dai *dai, struct snd_pcm *pcm)
+static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd)
 {
+	struct snd_card *card = rtd->card->snd_card;
 	int ret;
 
 	if (!card->dev->dma_mask)
@@ -159,16 +159,16 @@ static int spear_pcm_new(struct snd_card *card,
 	if (!card->dev->coherent_dma_mask)
 		card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
 
-	if (dai->driver->playback.channels_min) {
-		ret = spear_pcm_preallocate_dma_buffer(pcm,
+	if (rtd->cpu_dai->driver->playback.channels_min) {
+		ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
 				SNDRV_PCM_STREAM_PLAYBACK,
 				spear_pcm_hardware.buffer_bytes_max);
 		if (ret)
 			return ret;
 	}
 
-	if (dai->driver->capture.channels_min) {
-		ret = spear_pcm_preallocate_dma_buffer(pcm,
+	if (rtd->cpu_dai->driver->capture.channels_min) {
+		ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
 				SNDRV_PCM_STREAM_CAPTURE,
 				spear_pcm_hardware.buffer_bytes_max);
 		if (ret)
sound/usb/clock.c +35 -10

67 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · Takashi Iwai

please pull sound fixes for v3.9-rc6 from:

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-linus

Argh, Takashi, you're usually so reliable...

But you actually meant for me to pull the sound-3.9 tag, didn't you? That "for-linus" branch isn't a signed tag..

Please double-check your scripts,

Linus

#2 lore raw

At Fri, 5 Apr 2013 09:06:43 -0700,

Quoted 11 lines · Linus Torvalds
Quoted 4 lines · Takashi Iwai

please pull sound fixes for v3.9-rc6 from:

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-linus

Argh, Takashi, you're usually so reliable...

But you actually meant for me to pull the sound-3.9 tag, didn't you? That "for-linus" branch isn't a signed tag..

Gah, sorry! Yes, please pull from tags/sound-3.9.

Quoted 1 line

Please double-check your scripts,

I fixed it once but I couldn't use it during migration to a new workstation, which I ended up installing freshly.

Not the next time (tm)

Takashi

#3 lore raw
In reply to Linus Torvalds
Quoted 6 lines · Linus Torvalds

Argh, Takashi, you're usually so reliable...

But you actually meant for me to pull the sound-3.9 tag, didn't you? That "for-linus" branch isn't a signed tag..

Please double-check your scripts,

Probably needs a git upgrade - for a while git would silently substitute a branch if it had the same head as a signed tag when generating pull requests (which was very annoying if you'd had a public branch which you were just getting round to signing). Current versions should get this right and insist on the tag if that was what was supplied on the command line.