Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda - Revert power_save option default value

With the commit 1ba8f9d30817 ("ALSA: hda: Add a power_save
blacklist"), we changed the default value of power_save option to -1
for processing the power-save blacklist.
Unfortunately, this seems breaking user-space applications that
actually read the power_save parameter value via sysfs and judge /
adjust the power-saving status. They see the value -1 as if the
power-save is turned off, although the actual value is taken from
CONFIG_SND_HDA_POWER_SAVE_DEFAULT and it can be a positive.

So, overall, passing -1 there was no good idea. Let's partially
revert it -- at least for power_save option default value is restored
again to CONFIG_SND_HDA_POWER_SAVE_DEFAULT. Meanwhile, in this patch,
we keep the blacklist behavior and make is adjustable via the new
option, pm_blacklist.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199073
Fixes: 1ba8f9d30817 ("ALSA: hda: Add a power_save blacklist")
Acked-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+6 -3
+6 -3
sound/pci/hda/hda_intel.c
··· 181 181 }; 182 182 #define param_check_xint param_check_int 183 183 184 - static int power_save = -1; 184 + static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; 185 185 module_param(power_save, xint, 0644); 186 186 MODULE_PARM_DESC(power_save, "Automatic power-saving timeout " 187 187 "(in second, 0 = disable)."); 188 + 189 + static bool pm_blacklist = true; 190 + module_param(pm_blacklist, bool, 0644); 191 + MODULE_PARM_DESC(pm_blacklist, "Enable power-management blacklist"); 188 192 189 193 /* reset the HD-audio controller in power save mode. 190 194 * this may give more power-saving, but will take longer time to ··· 2304 2300 2305 2301 val = power_save; 2306 2302 #ifdef CONFIG_PM 2307 - if (val == -1) { 2303 + if (pm_blacklist) { 2308 2304 const struct snd_pci_quirk *q; 2309 2305 2310 - val = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; 2311 2306 q = snd_pci_quirk_lookup(chip->pci, power_save_blacklist); 2312 2307 if (q && val) { 2313 2308 dev_info(chip->card->dev, "device %04x:%04x is on the power_save blacklist, forcing power_save to 0\n",