Commit 8abe0423 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda: Keep PM disablement for deny-listed instance

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.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0642a3c5
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment