This is a note to let you know that I've just added the patch titled ALSA: hda - Set codec to D3 at reboot/shutdown on Thinkpads to the 4.3-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: alsa-hda-set-codec-to-d3-at-reboot-shutdown-on-thinkpads.patch and it can be found in the queue-4.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 70a0976b0c0d90f4246d7e63359d796ec82b87d6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <tiwai@xxxxxxx> Date: Tue, 15 Dec 2015 14:59:58 +0100 Subject: ALSA: hda - Set codec to D3 at reboot/shutdown on Thinkpads From: Takashi Iwai <tiwai@xxxxxxx> commit 70a0976b0c0d90f4246d7e63359d796ec82b87d6 upstream. Lenovo Thinkpads with Realtek codecs may still have some loud crackling noises at reboot/shutdown even though a few previous fixes have been applied. It's because the previous fix (disabling the default shutup callback) takes effect only at transition of the codec power state. Meanwhile, at reboot or shutdown, we don't take down the codec power as default, thus it triggers the same problem unless the codec is powered down casually by runtime PM. This patch tries to address the issue. It gives two things: - implement the separate reboot_notify hook to struct alc_spec, and call it optionally if defined. - turn off the codec to D3 for Thinkpad models via this new callback Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439 Reported-and-tested-by: Benjamin Poirier <bpoirier@xxxxxxxx> Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/pci/hda/patch_realtek.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -111,6 +111,7 @@ struct alc_spec { void (*power_hook)(struct hda_codec *codec); #endif void (*shutup)(struct hda_codec *codec); + void (*reboot_notify)(struct hda_codec *codec); int init_amp; int codec_variant; /* flag for other variants */ @@ -773,6 +774,25 @@ static inline void alc_shutup(struct hda snd_hda_shutup_pins(codec); } +static void alc_reboot_notify(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + + if (spec && spec->reboot_notify) + spec->reboot_notify(codec); + else + alc_shutup(codec); +} + +/* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */ +static void alc_d3_at_reboot(struct hda_codec *codec) +{ + snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3); + snd_hda_codec_write(codec, codec->core.afg, 0, + AC_VERB_SET_POWER_STATE, AC_PWRST_D3); + msleep(10); +} + #define alc_free snd_hda_gen_free #ifdef CONFIG_PM @@ -818,7 +838,7 @@ static const struct hda_codec_ops alc_pa .suspend = alc_suspend, .check_power_status = snd_hda_gen_check_power_status, #endif - .reboot_notify = alc_shutup, + .reboot_notify = alc_reboot_notify, }; @@ -4209,6 +4229,7 @@ static void alc_fixup_tpt440_dock(struct if (action == HDA_FIXUP_ACT_PRE_PROBE) { spec->shutup = alc_no_shutup; /* reduce click noise */ + spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; codec->power_save_node = 0; /* avoid click noises */ snd_hda_apply_pincfgs(codec, pincfgs); Patches currently in stable-queue which might be from tiwai@xxxxxxx are queue-4.3/alsa-hda-fix-headphone-mic-input-on-a-few-dell-alc293-machines.patch queue-4.3/alsa-hda-add-fixup-for-acer-aspire-one-cloudbook-14.patch queue-4.3/alsa-usb-audio-add-sample-rate-inquiry-quirk-for-audioquest-dragonfly.patch queue-4.3/alsa-hda-realtek-dell-xps-one-alc3260-speaker-no-sound-after-resume-back.patch queue-4.3/alsa-hda-apply-hp-headphone-fixups-more-generically.patch queue-4.3/alsa-hda-set-codec-to-d3-at-reboot-shutdown-on-thinkpads.patch queue-4.3/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch queue-4.3/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch queue-4.3/alsa-fireworks-bebob-oxfw-dice-enable-to-make-as-built-in.patch queue-4.3/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch queue-4.3/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch queue-4.3/alsa-hda-add-intel-lewisburg-device-ids-audio.patch queue-4.3/alsa-hda-add-keycode-map-for-alc-input-device.patch queue-4.3/alsa-hda-add-a-fixup-for-thinkpad-x1-carbon-2nd.patch queue-4.3/alsa-hda-skip-eld-notification-during-system-suspend.patch queue-4.3/alsa-hda-add-mic-mute-hotkey-quirk-for-lenovo-thinkcentre-aio.patch queue-4.3/alsa-hda-disable-64bit-address-for-creative-hda-controllers.patch queue-4.3/alsa-hda-fix-noise-on-dell-latitude-e6440.patch queue-4.3/alsa-hda-ca0132-quirk-for-alienware-17-2015.patch queue-4.3/alsa-usb-audio-add-a-more-accurate-volume-quirk-for-audioquest-dragonfly.patch queue-4.3/alsa-hda-fix-headphone-noise-after-dell-xps-13-resume-back-from-s3.patch queue-4.3/alsa-hda-fix-noise-problems-on-thinkpad-t440s.patch queue-4.3/alsa-hda-fix-lost-4k-bdl-boundary-workaround.patch queue-4.3/alsa-hda-apply-pin-fixup-for-hp-probook-6550b.patch queue-4.3/alsa-hda-fixing-speaker-noise-on-the-two-latest-thinkpad-models.patch queue-4.3/alsa-hda-apply-click-noise-workaround-for-thinkpads-generically.patch queue-4.3/alsa-hda-fix-noise-on-gigabyte-z170x-mobo.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html