diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-19 10:43:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-19 10:43:17 -0400 |
commit | f39f28ff82c14b4f628973d9bba835195a71d437 (patch) | |
tree | e73855c4efc09f581f82956ebf0beee9de0540f5 | |
parent | b4394c34356180adb783a5cba2aee469e76a52ff (diff) | |
parent | f3d737b6340b0c7bacd8bc751605f0ed6203f146 (diff) |
Merge tag 'sound-4.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"A rawmidi race fix and three trivial HD-audio quirks"
* tag 'sound-4.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek - Yet another Clevo P950 quirk entry
ALSA: rawmidi: Change resized buffers atomically
ALSA: hda/realtek - Add Panasonic CF-SZ6 headset jack quirk
ALSA: hda: add mute led support for HP ProBook 455 G5
-rw-r--r-- | sound/core/rawmidi.c | 20 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 69616d00481c..b53026a72e73 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -635,7 +635,7 @@ static int snd_rawmidi_info_select_user(struct snd_card *card, | |||
635 | int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, | 635 | int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, |
636 | struct snd_rawmidi_params * params) | 636 | struct snd_rawmidi_params * params) |
637 | { | 637 | { |
638 | char *newbuf; | 638 | char *newbuf, *oldbuf; |
639 | struct snd_rawmidi_runtime *runtime = substream->runtime; | 639 | struct snd_rawmidi_runtime *runtime = substream->runtime; |
640 | 640 | ||
641 | if (substream->append && substream->use_count > 1) | 641 | if (substream->append && substream->use_count > 1) |
@@ -648,13 +648,17 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, | |||
648 | return -EINVAL; | 648 | return -EINVAL; |
649 | } | 649 | } |
650 | if (params->buffer_size != runtime->buffer_size) { | 650 | if (params->buffer_size != runtime->buffer_size) { |
651 | newbuf = krealloc(runtime->buffer, params->buffer_size, | 651 | newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
652 | GFP_KERNEL); | ||
653 | if (!newbuf) | 652 | if (!newbuf) |
654 | return -ENOMEM; | 653 | return -ENOMEM; |
654 | spin_lock_irq(&runtime->lock); | ||
655 | oldbuf = runtime->buffer; | ||
655 | runtime->buffer = newbuf; | 656 | runtime->buffer = newbuf; |
656 | runtime->buffer_size = params->buffer_size; | 657 | runtime->buffer_size = params->buffer_size; |
657 | runtime->avail = runtime->buffer_size; | 658 | runtime->avail = runtime->buffer_size; |
659 | runtime->appl_ptr = runtime->hw_ptr = 0; | ||
660 | spin_unlock_irq(&runtime->lock); | ||
661 | kfree(oldbuf); | ||
658 | } | 662 | } |
659 | runtime->avail_min = params->avail_min; | 663 | runtime->avail_min = params->avail_min; |
660 | substream->active_sensing = !params->no_active_sensing; | 664 | substream->active_sensing = !params->no_active_sensing; |
@@ -665,7 +669,7 @@ EXPORT_SYMBOL(snd_rawmidi_output_params); | |||
665 | int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, | 669 | int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, |
666 | struct snd_rawmidi_params * params) | 670 | struct snd_rawmidi_params * params) |
667 | { | 671 | { |
668 | char *newbuf; | 672 | char *newbuf, *oldbuf; |
669 | struct snd_rawmidi_runtime *runtime = substream->runtime; | 673 | struct snd_rawmidi_runtime *runtime = substream->runtime; |
670 | 674 | ||
671 | snd_rawmidi_drain_input(substream); | 675 | snd_rawmidi_drain_input(substream); |
@@ -676,12 +680,16 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, | |||
676 | return -EINVAL; | 680 | return -EINVAL; |
677 | } | 681 | } |
678 | if (params->buffer_size != runtime->buffer_size) { | 682 | if (params->buffer_size != runtime->buffer_size) { |
679 | newbuf = krealloc(runtime->buffer, params->buffer_size, | 683 | newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
680 | GFP_KERNEL); | ||
681 | if (!newbuf) | 684 | if (!newbuf) |
682 | return -ENOMEM; | 685 | return -ENOMEM; |
686 | spin_lock_irq(&runtime->lock); | ||
687 | oldbuf = runtime->buffer; | ||
683 | runtime->buffer = newbuf; | 688 | runtime->buffer = newbuf; |
684 | runtime->buffer_size = params->buffer_size; | 689 | runtime->buffer_size = params->buffer_size; |
690 | runtime->appl_ptr = runtime->hw_ptr = 0; | ||
691 | spin_unlock_irq(&runtime->lock); | ||
692 | kfree(oldbuf); | ||
685 | } | 693 | } |
686 | runtime->avail_min = params->avail_min; | 694 | runtime->avail_min = params->avail_min; |
687 | return 0; | 695 | return 0; |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index e7fcfc3b8885..f641c20095f7 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -964,6 +964,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { | |||
964 | SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), | 964 | SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), |
965 | SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), | 965 | SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), |
966 | SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO), | 966 | SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO), |
967 | SND_PCI_QUIRK(0x103c, 0x836e, "HP ProBook 455 G5", CXT_FIXUP_MUTE_LED_GPIO), | ||
967 | SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 968 | SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
968 | SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 969 | SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
969 | SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 970 | SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7496be4491b1..f6af3e1c2b93 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2366,6 +2366,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | |||
2366 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), | 2366 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
2367 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), | 2367 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
2368 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), | 2368 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
2369 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), | ||
2369 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), | 2370 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
2370 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), | 2371 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
2371 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), | 2372 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
@@ -6569,6 +6570,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6569 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), | 6570 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
6570 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), | 6571 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
6571 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), | 6572 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
6573 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), | ||
6572 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), | 6574 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
6573 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), | 6575 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
6574 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), | 6576 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |