Patch "ALSA: hda: Release controller display power during shutdown/reboot" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ALSA: hda: Release controller display power during shutdown/reboot

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-release-controller-display-power-during-shu.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.



commit b81b3ab0381d1252fe361f6a966cfc13deee7a21
Author: Imre Deak <imre.deak@xxxxxxxxx>
Date:   Wed Jun 23 16:46:00 2021 +0300

    ALSA: hda: Release controller display power during shutdown/reboot
    
    [ Upstream commit 472e18f63c425dda97b888f40f858ea54e3efc17 ]
    
    Make sure the HDA driver's display power reference is released during
    shutdown/reboot.
    
    During the shutdown/reboot sequence the pci device core calls the
    pm_runtime_resume handler for all devices before calling the driver's
    shutdown callback and so the HDA driver's runtime resume callback will
    acquire a display power reference (on HSW/BDW). This triggers a power
    reference held WARN on HSW/BDW in the i915 driver's subsequent shutdown
    handler, which expects all display power references to be released by
    that time.
    
    Since the HDA controller is stopped in the shutdown handler in any case,
    let's follow here the same sequence as the one during runtime suspend.
    This will also reset the HDA link and drop the display power reference,
    getting rid of the above WARN.
    
    Tested on HSW.
    
    v2:
    - Fix the build for CONFIG_PM=n (Takashi)
    - s/__azx_runtime_suspend/azx_shutdown_chip/
    
    Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3618
    References: https://lore.kernel.org/lkml/cea1f9a-52e0-b83-593d-52997fe1aaf6@xxxxxxxxxxxxx
    Reported-and-tested-by: Thomas Voegtle <tv@xxxxxxxx>
    Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20210623134601.2128663-1-imre.deak@xxxxxxxxx
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index a8eae31e47efb..e31eafe73661f 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -936,6 +936,14 @@ static unsigned int azx_get_pos_skl(struct azx *chip, struct azx_dev *azx_dev)
 	return azx_get_pos_posbuf(chip, azx_dev);
 }
 
+static void azx_shutdown_chip(struct azx *chip)
+{
+	azx_stop_chip(chip);
+	azx_enter_link_reset(chip);
+	azx_clear_irq_pending(chip);
+	display_power(chip, false);
+}
+
 #ifdef CONFIG_PM
 static DEFINE_MUTEX(card_list_lock);
 static LIST_HEAD(card_list);
@@ -995,14 +1003,6 @@ static bool azx_is_pm_ready(struct snd_card *card)
 	return true;
 }
 
-static void __azx_runtime_suspend(struct azx *chip)
-{
-	azx_stop_chip(chip);
-	azx_enter_link_reset(chip);
-	azx_clear_irq_pending(chip);
-	display_power(chip, false);
-}
-
 static void __azx_runtime_resume(struct azx *chip)
 {
 	struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
@@ -1081,7 +1081,7 @@ static int azx_suspend(struct device *dev)
 
 	chip = card->private_data;
 	bus = azx_bus(chip);
-	__azx_runtime_suspend(chip);
+	azx_shutdown_chip(chip);
 	if (bus->irq >= 0) {
 		free_irq(bus->irq, chip);
 		bus->irq = -1;
@@ -1160,7 +1160,7 @@ static int azx_runtime_suspend(struct device *dev)
 	/* enable controller wake up event */
 	azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) | STATESTS_INT_MASK);
 
-	__azx_runtime_suspend(chip);
+	azx_shutdown_chip(chip);
 	trace_azx_runtime_suspend(chip);
 	return 0;
 }
@@ -2461,7 +2461,7 @@ static void azx_shutdown(struct pci_dev *pci)
 		return;
 	chip = card->private_data;
 	if (chip && chip->running)
-		azx_stop_chip(chip);
+		azx_shutdown_chip(chip);
 }
 
 /* PCI IDs */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux