Commit 689968db authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "This became a slightly big update, but it's more or less expected, as
  the first batch after holidays.

  All changes (but for the last two last-minute fixes) have been stewed
  in linux-next long enough, so it's fairly safe to take:

   - PCM UAF fix in 32bit compat layer

   - ASoC board-specific fixes for Intel, AMD, Medathek, Qualcomm

   - SOF power management fixes

   - ASoC Intel link failure fixes

   - A series of fixes for USB-audio regressions

   - CS35L41 HD-audio codec regression fixes

   - HD-audio device-specific fixes / quirks

  Note that one SPI patch has been taken in ASoC subtree mistakenly, and
  the same fix is found in spi tree, but it should be OK to apply"

* tag 'sound-6.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (39 commits)
  ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
  ALSA: usb-audio: Fix possible NULL pointer dereference in snd_usb_pcm_has_fixed_rate()
  ALSA: hda/realtek: Enable mute/micmute LEDs on HP Spectre x360 13-aw0xxx
  ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets
  ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC
  ALSA: hda/hdmi: Add a HP device 0x8715 to force connect list
  ALSA: control-led: use strscpy in set_led_id()
  ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format()
  ASoC: dt-bindings: qcom,lpass-tx-macro: correct clocks on SC7280
  ASoC: dt-bindings: qcom,lpass-wsa-macro: correct clocks on SM8250
  ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE
  ALSA: hda: cs35l41: Check runtime suspend capability at runtime_idle
  ALSA: hda: cs35l41: Don't return -EINVAL from system suspend/resume
  ASoC: fsl_micfil: Correct the number of steps on SX controls
  ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform
  Revert "ALSA: usb-audio: Drop superfluous interface setup at parsing"
  ALSA: usb-audio: More refactoring of hw constraint rules
  ALSA: usb-audio: Relax hw constraints for implicit fb sync
  ALSA: usb-audio: Make sure to stop endpoints before closing EPs
  ALSA: hda - Enable headset mic on another Dell laptop with ALC3254
  ...
parents d863f053 56b88b50
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ properties:
  compatible:
    enum:
      - mediatek,mt8186-mt6366-rt1019-rt5682s-sound
      - mediatek,mt8186-mt6366-rt5682s-max98360-sound

  mediatek,platform:
    $ref: "/schemas/types.yaml#/definitions/phandle"
+3 −1
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ properties:
    const: 0

  clocks:
    maxItems: 5
    oneOf:
      - maxItems: 3
      - maxItems: 5

  clock-names:
    oneOf:
+47 −11
Original line number Diff line number Diff line
@@ -9,9 +9,6 @@ title: LPASS(Low Power Audio Subsystem) VA Macro audio codec
maintainers:
  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    enum:
@@ -30,15 +27,12 @@ properties:
    const: 0

  clocks:
    maxItems: 5
    minItems: 5
    maxItems: 6

  clock-names:
    items:
      - const: mclk
      - const: npl
      - const: macro
      - const: dcodec
      - const: fsgen
    minItems: 5
    maxItems: 6

  clock-output-names:
    maxItems: 1
@@ -55,10 +49,51 @@ required:
  - reg
  - "#sound-dai-cells"

allOf:
  - $ref: dai-common.yaml#

  - if:
      properties:
        compatible:
          enum:
            - qcom,sc7280-lpass-wsa-macro
            - qcom,sm8450-lpass-wsa-macro
            - qcom,sc8280xp-lpass-wsa-macro
    then:
      properties:
        clocks:
          maxItems: 5
        clock-names:
          items:
            - const: mclk
            - const: npl
            - const: macro
            - const: dcodec
            - const: fsgen

  - if:
      properties:
        compatible:
          enum:
            - qcom,sm8250-lpass-wsa-macro
    then:
      properties:
        clocks:
          minItems: 6
        clock-names:
          items:
            - const: mclk
            - const: npl
            - const: macro
            - const: dcodec
            - const: va
            - const: fsgen

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/qcom,sm8250-lpass-aoncc.h>
    #include <dt-bindings/sound/qcom,q6afe.h>
    codec@3240000 {
      compatible = "qcom,sm8250-lpass-wsa-macro";
@@ -69,7 +104,8 @@ examples:
               <&audiocc 0>,
               <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
               <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
               <&aoncc LPASS_CDC_VA_MCLK>,
               <&vamacro>;
      clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
      clock-names = "mclk", "npl", "macro", "dcodec", "va", "fsgen";
      clock-output-names = "mclk";
    };
+15 −9
Original line number Diff line number Diff line
@@ -1203,14 +1203,19 @@ static int snd_ctl_elem_read(struct snd_card *card,
	const u32 pattern = 0xdeadbeef;
	int ret;

	down_read(&card->controls_rwsem);
	kctl = snd_ctl_find_id(card, &control->id);
	if (kctl == NULL)
		return -ENOENT;
	if (kctl == NULL) {
		ret = -ENOENT;
		goto unlock;
	}

	index_offset = snd_ctl_get_ioff(kctl, &control->id);
	vd = &kctl->vd[index_offset];
	if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL)
		return -EPERM;
	if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL) {
		ret = -EPERM;
		goto unlock;
	}

	snd_ctl_build_ioff(&control->id, kctl, index_offset);

@@ -1220,7 +1225,7 @@ static int snd_ctl_elem_read(struct snd_card *card,
	info.id = control->id;
	ret = __snd_ctl_elem_info(card, kctl, &info, NULL);
	if (ret < 0)
		return ret;
		goto unlock;
#endif

	if (!snd_ctl_skip_validation(&info))
@@ -1230,7 +1235,7 @@ static int snd_ctl_elem_read(struct snd_card *card,
		ret = kctl->get(kctl, control);
	snd_power_unref(card);
	if (ret < 0)
		return ret;
		goto unlock;
	if (!snd_ctl_skip_validation(&info) &&
	    sanity_check_elem_value(card, control, &info, pattern) < 0) {
		dev_err(card->dev,
@@ -1238,8 +1243,11 @@ static int snd_ctl_elem_read(struct snd_card *card,
			control->id.iface, control->id.device,
			control->id.subdevice, control->id.name,
			control->id.index);
		return -EINVAL;
		ret = -EINVAL;
		goto unlock;
	}
unlock:
	up_read(&card->controls_rwsem);
	return ret;
}

@@ -1253,9 +1261,7 @@ static int snd_ctl_elem_read_user(struct snd_card *card,
	if (IS_ERR(control))
		return PTR_ERR(control);

	down_read(&card->controls_rwsem);
	result = snd_ctl_elem_read(card, control);
	up_read(&card->controls_rwsem);
	if (result < 0)
		goto error;

+2 −3
Original line number Diff line number Diff line
@@ -530,12 +530,11 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
			  bool attach)
{
	char buf2[256], *s, *os;
	size_t len = max(sizeof(s) - 1, count);
	struct snd_ctl_elem_id id;
	int err;

	strncpy(buf2, buf, len);
	buf2[len] = '\0';
	if (strscpy(buf2, buf, sizeof(buf2)) < 0)
		return -E2BIG;
	memset(&id, 0, sizeof(id));
	id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
	s = buf2;
Loading