History

Merge tag 'sound-4.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai: "Things look calming down, but people were still busy to plaster over small holes: - Two fixes to harden against races in aloop driver - A correction of a long-standing bug in USB-audio UAC2 processing unit parser - As usual suspects, HD-audio: a workaround for Coffee Lake controller and a few other device-specific fixes All small and for stable" * tag 'sound-4.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: aloop: Fix access to not-yet-ready substream via cable ALSA: aloop: Sync stale timer before release ALSA: hda/realtek - Fix speaker no sound after system resume ALSA: hda/realtek - Fix Dell headset Mic can't record ALSA: hda - Force polling mode on CFL for fixing codec communication ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit ALSA: hda/realtek - Always immediately update mute LED with pin VREF

Linus Torvalds committed 8 years ago

Commit 8ce72012 parents f36b753 8e6b1a74 files · +41 −5Browse files

Unified · Split

4 files
  1. include/uapi/linux/usb/audio.h +2 −2
  2. sound/drivers/aloop.c +15 −2
  3. sound/pci/hda/hda_intel.c +5 −0
  4. sound/pci/hda/patch_realtek.c +19 −1
include/uapi/linux/usb/audio.h+2−2
@@ -370,7 +370,7 @@ static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_d · 369 unmodified lines
370370 {
371371 return (protocol == UAC_VERSION_1) ?
372372 desc->baSourceID[desc->bNrInPins + 4] :
373− desc->baSourceID[desc->bNrInPins + 6];
373+ 2; /* in UAC2, this value is constant */
374374 }
375375
376376 static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
@@ -378,7 +378,7 @@ static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_de · 1 unmodified line
378378 {
379379 return (protocol == UAC_VERSION_1) ?
380380 &desc->baSourceID[desc->bNrInPins + 5] :
381− &desc->baSourceID[desc->bNrInPins + 7];
381+ &desc->baSourceID[desc->bNrInPins + 6];
382382 }
383383
384384 static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
sound/drivers/aloop.c+15−2
@@ -192,6 +192,11 @@ static inline void loopback_timer_stop(struct loopback_pcm *dpcm) · 191 unmodified lines
192192 dpcm->timer.expires = 0;
193193 }
194194
195+static inline void loopback_timer_stop_sync(struct loopback_pcm *dpcm)
196+{
197+ del_timer_sync(&dpcm->timer);
198+}
199+
195200 #define CABLE_VALID_PLAYBACK (1 << SNDRV_PCM_STREAM_PLAYBACK)
196201 #define CABLE_VALID_CAPTURE (1 << SNDRV_PCM_STREAM_CAPTURE)
197202 #define CABLE_VALID_BOTH (CABLE_VALID_PLAYBACK|CABLE_VALID_CAPTURE)
@@ -326,6 +331,8 @@ static int loopback_prepare(struct snd_pcm_substream *substream) · 128 unmodified lines
326331 struct loopback_cable *cable = dpcm->cable;
327332 int bps, salign;
328333
334+ loopback_timer_stop_sync(dpcm);
335+
329336 salign = (snd_pcm_format_width(runtime->format) *
330337 runtime->channels) / 8;
331338 bps = salign * runtime->rate;
@@ -659,7 +666,9 @@ static void free_cable(struct snd_pcm_substream *substream) · 327 unmodified lines
659666 return;
660667 if (cable->streams[!substream->stream]) {
661668 /* other stream is still alive */
669+ spin_lock_irq(&cable->lock);
662670 cable->streams[substream->stream] = NULL;
671+ spin_unlock_irq(&cable->lock);
663672 } else {
664673 /* free the cable */
665674 loopback->cables[substream->number][dev] = NULL;
@@ -698,7 +707,6 @@ static int loopback_open(struct snd_pcm_substream *substream) · 32 unmodified lines
698707 loopback->cables[substream->number][dev] = cable;
699708 }
700709 dpcm->cable = cable;
701− cable->streams[substream->stream] = dpcm;
702710
703711 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
704712
@@ -730,6 +738,11 @@ static int loopback_open(struct snd_pcm_substream *substream) · 25 unmodified lines
730738 runtime->hw = loopback_pcm_hardware;
731739 else
732740 runtime->hw = cable->hw;
741+
742+ spin_lock_irq(&cable->lock);
743+ cable->streams[substream->stream] = dpcm;
744+ spin_unlock_irq(&cable->lock);
745+
733746 unlock:
734747 if (err < 0) {
735748 free_cable(substream);
@@ -744,7 +757,7 @@ static int loopback_close(struct snd_pcm_substream *substream) · 8 unmodified lines
744757 struct loopback *loopback = substream->private_data;
745758 struct loopback_pcm *dpcm = substream->runtime->private_data;
746759
747− loopback_timer_stop(dpcm);
760+ loopback_timer_stop_sync(dpcm);
748761 mutex_lock(&loopback->cable_lock);
749762 free_cable(substream);
750763 mutex_unlock(&loopback->cable_lock);
sound/pci/hda/hda_intel.c+5−0
@@ -375,6 +375,7 @@ enum { · 374 unmodified lines
375375 ((pci)->device == 0x160c))
376376
377377 #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
378+#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)
378379
379380 static char *driver_short_names[] = {
380381 [AZX_DRIVER_ICH] = "HDA Intel",
@@ -1744,6 +1745,10 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, · 1363 unmodified lines
17441745 else
17451746 chip->bdl_pos_adj = bdl_pos_adj[dev];
17461747
1748+ /* Workaround for a communication error on CFL (bko#199007) */
1749+ if (IS_CFL(pci))
1750+ chip->polling_mode = 1;
1751+
17471752 err = azx_bus_init(chip, model[dev], &pci_hda_io_ops);
17481753 if (err < 0) {
17491754 kfree(hda);
sound/pci/hda/patch_realtek.c+19−1
@@ -3130,6 +3130,8 @@ static void alc256_init(struct hda_codec *codec) · 3129 unmodified lines
31303130
31313131 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
31323132 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3133+ alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3134+ alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
31333135 }
31343136
31353137 static void alc256_shutup(struct hda_codec *codec)
@@ -3596,8 +3598,12 @@ static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) · 460 unmodified lines
35963598 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
35973599 pinval &= ~AC_PINCTL_VREFEN;
35983600 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3599− if (spec->mute_led_nid)
3601+ if (spec->mute_led_nid) {
3602+ /* temporarily power up/down for setting VREF */
3603+ snd_hda_power_up_pm(codec);
36003604 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
3605+ snd_hda_power_down_pm(codec);
3606+ }
36013607 }
36023608
36033609 /* Make sure the led works even in runtime suspend */
@@ -5497,6 +5503,7 @@ enum { · 1893 unmodified lines
54975503 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
54985504 ALC298_FIXUP_TPT470_DOCK,
54995505 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
5506+ ALC255_FIXUP_DELL_HEADSET_MIC,
55005507 };
55015508
55025509 static const struct hda_fixup alc269_fixups[] = {
@@ -6357,6 +6364,13 @@ static const struct hda_fixup alc269_fixups[] = { · 854 unmodified lines
63576364 .chained = true,
63586365 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
63596366 },
6367+ [ALC255_FIXUP_DELL_HEADSET_MIC] = {
6368+ .type = HDA_FIXUP_PINS,
6369+ .v.pins = (const struct hda_pintbl[]) {
6370+ { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6371+ { }
6372+ },
6373+ },
63606374 };
63616375
63626376 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6411,6 +6425,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 48 unmodified lines
64116425 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
64126426 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
64136427 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6428+ SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
6429+ SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
64146430 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
64156431 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
64166432 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
@@ -7154,6 +7170,8 @@ static int patch_alc269(struct hda_codec *codec) · 737 unmodified lines
71547170 break;
71557171 case 0x10ec0257:
71567172 spec->codec_variant = ALC269_TYPE_ALC257;
7173+ spec->shutup = alc256_shutup;
7174+ spec->init_hook = alc256_init;
71577175 spec->gen.mixer_nid = 0;
71587176 break;
71597177 case 0x10ec0215:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t