This is a note to let you know that I've just added the patch titled ALSA: hda/hdmi: Cancel pending works before suspend to the 5.10-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-hdmi-cancel-pending-works-before-suspend.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From eea46a0879bcca23e15071f9968c0f6e6596e470 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <tiwai@xxxxxxx> Date: Wed, 10 Mar 2021 12:28:09 +0100 Subject: ALSA: hda/hdmi: Cancel pending works before suspend From: Takashi Iwai <tiwai@xxxxxxx> commit eea46a0879bcca23e15071f9968c0f6e6596e470 upstream. The per_pin->work might be still floating at the suspend, and this may hit the access to the hardware at an unexpected timing. Cancel the work properly at the suspend callback for avoiding the buggy access. Note that the bug doesn't trigger easily in the recent kernels since the work is queued only when the repoll count is set, and usually it's only at the resume callback, but it's still possible to hit in theory. BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1182377 Reported-and-tested-by: Abhishek Sahu <abhsahu@xxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20210310112809.9215-4-tiwai@xxxxxxx Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/pci/hda/patch_hdmi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -2475,6 +2475,18 @@ static void generic_hdmi_free(struct hda } #ifdef CONFIG_PM +static int generic_hdmi_suspend(struct hda_codec *codec) +{ + struct hdmi_spec *spec = codec->spec; + int pin_idx; + + for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { + struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); + cancel_delayed_work_sync(&per_pin->work); + } + return 0; +} + static int generic_hdmi_resume(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; @@ -2498,6 +2510,7 @@ static const struct hda_codec_ops generi .build_controls = generic_hdmi_build_controls, .unsol_event = hdmi_unsol_event, #ifdef CONFIG_PM + .suspend = generic_hdmi_suspend, .resume = generic_hdmi_resume, #endif }; Patches currently in stable-queue which might be from tiwai@xxxxxxx are queue-5.10/alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch queue-5.10/alsa-hda-drop-the-batch-workaround-for-amd-controllers.patch queue-5.10/drm-amd-display-add-a-backlight-module-option.patch queue-5.10/alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch queue-5.10/alsa-hda-flush-pending-unsolicited-events-before-suspend.patch queue-5.10/alsa-usb-audio-fix-use-after-free-in-usb_audio_disconnect.patch queue-5.10/alsa-usb-add-plantronics-c320-m-usb-ctrl-msg-delay-quirk.patch queue-5.10/alsa-usb-audio-disable-usb-autosuspend-properly-in-setup_disable_autosuspend.patch queue-5.10/alsa-usb-audio-fix-null-ptr-dereference-in-usb_audio_probe.patch queue-5.10/alsa-hda-ca0132-add-sound-blasterx-ae-5-plus-support.patch queue-5.10/alsa-hda-conexant-add-quirk-for-mute-led-control-on-hp-zbook-g5.patch queue-5.10/alsa-hda-hdmi-cancel-pending-works-before-suspend.patch queue-5.10/alsa-usb-audio-apply-the-control-quirk-to-plantronics-headsets.patch