Skip to content

Commit 8abe042

Browse files
committed
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/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 0642a3c commit 8abe042

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sound/pci/hda/hda_intel.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,8 @@ static int __maybe_unused param_set_xint(const char *val, const struct kernel_pa
933933
mutex_lock(&card_list_lock);
934934
list_for_each_entry(hda, &card_list, list) {
935935
chip = &hda->chip;
936-
if (!hda->probe_continued || chip->disabled)
936+
if (!hda->probe_continued || chip->disabled ||
937+
hda->runtime_pm_disabled)
937938
continue;
938939
snd_hda_set_power_save(&chip->bus, power_save * 1000);
939940
}
@@ -2243,6 +2244,7 @@ static const struct snd_pci_quirk power_save_denylist[] = {
22432244

22442245
static void set_default_power_save(struct azx *chip)
22452246
{
2247+
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
22462248
int val = power_save;
22472249

22482250
if (pm_blacklist) {
@@ -2253,6 +2255,7 @@ static void set_default_power_save(struct azx *chip)
22532255
dev_info(chip->card->dev, "device %04x:%04x is on the power_save denylist, forcing power_save to 0\n",
22542256
q->subvendor, q->subdevice);
22552257
val = 0;
2258+
hda->runtime_pm_disabled = 1;
22562259
}
22572260
}
22582261
snd_hda_set_power_save(&chip->bus, val * 1000);

sound/pci/hda/hda_intel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct hda_intel {
2222
/* extra flags */
2323
unsigned int irq_pending_warned:1;
2424
unsigned int probe_continued:1;
25+
unsigned int runtime_pm_disabled:1;
2526

2627
/* vga_switcheroo setup */
2728
unsigned int use_vga_switcheroo:1;

0 commit comments

Comments
 (0)