Skip to content

Commit b64f26c

Browse files
committed
Merge tag 'sound-fix-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "All commits found here are small fixes for regression or stable: - PCM timestamp behavior fix that could be seen as a regression - Remove spurious WARN_ON() from ALSA timer 32bit compat ioctl - HD-audio HDMI/DP channel mapping fix for 32bit archs - Fix the previous fix for HD-audio initialization code - More hardening USB-audio against malicious USB descriptors - HD-audio quirks/fixes (Realtek codec, AMD controller) - Missing help text for the recent Intel SST kconfig change" * tag 'sound-fix-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: Add Raven PCI ID ALSA: hda/realtek - Fix ALC700 family no sound issue ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization ALSA: usb-audio: Add sanity checks in v2 clock parsers ALSA: usb-audio: Fix potential zero-division at parsing FU ALSA: usb-audio: Fix potential out-of-bound access at parsing SU ALSA: usb-audio: Add sanity checks to FE parser ALSA: timer: Remove kernel warning at compat ioctl error paths ALSA: pcm: update tstamp only if audio_tstamp changed ALSA: hda/realtek: Add headset mic support for Intel NUC Skull Canyon ALSA: hda: Fix too short HDMI/DP chmap reporting ALSA: usb-audio: uac1: Invalidate ctl on interrupt ALSA: hda/realtek - Fix ALC275 no sound issue ASoC: Intel: Add help text for SND_SOC_INTEL_SST_TOPLEVEL
2 parents c353bfc + 9ceace3 commit b64f26c

File tree

11 files changed

+69
-23
lines changed

11 files changed

+69
-23
lines changed

include/sound/control.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kctl,
249249
void snd_ctl_sync_vmaster(struct snd_kcontrol *kctl, bool hook_only);
250250
#define snd_ctl_sync_vmaster_hook(kctl) snd_ctl_sync_vmaster(kctl, true)
251251
int snd_ctl_apply_vmaster_slaves(struct snd_kcontrol *kctl,
252-
int (*func)(struct snd_kcontrol *, void *),
252+
int (*func)(struct snd_kcontrol *vslave,
253+
struct snd_kcontrol *slave,
254+
void *arg),
253255
void *arg);
254256

255257
/*

sound/core/pcm_lib.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ static void update_audio_tstamp(struct snd_pcm_substream *substream,
248248
runtime->rate);
249249
*audio_tstamp = ns_to_timespec(audio_nsecs);
250250
}
251-
runtime->status->audio_tstamp = *audio_tstamp;
252-
runtime->status->tstamp = *curr_tstamp;
251+
if (!timespec_equal(&runtime->status->audio_tstamp, audio_tstamp)) {
252+
runtime->status->audio_tstamp = *audio_tstamp;
253+
runtime->status->tstamp = *curr_tstamp;
254+
}
253255

254256
/*
255257
* re-take a driver timestamp to let apps detect if the reference tstamp

sound/core/timer_compat.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ static int snd_timer_user_info_compat(struct file *file,
6666
struct snd_timer *t;
6767

6868
tu = file->private_data;
69-
if (snd_BUG_ON(!tu->timeri))
70-
return -ENXIO;
69+
if (!tu->timeri)
70+
return -EBADFD;
7171
t = tu->timeri->timer;
72-
if (snd_BUG_ON(!t))
73-
return -ENXIO;
72+
if (!t)
73+
return -EBADFD;
7474
memset(&info, 0, sizeof(info));
7575
info.card = t->card ? t->card->number : -1;
7676
if (t->hw.flags & SNDRV_TIMER_HW_SLAVE)
@@ -99,8 +99,8 @@ static int snd_timer_user_status_compat(struct file *file,
9999
struct snd_timer_status32 status;
100100

101101
tu = file->private_data;
102-
if (snd_BUG_ON(!tu->timeri))
103-
return -ENXIO;
102+
if (!tu->timeri)
103+
return -EBADFD;
104104
memset(&status, 0, sizeof(status));
105105
status.tstamp.tv_sec = tu->tstamp.tv_sec;
106106
status.tstamp.tv_nsec = tu->tstamp.tv_nsec;

sound/core/vmaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,9 @@ EXPORT_SYMBOL_GPL(snd_ctl_sync_vmaster);
495495
* Returns 0 if successful, or a negative error code.
496496
*/
497497
int snd_ctl_apply_vmaster_slaves(struct snd_kcontrol *kctl,
498-
int (*func)(struct snd_kcontrol *, void *),
498+
int (*func)(struct snd_kcontrol *vslave,
499+
struct snd_kcontrol *slave,
500+
void *arg),
499501
void *arg)
500502
{
501503
struct link_master *master;
@@ -507,7 +509,7 @@ int snd_ctl_apply_vmaster_slaves(struct snd_kcontrol *kctl,
507509
if (err < 0)
508510
return err;
509511
list_for_each_entry(slave, &master->slaves, list) {
510-
err = func(&slave->slave, arg);
512+
err = func(slave->kctl, &slave->slave, arg);
511513
if (err < 0)
512514
return err;
513515
}

sound/hda/hdmi_chmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ static int hdmi_chmap_ctl_get(struct snd_kcontrol *kcontrol,
746746
memset(pcm_chmap, 0, sizeof(pcm_chmap));
747747
chmap->ops.get_chmap(chmap->hdac, pcm_idx, pcm_chmap);
748748

749-
for (i = 0; i < sizeof(chmap); i++)
749+
for (i = 0; i < ARRAY_SIZE(pcm_chmap); i++)
750750
ucontrol->value.integer.value[i] = pcm_chmap[i];
751751

752752
return 0;

sound/pci/hda/hda_codec.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,9 @@ struct slave_init_arg {
18231823
};
18241824

18251825
/* initialize the slave volume with 0dB via snd_ctl_apply_vmaster_slaves() */
1826-
static int init_slave_0dB(struct snd_kcontrol *kctl, void *_arg)
1826+
static int init_slave_0dB(struct snd_kcontrol *slave,
1827+
struct snd_kcontrol *kctl,
1828+
void *_arg)
18271829
{
18281830
struct slave_init_arg *arg = _arg;
18291831
int _tlv[4];
@@ -1860,15 +1862,17 @@ static int init_slave_0dB(struct snd_kcontrol *kctl, void *_arg)
18601862
arg->step = step;
18611863
val = -tlv[2] / step;
18621864
if (val > 0) {
1863-
put_kctl_with_value(kctl, val);
1865+
put_kctl_with_value(slave, val);
18641866
return val;
18651867
}
18661868

18671869
return 0;
18681870
}
18691871

18701872
/* unmute the slave via snd_ctl_apply_vmaster_slaves() */
1871-
static int init_slave_unmute(struct snd_kcontrol *slave, void *_arg)
1873+
static int init_slave_unmute(struct snd_kcontrol *slave,
1874+
struct snd_kcontrol *kctl,
1875+
void *_arg)
18721876
{
18731877
return put_kctl_with_value(slave, 1);
18741878
}

sound/pci/hda/hda_intel.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,9 @@ static const struct pci_device_id azx_ids[] = {
24632463
/* AMD Hudson */
24642464
{ PCI_DEVICE(0x1022, 0x780d),
24652465
.driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },
2466+
/* AMD Raven */
2467+
{ PCI_DEVICE(0x1022, 0x15e3),
2468+
.driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },
24662469
/* ATI HDMI */
24672470
{ PCI_DEVICE(0x1002, 0x0002),
24682471
.driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },

sound/pci/hda/patch_realtek.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
341341
case 0x10ec0299:
342342
alc_update_coef_idx(codec, 0x10, 1<<9, 0);
343343
break;
344+
case 0x10ec0275:
345+
alc_update_coef_idx(codec, 0xe, 0, 1<<0);
346+
break;
344347
case 0x10ec0293:
345348
alc_update_coef_idx(codec, 0xa, 1<<13, 0);
346349
break;
@@ -6452,6 +6455,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
64526455
ALC225_STANDARD_PINS,
64536456
{0x12, 0xb7a60130},
64546457
{0x1b, 0x90170110}),
6458+
SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6459+
{0x1b, 0x01111010},
6460+
{0x1e, 0x01451130},
6461+
{0x21, 0x02211020}),
64556462
SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
64566463
{0x12, 0x90a60140},
64576464
{0x14, 0x90170110},
@@ -6887,7 +6894,7 @@ static int patch_alc269(struct hda_codec *codec)
68876894
case 0x10ec0703:
68886895
spec->codec_variant = ALC269_TYPE_ALC700;
68896896
spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
6890-
alc_update_coef_idx(codec, 0x4a, 0, 1 << 15); /* Combo jack auto trigger control */
6897+
alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
68916898
break;
68926899

68936900
}

sound/soc/intel/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ config SND_SOC_INTEL_SST_TOPLEVEL
3434
depends on X86 || COMPILE_TEST
3535
select SND_SOC_INTEL_MACH
3636
select SND_SOC_INTEL_COMMON
37+
help
38+
Intel ASoC Audio Drivers. If you have a Intel machine that
39+
has audio controller with a DSP and I2S or DMIC port, then
40+
enable this option by saying Y or M
41+
If unsure select "N".
3742

3843
config SND_SOC_INTEL_HASWELL
3944
tristate "Intel ASoC SST driver for Haswell/Broadwell"

sound/usb/clock.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static struct uac_clock_source_descriptor *
4343
while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra,
4444
ctrl_iface->extralen,
4545
cs, UAC2_CLOCK_SOURCE))) {
46-
if (cs->bClockID == clock_id)
46+
if (cs->bLength >= sizeof(*cs) && cs->bClockID == clock_id)
4747
return cs;
4848
}
4949

@@ -59,8 +59,11 @@ static struct uac_clock_selector_descriptor *
5959
while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra,
6060
ctrl_iface->extralen,
6161
cs, UAC2_CLOCK_SELECTOR))) {
62-
if (cs->bClockID == clock_id)
62+
if (cs->bLength >= sizeof(*cs) && cs->bClockID == clock_id) {
63+
if (cs->bLength < 5 + cs->bNrInPins)
64+
return NULL;
6365
return cs;
66+
}
6467
}
6568

6669
return NULL;
@@ -75,7 +78,7 @@ static struct uac_clock_multiplier_descriptor *
7578
while ((cs = snd_usb_find_csint_desc(ctrl_iface->extra,
7679
ctrl_iface->extralen,
7780
cs, UAC2_CLOCK_MULTIPLIER))) {
78-
if (cs->bClockID == clock_id)
81+
if (cs->bLength >= sizeof(*cs) && cs->bClockID == clock_id)
7982
return cs;
8083
}
8184

0 commit comments

Comments
 (0)