Skip to content

Commit 472e18f

Browse files
ideaktiwai
authored andcommitted
ALSA: hda: Release controller display power during shutdown/reboot
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/[email protected] Reported-and-tested-by: Thomas Voegtle <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 0ac05b2 commit 472e18f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

sound/pci/hda/hda_intel.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,14 @@ static unsigned int azx_get_pos_skl(struct azx *chip, struct azx_dev *azx_dev)
883883
return azx_get_pos_posbuf(chip, azx_dev);
884884
}
885885

886+
static void azx_shutdown_chip(struct azx *chip)
887+
{
888+
azx_stop_chip(chip);
889+
azx_enter_link_reset(chip);
890+
azx_clear_irq_pending(chip);
891+
display_power(chip, false);
892+
}
893+
886894
#ifdef CONFIG_PM
887895
static DEFINE_MUTEX(card_list_lock);
888896
static LIST_HEAD(card_list);
@@ -942,14 +950,6 @@ static bool azx_is_pm_ready(struct snd_card *card)
942950
return true;
943951
}
944952

945-
static void __azx_runtime_suspend(struct azx *chip)
946-
{
947-
azx_stop_chip(chip);
948-
azx_enter_link_reset(chip);
949-
azx_clear_irq_pending(chip);
950-
display_power(chip, false);
951-
}
952-
953953
static void __azx_runtime_resume(struct azx *chip)
954954
{
955955
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
@@ -1028,7 +1028,7 @@ static int azx_suspend(struct device *dev)
10281028

10291029
chip = card->private_data;
10301030
bus = azx_bus(chip);
1031-
__azx_runtime_suspend(chip);
1031+
azx_shutdown_chip(chip);
10321032
if (bus->irq >= 0) {
10331033
free_irq(bus->irq, chip);
10341034
bus->irq = -1;
@@ -1107,7 +1107,7 @@ static int azx_runtime_suspend(struct device *dev)
11071107
/* enable controller wake up event */
11081108
azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) | STATESTS_INT_MASK);
11091109

1110-
__azx_runtime_suspend(chip);
1110+
azx_shutdown_chip(chip);
11111111
trace_azx_runtime_suspend(chip);
11121112
return 0;
11131113
}
@@ -2385,7 +2385,7 @@ static void azx_shutdown(struct pci_dev *pci)
23852385
return;
23862386
chip = card->private_data;
23872387
if (chip && chip->running)
2388-
azx_stop_chip(chip);
2388+
azx_shutdown_chip(chip);
23892389
}
23902390

23912391
/* PCI IDs */

0 commit comments

Comments
 (0)