From: Greg Kroah-Hartman Date: Wed, 30 Dec 2020 15:40:21 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.19.165~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfef5be16f96f0b773e7488cbb623821bdf67b7d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alsa-hda-ca0132-fix-work-handling-in-delayed-hp-detection.patch alsa-hda-fix-a-wrong-fixup-for-alc289-on-dell-machines.patch alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch alsa-hda-realtek-support-dell-headset-mode-for-alc3271.patch alsa-usb-audio-fix-sync-ep-altsetting-sanity-check.patch alsa-usb-audio-simplify-set_sync_ep_implicit_fb_quirk.patch --- diff --git a/queue-4.4/alsa-hda-ca0132-fix-work-handling-in-delayed-hp-detection.patch b/queue-4.4/alsa-hda-ca0132-fix-work-handling-in-delayed-hp-detection.patch new file mode 100644 index 00000000000..f700803e0ac --- /dev/null +++ b/queue-4.4/alsa-hda-ca0132-fix-work-handling-in-delayed-hp-detection.patch @@ -0,0 +1,66 @@ +From foo@baz Wed Dec 30 04:31:21 PM CET 2020 +From: Takashi Iwai +Date: Fri, 13 Dec 2019 09:51:11 +0100 +Subject: ALSA: hda/ca0132 - Fix work handling in delayed HP detection + +From: Takashi Iwai + +commit 42fb6b1d41eb5905d77c06cad2e87b70289bdb76 upstream + +CA0132 has the delayed HP jack detection code that is invoked from the +unsol handler, but it does a few weird things: it contains the cancel +of a work inside the work handler, and yet it misses the cancel-sync +call at (runtime-)suspend. This patch addresses those issues. + +Fixes: 15c2b3cc09a3 ("ALSA: hda/ca0132 - Fix possible workqueue stall") +Cc: +Link: https://lore.kernel.org/r/20191213085111.22855-4-tiwai@suse.de +Signed-off-by: Takashi Iwai +[sudip: adjust context] +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_ca0132.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/patch_ca0132.c ++++ b/sound/pci/hda/patch_ca0132.c +@@ -4443,11 +4443,10 @@ static void hp_callback(struct hda_codec + /* Delay enabling the HP amp, to let the mic-detection + * state machine run. + */ +- cancel_delayed_work(&spec->unsol_hp_work); +- schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(500)); + tbl = snd_hda_jack_tbl_get(codec, cb->nid); + if (tbl) + tbl->block_report = 1; ++ schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(500)); + } + + static void amic_callback(struct hda_codec *codec, struct hda_jack_callback *cb) +@@ -4625,12 +4624,25 @@ static void ca0132_free(struct hda_codec + kfree(codec->spec); + } + ++#ifdef CONFIG_PM ++static int ca0132_suspend(struct hda_codec *codec) ++{ ++ struct ca0132_spec *spec = codec->spec; ++ ++ cancel_delayed_work_sync(&spec->unsol_hp_work); ++ return 0; ++} ++#endif ++ + static struct hda_codec_ops ca0132_patch_ops = { + .build_controls = ca0132_build_controls, + .build_pcms = ca0132_build_pcms, + .init = ca0132_init, + .free = ca0132_free, + .unsol_event = snd_hda_jack_unsol_event, ++#ifdef CONFIG_PM ++ .suspend = ca0132_suspend, ++#endif + }; + + static void ca0132_config(struct hda_codec *codec) diff --git a/queue-4.4/alsa-hda-fix-a-wrong-fixup-for-alc289-on-dell-machines.patch b/queue-4.4/alsa-hda-fix-a-wrong-fixup-for-alc289-on-dell-machines.patch new file mode 100644 index 00000000000..cf07b1cfe3e --- /dev/null +++ b/queue-4.4/alsa-hda-fix-a-wrong-fixup-for-alc289-on-dell-machines.patch @@ -0,0 +1,36 @@ +From foo@baz Wed Dec 30 04:31:21 PM CET 2020 +From: Hui Wang +Date: Fri, 2 Mar 2018 13:05:36 +0800 +Subject: ALSA: hda - Fix a wrong FIXUP for alc289 on Dell machines + +From: Hui Wang + +commit d5078193e56bb24f4593f00102a3b5e07bb84ee0 upstream + +With the alc289, the Pin 0x1b is Headphone-Mic, so we should assign +ALC269_FIXUP_DELL4_MIC_NO_PRESENCE rather than +ALC225_FIXUP_DELL1_MIC_NO_PRESENCE to it. And this change is suggested +by Kailang of Realtek and is verified on the machine. + +Fixes: 3f2f7c553d07 ("ALSA: hda - Fix headset mic detection problem for two Dell machines") +Cc: Kailang Yang +Cc: +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6121,7 +6121,7 @@ static const struct snd_hda_pin_quirk al + {0x12, 0x90a60120}, + {0x14, 0x90170110}, + {0x21, 0x0321101f}), +- SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, ++ SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, + {0x12, 0xb7a60130}, + {0x14, 0x90170110}, + {0x21, 0x04211020}), diff --git a/queue-4.4/alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch b/queue-4.4/alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch new file mode 100644 index 00000000000..8191f3fd626 --- /dev/null +++ b/queue-4.4/alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch @@ -0,0 +1,50 @@ +From foo@baz Wed Dec 30 04:31:21 PM CET 2020 +From: Kailang Yang +Date: Tue, 26 Nov 2019 17:04:23 +0800 +Subject: ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236 + +From: Kailang Yang + +commit e1e8c1fdce8b00fce08784d9d738c60ebf598ebc upstream + +headphone have noise even the volume is very small. +Let it fill up pcbeep hidden register to default value. +The issue was gone. + +Fixes: 4344aec84bd8 ("ALSA: hda/realtek - New codec support for ALC256") +Fixes: 736f20a70608 ("ALSA: hda/realtek - Add support for ALC236/ALC3204") +Signed-off-by: Kailang Yang +Cc: +Link: https://lore.kernel.org/r/9ae47f23a64d4e41a9c81e263cd8a250@realtek.com +Signed-off-by: Takashi Iwai +[sudip: adjust context] +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -330,9 +330,7 @@ static void alc_fill_eapd_coef(struct hd + case 0x10ec0225: + case 0x10ec0233: + case 0x10ec0235: +- case 0x10ec0236: + case 0x10ec0255: +- case 0x10ec0256: + case 0x10ec0282: + case 0x10ec0283: + case 0x10ec0286: +@@ -342,6 +340,11 @@ static void alc_fill_eapd_coef(struct hd + case 0x10ec0299: + alc_update_coef_idx(codec, 0x10, 1<<9, 0); + break; ++ case 0x10ec0236: ++ case 0x10ec0256: ++ alc_write_coef_idx(codec, 0x36, 0x5757); ++ alc_update_coef_idx(codec, 0x10, 1<<9, 0); ++ break; + case 0x10ec0285: + case 0x10ec0293: + alc_update_coef_idx(codec, 0xa, 1<<13, 0); diff --git a/queue-4.4/alsa-hda-realtek-support-dell-headset-mode-for-alc3271.patch b/queue-4.4/alsa-hda-realtek-support-dell-headset-mode-for-alc3271.patch new file mode 100644 index 00000000000..54294c657b2 --- /dev/null +++ b/queue-4.4/alsa-hda-realtek-support-dell-headset-mode-for-alc3271.patch @@ -0,0 +1,60 @@ +From foo@baz Wed Dec 30 04:31:21 PM CET 2020 +From: Kailang Yang +Date: Thu, 29 Jun 2017 15:21:27 +0800 +Subject: ALSA: hda/realtek - Support Dell headset mode for ALC3271 + +From: Kailang Yang + +commit fcc6c877a01f83cbce1cca885ea62df6a10d33c3 upstream + +Add DELL4_MIC_NO_PRESENCE model. +Add the pin configuration value of this machine into the pin_quirk +table to make DELL4_MIC_NO_PRESENCE apply to this machine. + +Signed-off-by: Kailang Yang +Signed-off-by: Takashi Iwai +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4848,6 +4848,7 @@ enum { + ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, + ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, ++ ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, + ALC269_FIXUP_HEADSET_MODE, + ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, + ALC269_FIXUP_ASPIRE_HEADSET_MIC, +@@ -5150,6 +5151,16 @@ static const struct hda_fixup alc269_fix + .chained = true, + .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC + }, ++ [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ ++ { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ ++ { } ++ }, ++ .chained = true, ++ .chain_id = ALC269_FIXUP_HEADSET_MODE ++ }, + [ALC269_FIXUP_HEADSET_MODE] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_headset_mode, +@@ -6194,6 +6205,11 @@ static const struct snd_hda_pin_quirk al + {0x17, 0x90170110}, + {0x1a, 0x03011020}, + {0x21, 0x03211030}), ++ SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, ++ ALC225_STANDARD_PINS, ++ {0x12, 0xb7a60130}, ++ {0x13, 0xb8a60140}, ++ {0x17, 0x90170110}), + {} + }; + diff --git a/queue-4.4/alsa-usb-audio-fix-sync-ep-altsetting-sanity-check.patch b/queue-4.4/alsa-usb-audio-fix-sync-ep-altsetting-sanity-check.patch new file mode 100644 index 00000000000..baf2424a931 --- /dev/null +++ b/queue-4.4/alsa-usb-audio-fix-sync-ep-altsetting-sanity-check.patch @@ -0,0 +1,42 @@ +From foo@baz Wed Dec 30 04:31:21 PM CET 2020 +From: Johan Hovold +Date: Tue, 14 Jan 2020 09:39:53 +0100 +Subject: ALSA: usb-audio: fix sync-ep altsetting sanity check + +From: Johan Hovold + +commit 5d1b71226dc4d44b4b65766fa9d74492f9d4587b upstream + +The altsetting sanity check in set_sync_ep_implicit_fb_quirk() was +checking for there to be at least one altsetting but then went on to +access the second one, which may not exist. + +This could lead to random slab data being used to initialise the sync +endpoint in snd_usb_add_endpoint(). + +Fixes: c75a8a7ae565 ("ALSA: snd-usb: add support for implicit feedback") +Fixes: ca10a7ebdff1 ("ALSA: usb-audio: FT C400 sync playback EP to capture EP") +Fixes: 5e35dc0338d8 ("ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204") +Fixes: 17f08b0d9aaf ("ALSA: usb-audio: add implicit fb quirk for Axe-Fx II") +Fixes: 103e9625647a ("ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk") +Cc: stable # 3.5 +Signed-off-by: Johan Hovold +Link: https://lore.kernel.org/r/20200114083953.1106-1-johan@kernel.org +Signed-off-by: Takashi Iwai +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/pcm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -365,7 +365,7 @@ static int set_sync_ep_implicit_fb_quirk + add_sync_ep_from_ifnum: + iface = usb_ifnum_to_if(dev, ifnum); + +- if (!iface || iface->num_altsetting == 0) ++ if (!iface || iface->num_altsetting < 2) + return -EINVAL; + + alts = &iface->altsetting[1]; diff --git a/queue-4.4/alsa-usb-audio-simplify-set_sync_ep_implicit_fb_quirk.patch b/queue-4.4/alsa-usb-audio-simplify-set_sync_ep_implicit_fb_quirk.patch new file mode 100644 index 00000000000..e569e15259d --- /dev/null +++ b/queue-4.4/alsa-usb-audio-simplify-set_sync_ep_implicit_fb_quirk.patch @@ -0,0 +1,85 @@ +From foo@baz Wed Dec 30 04:31:21 PM CET 2020 +From: Alberto Aguirre +Date: Wed, 18 Apr 2018 09:35:34 -0500 +Subject: ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk + +From: Alberto Aguirre + +commit 103e9625647ad74d201e26fb74afcd8479142a37 upstream + +Signed-off-by: Alberto Aguirre +Signed-off-by: Takashi Iwai +[sudip: adjust context] +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/pcm.c | 38 ++++++++++++++++---------------------- + 1 file changed, 16 insertions(+), 22 deletions(-) + +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -324,6 +324,7 @@ static int set_sync_ep_implicit_fb_quirk + struct usb_host_interface *alts; + struct usb_interface *iface; + unsigned int ep; ++ unsigned int ifnum; + + /* Implicit feedback sync EPs consumers are always playback EPs */ + if (subs->direction != SNDRV_PCM_STREAM_PLAYBACK) +@@ -334,34 +335,19 @@ static int set_sync_ep_implicit_fb_quirk + case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */ + case USB_ID(0x22f0, 0x0006): /* Allen&Heath Qu-16 */ + ep = 0x81; +- iface = usb_ifnum_to_if(dev, 3); +- +- if (!iface || iface->num_altsetting == 0) +- return -EINVAL; +- +- alts = &iface->altsetting[1]; +- goto add_sync_ep; +- break; ++ ifnum = 3; ++ goto add_sync_ep_from_ifnum; + case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */ + case USB_ID(0x0763, 0x2081): + ep = 0x81; +- iface = usb_ifnum_to_if(dev, 2); +- +- if (!iface || iface->num_altsetting == 0) +- return -EINVAL; +- +- alts = &iface->altsetting[1]; +- goto add_sync_ep; ++ ifnum = 2; ++ goto add_sync_ep_from_ifnum; + case USB_ID(0x1397, 0x0002): + ep = 0x81; +- iface = usb_ifnum_to_if(dev, 1); +- +- if (!iface || iface->num_altsetting == 0) +- return -EINVAL; +- +- alts = &iface->altsetting[1]; +- goto add_sync_ep; ++ ifnum = 1; ++ goto add_sync_ep_from_ifnum; + } ++ + if (attr == USB_ENDPOINT_SYNC_ASYNC && + altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC && + altsd->bInterfaceProtocol == 2 && +@@ -376,6 +362,14 @@ static int set_sync_ep_implicit_fb_quirk + /* No quirk */ + return 0; + ++add_sync_ep_from_ifnum: ++ iface = usb_ifnum_to_if(dev, ifnum); ++ ++ if (!iface || iface->num_altsetting == 0) ++ return -EINVAL; ++ ++ alts = &iface->altsetting[1]; ++ + add_sync_ep: + subs->sync_endpoint = snd_usb_add_endpoint(subs->stream->chip, + alts, ep, !subs->direction, diff --git a/queue-4.4/series b/queue-4.4/series index e69de29bb2d..a6d38d7d489 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -0,0 +1,6 @@ +alsa-hda-ca0132-fix-work-handling-in-delayed-hp-detection.patch +alsa-usb-audio-simplify-set_sync_ep_implicit_fb_quirk.patch +alsa-usb-audio-fix-sync-ep-altsetting-sanity-check.patch +alsa-hda-realtek-support-dell-headset-mode-for-alc3271.patch +alsa-hda-fix-a-wrong-fixup-for-alc289-on-dell-machines.patch +alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch