提交 12bf19c9 编写于 作者: L Linus Torvalds

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

Pull sound fixes from Takashi Iwai:
 "A few fixes covering the issues reported by syzkaller, a couple of
  fixes for the MIDI decoding bug, and a few usual HD-audio quirks.

  Some of them are about ALSA core stuff, but they are small fixes just
  for corner cases, and nothing thrilling"

* tag 'sound-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek - Enable the headset of Acer N50-600 with ALC662
  ALSA: hda/realtek - Enable headset mic of Acer X2660G with ALC662
  ALSA: seq: oss: Fix running status after receiving sysex
  ALSA: seq: virmidi: Fix running status after receiving sysex
  ALSA: pcm: oss: Remove WARNING from snd_pcm_plug_alloc() checks
  ALSA: hda/realtek: Fix pop noise on ALC225
  ALSA: line6: Fix endless MIDI read loop
  ALSA: pcm: oss: Avoid plugin buffer overflow
...@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) ...@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
while (plugin->next) { while (plugin->next) {
if (plugin->dst_frames) if (plugin->dst_frames)
frames = plugin->dst_frames(plugin, frames); frames = plugin->dst_frames(plugin, frames);
if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) if ((snd_pcm_sframes_t)frames <= 0)
return -ENXIO; return -ENXIO;
plugin = plugin->next; plugin = plugin->next;
err = snd_pcm_plugin_alloc(plugin, frames); err = snd_pcm_plugin_alloc(plugin, frames);
...@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) ...@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
while (plugin->prev) { while (plugin->prev) {
if (plugin->src_frames) if (plugin->src_frames)
frames = plugin->src_frames(plugin, frames); frames = plugin->src_frames(plugin, frames);
if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) if ((snd_pcm_sframes_t)frames <= 0)
return -ENXIO; return -ENXIO;
plugin = plugin->prev; plugin = plugin->prev;
err = snd_pcm_plugin_alloc(plugin, frames); err = snd_pcm_plugin_alloc(plugin, frames);
...@@ -209,6 +209,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p ...@@ -209,6 +209,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
if (stream == SNDRV_PCM_STREAM_PLAYBACK) { if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
plugin = snd_pcm_plug_last(plug); plugin = snd_pcm_plug_last(plug);
while (plugin && drv_frames > 0) { while (plugin && drv_frames > 0) {
if (drv_frames > plugin->buf_frames)
drv_frames = plugin->buf_frames;
plugin_prev = plugin->prev; plugin_prev = plugin->prev;
if (plugin->src_frames) if (plugin->src_frames)
drv_frames = plugin->src_frames(plugin, drv_frames); drv_frames = plugin->src_frames(plugin, drv_frames);
...@@ -220,6 +222,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p ...@@ -220,6 +222,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
plugin_next = plugin->next; plugin_next = plugin->next;
if (plugin->dst_frames) if (plugin->dst_frames)
drv_frames = plugin->dst_frames(plugin, drv_frames); drv_frames = plugin->dst_frames(plugin, drv_frames);
if (drv_frames > plugin->buf_frames)
drv_frames = plugin->buf_frames;
plugin = plugin_next; plugin = plugin_next;
} }
} else } else
...@@ -248,11 +252,15 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc ...@@ -248,11 +252,15 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
if (frames < 0) if (frames < 0)
return frames; return frames;
} }
if (frames > plugin->buf_frames)
frames = plugin->buf_frames;
plugin = plugin_next; plugin = plugin_next;
} }
} else if (stream == SNDRV_PCM_STREAM_CAPTURE) { } else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
plugin = snd_pcm_plug_last(plug); plugin = snd_pcm_plug_last(plug);
while (plugin) { while (plugin) {
if (frames > plugin->buf_frames)
frames = plugin->buf_frames;
plugin_prev = plugin->prev; plugin_prev = plugin->prev;
if (plugin->src_frames) { if (plugin->src_frames) {
frames = plugin->src_frames(plugin, frames); frames = plugin->src_frames(plugin, frames);
......
...@@ -602,6 +602,7 @@ send_midi_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, struct seq ...@@ -602,6 +602,7 @@ send_midi_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, struct seq
len = snd_seq_oss_timer_start(dp->timer); len = snd_seq_oss_timer_start(dp->timer);
if (ev->type == SNDRV_SEQ_EVENT_SYSEX) { if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev); snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev);
snd_midi_event_reset_decode(mdev->coder);
} else { } else {
len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev); len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev);
if (len > 0) if (len > 0)
......
...@@ -81,6 +81,7 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev, ...@@ -81,6 +81,7 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE) if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
continue; continue;
snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream); snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream);
snd_midi_event_reset_decode(vmidi->parser);
} else { } else {
len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev); len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev);
if (len > 0) if (len > 0)
......
...@@ -8051,6 +8051,8 @@ static int patch_alc269(struct hda_codec *codec) ...@@ -8051,6 +8051,8 @@ static int patch_alc269(struct hda_codec *codec)
spec->gen.mixer_nid = 0; spec->gen.mixer_nid = 0;
break; break;
case 0x10ec0225: case 0x10ec0225:
codec->power_save_node = 1;
/* fall through */
case 0x10ec0295: case 0x10ec0295:
case 0x10ec0299: case 0x10ec0299:
spec->codec_variant = ALC269_TYPE_ALC225; spec->codec_variant = ALC269_TYPE_ALC225;
...@@ -8610,6 +8612,8 @@ enum { ...@@ -8610,6 +8612,8 @@ enum {
ALC669_FIXUP_ACER_ASPIRE_ETHOS, ALC669_FIXUP_ACER_ASPIRE_ETHOS,
ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
ALC671_FIXUP_HP_HEADSET_MIC2, ALC671_FIXUP_HP_HEADSET_MIC2,
ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
}; };
static const struct hda_fixup alc662_fixups[] = { static const struct hda_fixup alc662_fixups[] = {
...@@ -8955,6 +8959,25 @@ static const struct hda_fixup alc662_fixups[] = { ...@@ -8955,6 +8959,25 @@ static const struct hda_fixup alc662_fixups[] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc671_fixup_hp_headset_mic2, .v.func = alc671_fixup_hp_headset_mic2,
}, },
[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
{ }
},
.chained = true,
.chain_id = ALC662_FIXUP_USI_FUNC
},
[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
{ 0x1b, 0x0221144f },
{ }
},
.chained = true,
.chain_id = ALC662_FIXUP_USI_FUNC
},
}; };
static const struct snd_pci_quirk alc662_fixup_tbl[] = { static const struct snd_pci_quirk alc662_fixup_tbl[] = {
...@@ -8966,6 +8989,8 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { ...@@ -8966,6 +8989,8 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
......
...@@ -305,7 +305,7 @@ static void line6_data_received(struct urb *urb) ...@@ -305,7 +305,7 @@ static void line6_data_received(struct urb *urb)
line6_midibuf_read(mb, line6->buffer_message, line6_midibuf_read(mb, line6->buffer_message,
LINE6_MIDI_MESSAGE_MAXLEN); LINE6_MIDI_MESSAGE_MAXLEN);
if (done == 0) if (done <= 0)
break; break;
line6->message_length = done; line6->message_length = done;
......
...@@ -159,7 +159,7 @@ int line6_midibuf_read(struct midi_buffer *this, unsigned char *data, ...@@ -159,7 +159,7 @@ int line6_midibuf_read(struct midi_buffer *this, unsigned char *data,
int midi_length_prev = int midi_length_prev =
midibuf_message_length(this->command_prev); midibuf_message_length(this->command_prev);
if (midi_length_prev > 0) { if (midi_length_prev > 1) {
midi_length = midi_length_prev - 1; midi_length = midi_length_prev - 1;
repeat = 1; repeat = 1;
} else } else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册