]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda: Keep PM disablement for deny-listed instance
authorTakashi Iwai <tiwai@suse.de>
Mon, 29 Jul 2024 14:15:16 +0000 (16:15 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 30 Jul 2024 05:45:49 +0000 (07:45 +0200)
We have a runtime PM deny-list for the devices that show the problems
(typically click noises) at runtime suspend/resume, and when it
matches, the driver disables the default runtime PM.  However, we
still allow the runtime PM changed via power_save module option
dynamically, and the desktop system often tweaks it.  This ended up
with a re-enablement of the runtime PM that surprises users, suddenly
suffering from the noises.

This patch changes the driver behavior slightly: when the device is
listed in the deny-list, ignore the power_save option change and keep
the original (that is, off) runtime PM state.

Link: https://patch.msgid.link/20240729141519.18398-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_intel.h

index b33602e64d174c8af1bf196ee5b0ce90668f9681..440f1b37e071f6825a5c02c1da8f4a6f9b437f77 100644 (file)
@@ -933,7 +933,8 @@ static int __maybe_unused param_set_xint(const char *val, const struct kernel_pa
        mutex_lock(&card_list_lock);
        list_for_each_entry(hda, &card_list, list) {
                chip = &hda->chip;
-               if (!hda->probe_continued || chip->disabled)
+               if (!hda->probe_continued || chip->disabled ||
+                   hda->runtime_pm_disabled)
                        continue;
                snd_hda_set_power_save(&chip->bus, power_save * 1000);
        }
@@ -2243,6 +2244,7 @@ static const struct snd_pci_quirk power_save_denylist[] = {
 
 static void set_default_power_save(struct azx *chip)
 {
+       struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
        int val = power_save;
 
        if (pm_blacklist) {
@@ -2253,6 +2255,7 @@ static void set_default_power_save(struct azx *chip)
                        dev_info(chip->card->dev, "device %04x:%04x is on the power_save denylist, forcing power_save to 0\n",
                                 q->subvendor, q->subdevice);
                        val = 0;
+                       hda->runtime_pm_disabled = 1;
                }
        }
        snd_hda_set_power_save(&chip->bus, val * 1000);
index 0f39418f9328b08e7c34c2db540eed30f734100c..2d1725f86ef17347ab911e7ff52d98cb2f44845c 100644 (file)
@@ -22,6 +22,7 @@ struct hda_intel {
        /* extra flags */
        unsigned int irq_pending_warned:1;
        unsigned int probe_continued:1;
+       unsigned int runtime_pm_disabled:1;
 
        /* vga_switcheroo setup */
        unsigned int use_vga_switcheroo:1;