sound fixes for 5.3-rc1
Subsystems (3)
Linus,
please pull sound fixes for v5.3-rc1 from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-fix-5.3-rc1
The topmost commit is 4914da2fb0c89205790503f20dfdde854f3afdd8
----------------------------------------------------------------
sound fixes for 5.3-rc1
A collection of small fixes.
- The optimization of PM resume with HD-audio HDMI codecs, which eventually work around weird issues
- A correction of Intel Icelake HDMI audio code
- Quirks for Dell machines with Realtek HD-audio codecs
- The fix for too long sequencer write stall that was spotted by syzkaller
- A few trivial cleanups reported by coccinelle
----------------------------------------------------------------
Hariprasad Kelam (5):
ALSA: lx6464es: Remove unneeded variable err
ALSA: ps3: Remove Unneeded variable: "ret"
ALSA: au88x0: Remove unneeded variable: "changed"
ALSA: emu10k1: Remove unneeded variable "change"
ALSA: rme9652: Unneeded variable: "result".
Hui Wang (1):
ALSA: hda/realtek: apply ALC891 headset fixup to one Dell machine
Kailang Yang (1):
ALSA: hda/realtek - Fixed Headphone Mic can't record on Dell platform
Takashi Iwai (4):
ALSA: seq: Break too long mutex context in the write loop
ALSA: hda/hdmi - Remove duplicated define
ALSA: hda/hdmi - Fix i915 reverse port/pin mapping
ALSA: hda - Don't resume forcibly i915 HDMI/DP codec
--- include/sound/hda_codec.h | 2 ++ sound/core/seq/seq_clientmgr.c | 11 ++++++++++- sound/pci/au88x0/au88x0_a3d.c | 15 +++++++-------- sound/pci/emu10k1/emu10k1x.c | 3 +-- sound/pci/hda/hda_codec.c | 8 ++++++-- sound/pci/hda/patch_hdmi.c | 31 ++++++++++++++++++++++++------- sound/pci/hda/patch_realtek.c | 10 +++++++++- sound/pci/lx6464es/lx6464es.c | 3 +-- sound/pci/rme9652/rme9652.c | 3 +-- sound/ppc/snd_ps3.c | 3 +-- 10 files changed, 62 insertions(+), 27 deletions(-)
include/sound/hda_codec.h +2 -0
@@ -252,6 +252,8 @@ struct hda_codec { unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */ unsigned int force_pin_prefix:1; /* Add location prefix */ unsigned int link_down_at_suspend:1; /* link down at runtime suspend */ + unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ +#ifdef CONFIG_PM unsigned long power_on_acct;unsigned long power_off_acct;
sound/core/seq/seq_clientmgr.c +10 -1
@@ -1021,7 +1021,7 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, {struct snd_seq_client *client = file->private_data;int written =0 , len; -int err; +int err, handled;struct snd_seq_event event;if (!(snd_seq_file_flags (file) &SNDRV_SEQ_LFLG_OUTPUT ))
@@ -1034,6 +1034,8 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,if (!client->accept_output || client->pool ==NULL )return -ENXIO ; + repeat: + handled =0 ;/* allocate the pool now if the pool is not allocated yet */ mutex_lock (&client->ioctl_mutex);if (client->pool->size >0 && !snd_seq_write_pool_allocated (client)) {
@@ -1093,12 +1095,19 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, 0, 0, &client->ioctl_mutex);if (err <0 )break ; + handled++; __skip_event:/* Update pointers and counts */ count -= len; buf += len; written += len; + +/* let's have a coffee break if too many events are queued */ +if (++handled >=200 ) { +mutex_unlock (&client->ioctl_mutex); + goto repeat; + } } out:
sound/pci/au88x0/au88x0_a3d.c +7 -8
@@ -765,7 +765,7 @@ snd_vortex_a3d_hrtf_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {a3dsrc_t *a = kcontrol->private_data; -int changed =1 , i; +int i;int coord[6 ];for (i =0 ; i <6 ; i++) coord[i] = ucontrol->value.integer.value[i];
@@ -774,7 +774,7 @@ snd_vortex_a3d_hrtf_put(struct snd_kcontrol *kcontrol,vortex_a3d_coord2hrtf (a->hrtf[1 ], coord);a3dsrc_SetHrtfTarget (a, a->hrtf[0 ], a->hrtf[1 ]);a3dsrc_SetHrtfCurrent (a, a->hrtf[0 ], a->hrtf[1 ]); -return changed; +return 1 ; } static int
@@ -783,7 +783,7 @@ snd_vortex_a3d_itd_put(struct snd_kcontrol *kcontrol, {a3dsrc_t *a = kcontrol->private_data;int coord[6 ]; -int i, changed =1 ; +int i;for (i =0 ; i <6 ; i++) coord[i] = ucontrol->value.integer.value[i];/* Translate orientation coordinates to a3d params. */
@@ -793,7 +793,7 @@ snd_vortex_a3d_itd_put(struct snd_kcontrol *kcontrol,a3dsrc_SetItdTarget (a, a->itd[0 ], a->itd[1 ]);a3dsrc_SetItdCurrent (a, a->itd[0 ], a->itd[1 ]);a3dsrc_SetItdDline (a, a->dline); -return changed; +return 1 ; } static int
@@ -801,7 +801,6 @@ snd_vortex_a3d_ild_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {a3dsrc_t *a = kcontrol->private_data; -int changed =1 ;int l, r;/* There may be some scale tranlation needed here. */ l = ucontrol->value.integer.value[0 ];
@@ -810,7 +809,7 @@ snd_vortex_a3d_ild_put(struct snd_kcontrol *kcontrol,/* Left Right panning. */ a3dsrc_SetGainTarget (a, l, r);a3dsrc_SetGainCurrent (a, l, r); -return changed; +return 1 ; } static int
@@ -818,7 +817,7 @@ snd_vortex_a3d_filter_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {a3dsrc_t *a = kcontrol->private_data; -int i, changed =1 ; +int i;int params[6 ];for (i =0 ; i <6 ; i++) params[i] = ucontrol->value.integer.value[i];
@@ -831,7 +830,7 @@ snd_vortex_a3d_filter_put(struct snd_kcontrol *kcontrol,a3dsrc_SetAtmosCurrent (a, a->filter[0 ], a->filter[1 ], a->filter[2 ], a->filter[3 ], a->filter[4 ]); -return changed; +return 1 ; }static const struct snd_kcontrol_new vortex_a3d_kcontrol = {
sound/pci/emu10k1/emu10k1x.c +1 -2
@@ -1074,7 +1074,6 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol, {struct emu10k1x *emu =snd_kcontrol_chip (kcontrol);unsigned int val; -int change =0 ; val = ucontrol->value.integer.value[0 ] ;
@@ -1089,7 +1088,7 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,snd_emu10k1x_ptr_write (emu,ROUTING ,0 ,0x1003F );snd_emu10k1x_gpio_write (emu,0x1080 ); } -return change; +return 0 ; } static const struct snd_kcontrol_new snd_emu10k1x_shared_spdif =
sound/pci/hda/hda_codec.c +6 -2
@@ -2941,15 +2941,19 @@ static int hda_codec_runtime_resume(struct device *dev)#ifdef CONFIG_PM_SLEEP static int hda_codec_force_resume (struct device *dev) { +struct hda_codec *codec =dev_to_hda_codec (dev); +bool forced_resume = !codec->relaxed_resume;int ret;/* The get/put pair below enforces the runtime resume even if the * device hasn't been used at suspend time. This trick is needed to * update the jack state change during the sleep. */ -pm_runtime_get_noresume (dev); +if (forced_resume) +pm_runtime_get_noresume (dev); ret =pm_runtime_force_resume (dev); -pm_runtime_put (dev); +if (forced_resume) +pm_runtime_put (dev);return ret; }
sound/pci/hda/patch_hdmi.c +24 -7
@@ -2292,8 +2292,10 @@ static void generic_hdmi_free(struct hda_codec *codec)struct hdmi_spec *spec = codec->spec;int pin_idx, pcm_idx; -if (codec_has_acomp (codec)) +if (codec_has_acomp (codec)) {snd_hdac_acomp_register_notifier (&codec->bus->core,NULL ); + codec->relaxed_resume =0 ; + }for (pin_idx =0 ; pin_idx < spec->num_pins; pin_idx++) {struct hdmi_spec_per_pin *per_pin =get_pin (spec, pin_idx);
@@ -2416,7 +2418,6 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec,snd_hda_override_conn_list (codec, nid, spec->num_cvts, spec->cvt_nids); } -#define INTEL_GET_VENDOR_VERB 0xf81#define INTEL_GET_VENDOR_VERB 0xf81#define INTEL_SET_VENDOR_VERB 0x781#define INTEL_EN_DP12 0x02/* enable DP 1.2 features */
@@ -2525,18 +2526,32 @@ static int intel_pin2port(void *audio_ptr, int pin_nid)return -1 ; } +static int intel_port2pin (struct hda_codec *codec,int port) +{ +struct hdmi_spec *spec = codec->spec; + +if (!spec->port_num) { +/* we assume only from port-B to port-D */ +if (port <1 || port >3 ) +return 0 ; +/* intel port is 1-based */ +return port +intel_base_nid (codec) -1 ; + } + +if (port <1 || port > spec->port_num) +return 0 ; +return spec->port_map[port -1 ]; +} +static void intel_pin_eld_notify (void *audio_ptr,int port,int pipe) {struct hda_codec *codec = audio_ptr;int pin_nid;int dev_id = pipe; -/* we assume only from port-B to port-D */ -if (port <1 || port >3 ) + pin_nid =intel_port2pin (codec, port); +if (!pin_nid)return ; - - pin_nid = port +intel_base_nid (codec) -1 ;/* intel port is 1-based */ -/* skip notification during system suspend (but not in runtime PM); * the state will be updated at resume */
@@ -2566,6 +2581,8 @@ static void register_i915_notifier(struct hda_codec *codec) spec->drm_audio_ops.pin_eld_notify = intel_pin_eld_notify;snd_hdac_acomp_register_notifier (&codec->bus->core, &spec->drm_audio_ops); +/* no need for forcible resume for jack check thanks to notifier */ + codec->relaxed_resume =1 ; }/* setup_stream ops override for HSW+ */
sound/pci/hda/patch_realtek.c +9 -1
@@ -7657,9 +7657,12 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { {0x12, 0x90a60130}, {0x17, 0x90170110}, {0x21, 0x03211020}), - SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, {0x14, 0x90170110}, {0x21, 0x04211020}), + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, + {0x14, 0x90170110}, + {0x21, 0x04211030}), SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, ALC295_STANDARD_PINS, {0x17, 0x21014020},
@@ -8800,6 +8803,11 @@ static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { {0x18, 0x01a19030}, {0x1a, 0x01813040}, {0x21, 0x01014020}), + SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, + {0x16, 0x01813030}, + {0x17, 0x02211010}, + {0x18, 0x01a19040}, + {0x21, 0x01014020}), SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, {0x14, 0x01014010}, {0x18, 0x01a19020},
sound/pci/lx6464es/lx6464es.c +1 -2
@@ -253,9 +253,8 @@ static int lx_pcm_open(struct snd_pcm_substream *substream)static int lx_pcm_close (struct snd_pcm_substream *substream) { -int err =0 ;dev_dbg (substream->pcm->card->dev,"->lx_pcm_close\n" ); -return err; +return 0 ; } static snd_pcm_uframes_t lx_pcm_stream_pointer(struct snd_pcm_substream
sound/pci/rme9652/rme9652.c +1 -2
@@ -2158,13 +2158,12 @@ static int snd_rme9652_prepare(struct snd_pcm_substream *substream) {struct snd_rme9652 *rme9652 =snd_pcm_substream_chip (substream);unsigned long flags; -int result =0 ;spin_lock_irqsave (&rme9652->lock, flags);if (!rme9652->running)rme9652_reset_hw_pointer (rme9652);spin_unlock_irqrestore (&rme9652->lock, flags); -return result; +return 0 ; } static const struct snd_pcm_hardware snd_rme9652_playback_subinfo =
sound/ppc/snd_ps3.c +1 -2
@@ -628,7 +628,6 @@ static int snd_ps3_pcm_trigger(struct snd_pcm_substream *substream, int cmd) {struct snd_ps3_card_info *card =snd_pcm_substream_chip (substream); -int ret =0 ;switch (cmd) {case SNDRV_PCM_TRIGGER_START :
@@ -665,7 +664,7 @@ static int snd_ps3_pcm_trigger(struct snd_pcm_substream *substream, } -return ret; +return 0 ; };/*
The pull request you sent on Thu, 18 Jul 2019 12:03:48 +0200:
The pull request you sent on Thu, 18 Jul 2019 12:03:48 +0200:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.gittags/sound-fix-5.3-rc1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/2ae048e16636afd7521270acacb08d9c42fd23f0
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker