]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ALSA: hda: Flush pending unsolicited events before suspend
authorTakashi Iwai <tiwai@suse.de>
Wed, 10 Mar 2021 11:28:07 +0000 (12:28 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 17 Mar 2021 18:39:56 +0000 (13:39 -0500)
BugLink: https://bugs.launchpad.net/bugs/1919492
commit 13661fc48461282e43fe8f76bf5bf449b3d40687 upstream.

The HD-audio controller driver processes the unsolicited events via
its work asynchronously, and this might be pending when the system
goes to suspend.  When a lengthy event handling like ELD byte reads is
running, this might trigger unexpected accesses among suspend/resume
procedure, typically seen with Nvidia driver that still requires the
handling via unsolicited event verbs for ELD updates.

This patch adds the flush of unsol_work to assure that pending events
are processed before going into suspend.

Buglink: https://bugzilla.suse.com/show_bug.cgi?id=1182377
Reported-and-tested-by: Abhishek Sahu <abhsahu@nvidia.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210310112809.9215-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
sound/pci/hda/hda_intel.c

index 1233d4ee8a39d53f24d0e6db479aa46a58758efd..253d538251ae1a1ceb91bbb002bb4a7171d3bfe9 100644 (file)
@@ -1026,6 +1026,8 @@ static int azx_prepare(struct device *dev)
        chip = card->private_data;
        chip->pm_prepared = 1;
 
+       flush_work(&azx_bus(chip)->unsol_work);
+
        /* HDA controller always requires different WAKEEN for runtime suspend
         * and system suspend, so don't use direct-complete here.
         */