Skip to content

Commit 689968d

Browse files
committed
Merge tag 'sound-6.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
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 ...
2 parents d863f05 + 56b88b5 commit 689968d

34 files changed

+604
-293
lines changed

Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ properties:
1616
compatible:
1717
enum:
1818
- mediatek,mt8186-mt6366-rt1019-rt5682s-sound
19+
- mediatek,mt8186-mt6366-rt5682s-max98360-sound
1920

2021
mediatek,platform:
2122
$ref: "/schemas/types.yaml#/definitions/phandle"

Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ properties:
3030
const: 0
3131

3232
clocks:
33-
maxItems: 5
33+
oneOf:
34+
- maxItems: 3
35+
- maxItems: 5
3436

3537
clock-names:
3638
oneOf:

Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ title: LPASS(Low Power Audio Subsystem) VA Macro audio codec
99
maintainers:
1010
- Srinivas Kandagatla <[email protected]>
1111

12-
allOf:
13-
- $ref: dai-common.yaml#
14-
1512
properties:
1613
compatible:
1714
enum:
@@ -30,15 +27,12 @@ properties:
3027
const: 0
3128

3229
clocks:
33-
maxItems: 5
30+
minItems: 5
31+
maxItems: 6
3432

3533
clock-names:
36-
items:
37-
- const: mclk
38-
- const: npl
39-
- const: macro
40-
- const: dcodec
41-
- const: fsgen
34+
minItems: 5
35+
maxItems: 6
4236

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

52+
allOf:
53+
- $ref: dai-common.yaml#
54+
55+
- if:
56+
properties:
57+
compatible:
58+
enum:
59+
- qcom,sc7280-lpass-wsa-macro
60+
- qcom,sm8450-lpass-wsa-macro
61+
- qcom,sc8280xp-lpass-wsa-macro
62+
then:
63+
properties:
64+
clocks:
65+
maxItems: 5
66+
clock-names:
67+
items:
68+
- const: mclk
69+
- const: npl
70+
- const: macro
71+
- const: dcodec
72+
- const: fsgen
73+
74+
- if:
75+
properties:
76+
compatible:
77+
enum:
78+
- qcom,sm8250-lpass-wsa-macro
79+
then:
80+
properties:
81+
clocks:
82+
minItems: 6
83+
clock-names:
84+
items:
85+
- const: mclk
86+
- const: npl
87+
- const: macro
88+
- const: dcodec
89+
- const: va
90+
- const: fsgen
91+
5892
unevaluatedProperties: false
5993

6094
examples:
6195
- |
96+
#include <dt-bindings/clock/qcom,sm8250-lpass-aoncc.h>
6297
#include <dt-bindings/sound/qcom,q6afe.h>
6398
codec@3240000 {
6499
compatible = "qcom,sm8250-lpass-wsa-macro";
@@ -69,7 +104,8 @@ examples:
69104
<&audiocc 0>,
70105
<&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
71106
<&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
107+
<&aoncc LPASS_CDC_VA_MCLK>,
72108
<&vamacro>;
73-
clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
109+
clock-names = "mclk", "npl", "macro", "dcodec", "va", "fsgen";
74110
clock-output-names = "mclk";
75111
};

sound/core/control.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,14 +1203,19 @@ static int snd_ctl_elem_read(struct snd_card *card,
12031203
const u32 pattern = 0xdeadbeef;
12041204
int ret;
12051205

1206+
down_read(&card->controls_rwsem);
12061207
kctl = snd_ctl_find_id(card, &control->id);
1207-
if (kctl == NULL)
1208-
return -ENOENT;
1208+
if (kctl == NULL) {
1209+
ret = -ENOENT;
1210+
goto unlock;
1211+
}
12091212

12101213
index_offset = snd_ctl_get_ioff(kctl, &control->id);
12111214
vd = &kctl->vd[index_offset];
1212-
if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL)
1213-
return -EPERM;
1215+
if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL) {
1216+
ret = -EPERM;
1217+
goto unlock;
1218+
}
12141219

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

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

12261231
if (!snd_ctl_skip_validation(&info))
@@ -1230,16 +1235,19 @@ static int snd_ctl_elem_read(struct snd_card *card,
12301235
ret = kctl->get(kctl, control);
12311236
snd_power_unref(card);
12321237
if (ret < 0)
1233-
return ret;
1238+
goto unlock;
12341239
if (!snd_ctl_skip_validation(&info) &&
12351240
sanity_check_elem_value(card, control, &info, pattern) < 0) {
12361241
dev_err(card->dev,
12371242
"control %i:%i:%i:%s:%i: access overflow\n",
12381243
control->id.iface, control->id.device,
12391244
control->id.subdevice, control->id.name,
12401245
control->id.index);
1241-
return -EINVAL;
1246+
ret = -EINVAL;
1247+
goto unlock;
12421248
}
1249+
unlock:
1250+
up_read(&card->controls_rwsem);
12431251
return ret;
12441252
}
12451253

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

1256-
down_read(&card->controls_rwsem);
12571264
result = snd_ctl_elem_read(card, control);
1258-
up_read(&card->controls_rwsem);
12591265
if (result < 0)
12601266
goto error;
12611267

sound/core/control_led.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,11 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
530530
bool attach)
531531
{
532532
char buf2[256], *s, *os;
533-
size_t len = max(sizeof(s) - 1, count);
534533
struct snd_ctl_elem_id id;
535534
int err;
536535

537-
strncpy(buf2, buf, len);
538-
buf2[len] = '\0';
536+
if (strscpy(buf2, buf, sizeof(buf2)) < 0)
537+
return -E2BIG;
539538
memset(&id, 0, sizeof(id));
540539
id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
541540
s = buf2;

sound/pci/hda/cs35l41_hda.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,8 @@ static int cs35l41_system_suspend(struct device *dev)
598598
dev_dbg(cs35l41->dev, "System Suspend\n");
599599

600600
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) {
601-
dev_err(cs35l41->dev, "System Suspend not supported\n");
602-
return -EINVAL;
601+
dev_err_once(cs35l41->dev, "System Suspend not supported\n");
602+
return 0; /* don't block the whole system suspend */
603603
}
604604

605605
ret = pm_runtime_force_suspend(dev);
@@ -624,8 +624,8 @@ static int cs35l41_system_resume(struct device *dev)
624624
dev_dbg(cs35l41->dev, "System Resume\n");
625625

626626
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) {
627-
dev_err(cs35l41->dev, "System Resume not supported\n");
628-
return -EINVAL;
627+
dev_err_once(cs35l41->dev, "System Resume not supported\n");
628+
return 0; /* don't block the whole system resume */
629629
}
630630

631631
if (cs35l41->reset_gpio) {
@@ -647,6 +647,15 @@ static int cs35l41_system_resume(struct device *dev)
647647
return ret;
648648
}
649649

650+
static int cs35l41_runtime_idle(struct device *dev)
651+
{
652+
struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
653+
654+
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH)
655+
return -EBUSY; /* suspend not supported yet on this model */
656+
return 0;
657+
}
658+
650659
static int cs35l41_runtime_suspend(struct device *dev)
651660
{
652661
struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
@@ -1536,7 +1545,8 @@ void cs35l41_hda_remove(struct device *dev)
15361545
EXPORT_SYMBOL_NS_GPL(cs35l41_hda_remove, SND_HDA_SCODEC_CS35L41);
15371546

15381547
const struct dev_pm_ops cs35l41_hda_pm_ops = {
1539-
RUNTIME_PM_OPS(cs35l41_runtime_suspend, cs35l41_runtime_resume, NULL)
1548+
RUNTIME_PM_OPS(cs35l41_runtime_suspend, cs35l41_runtime_resume,
1549+
cs35l41_runtime_idle)
15401550
SYSTEM_SLEEP_PM_OPS(cs35l41_system_suspend, cs35l41_system_resume)
15411551
};
15421552
EXPORT_SYMBOL_NS_GPL(cs35l41_hda_pm_ops, SND_HDA_SCODEC_CS35L41);

sound/pci/hda/patch_hdmi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,7 @@ static const struct snd_pci_quirk force_connect_list[] = {
19811981
SND_PCI_QUIRK(0x103c, 0x870f, "HP", 1),
19821982
SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
19831983
SND_PCI_QUIRK(0x103c, 0x8711, "HP", 1),
1984+
SND_PCI_QUIRK(0x103c, 0x8715, "HP", 1),
19841985
SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1),
19851986
SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", 1),
19861987
{}

sound/pci/hda/patch_realtek.c

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,6 +3564,15 @@ static void alc256_init(struct hda_codec *codec)
35643564
hda_nid_t hp_pin = alc_get_hp_pin(spec);
35653565
bool hp_pin_sense;
35663566

3567+
if (spec->ultra_low_power) {
3568+
alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3569+
alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3570+
alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3571+
alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3572+
alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3573+
msleep(30);
3574+
}
3575+
35673576
if (!hp_pin)
35683577
hp_pin = 0x21;
35693578

@@ -3575,14 +3584,6 @@ static void alc256_init(struct hda_codec *codec)
35753584
msleep(2);
35763585

35773586
alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3578-
if (spec->ultra_low_power) {
3579-
alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3580-
alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3581-
alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3582-
alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3583-
alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3584-
msleep(30);
3585-
}
35863587

35873588
snd_hda_codec_write(codec, hp_pin, 0,
35883589
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
@@ -3713,6 +3714,13 @@ static void alc225_init(struct hda_codec *codec)
37133714
hda_nid_t hp_pin = alc_get_hp_pin(spec);
37143715
bool hp1_pin_sense, hp2_pin_sense;
37153716

3717+
if (spec->ultra_low_power) {
3718+
alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3719+
alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3720+
alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3721+
msleep(30);
3722+
}
3723+
37163724
if (spec->codec_variant != ALC269_TYPE_ALC287 &&
37173725
spec->codec_variant != ALC269_TYPE_ALC245)
37183726
/* required only at boot or S3 and S4 resume time */
@@ -3734,12 +3742,6 @@ static void alc225_init(struct hda_codec *codec)
37343742
msleep(2);
37353743

37363744
alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3737-
if (spec->ultra_low_power) {
3738-
alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3739-
alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3740-
alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3741-
msleep(30);
3742-
}
37433745

37443746
if (hp1_pin_sense || spec->ultra_low_power)
37453747
snd_hda_codec_write(codec, hp_pin, 0,
@@ -4644,6 +4646,16 @@ static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
46444646
}
46454647
}
46464648

4649+
static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4650+
const struct hda_fixup *fix, int action)
4651+
{
4652+
struct alc_spec *spec = codec->spec;
4653+
4654+
if (action == HDA_FIXUP_ACT_PRE_PROBE)
4655+
spec->micmute_led_polarity = 1;
4656+
alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4657+
}
4658+
46474659
static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
46484660
const struct hda_fixup *fix, int action)
46494661
{
@@ -4665,6 +4677,13 @@ static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
46654677
alc285_fixup_hp_coef_micmute_led(codec, fix, action);
46664678
}
46674679

4680+
static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4681+
const struct hda_fixup *fix, int action)
4682+
{
4683+
alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4684+
alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4685+
}
4686+
46684687
static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
46694688
const struct hda_fixup *fix, int action)
46704689
{
@@ -7106,6 +7125,7 @@ enum {
71067125
ALC285_FIXUP_ASUS_G533Z_PINS,
71077126
ALC285_FIXUP_HP_GPIO_LED,
71087127
ALC285_FIXUP_HP_MUTE_LED,
7128+
ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
71097129
ALC236_FIXUP_HP_GPIO_LED,
71107130
ALC236_FIXUP_HP_MUTE_LED,
71117131
ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
@@ -8486,6 +8506,10 @@ static const struct hda_fixup alc269_fixups[] = {
84868506
.type = HDA_FIXUP_FUNC,
84878507
.v.func = alc285_fixup_hp_mute_led,
84888508
},
8509+
[ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8510+
.type = HDA_FIXUP_FUNC,
8511+
.v.func = alc285_fixup_hp_spectre_x360_mute_led,
8512+
},
84898513
[ALC236_FIXUP_HP_GPIO_LED] = {
84908514
.type = HDA_FIXUP_FUNC,
84918515
.v.func = alc236_fixup_hp_gpio_led,
@@ -9239,6 +9263,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
92399263
SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
92409264
SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
92419265
SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9266+
SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
92429267
SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
92439268
SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
92449269
SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
@@ -9327,6 +9352,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
93279352
SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
93289353
SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
93299354
SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9355+
SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
93309356
SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
93319357
SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
93329358
SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
@@ -9406,6 +9432,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
94069432
SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
94079433
SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
94089434
SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9435+
SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
94099436
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
94109437
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
94119438
SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),

0 commit comments

Comments
 (0)