From: Hans de Goede <hdegoede@redhat.com>
To: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: hda - Revert power_save option default value
Date: Mon, 12 Mar 2018 14:14:53 +0100 [thread overview]
Message-ID: <534c274a-b0b4-f96f-7812-edd4d7ce67df@redhat.com> (raw)
In-Reply-To: <20180312130440.27134-1-tiwai@suse.de>
Hi,
On 12-03-18 14:04, Takashi Iwai wrote:
> 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")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Thank you for taking care of this and not just reverting my patch.
Your fix looks good to me:
Acked-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> sound/pci/hda/hda_intel.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 96143df19b21..d5017adf9feb 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -181,11 +181,15 @@ static const struct kernel_param_ops param_ops_xint = {
> };
> #define param_check_xint param_check_int
>
> -static int power_save = -1;
> +static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT;
> module_param(power_save, xint, 0644);
> MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
> "(in second, 0 = disable).");
>
> +static bool pm_blacklist = true;
> +module_param(pm_blacklist, bool, 0644);
> +MODULE_PARM_DESC(pm_blacklist, "Enable power-management blacklist");
> +
> /* reset the HD-audio controller in power save mode.
> * this may give more power-saving, but will take longer time to
> * wake up.
> @@ -2300,10 +2304,9 @@ static int azx_probe_continue(struct azx *chip)
>
> val = power_save;
> #ifdef CONFIG_PM
> - if (val == -1) {
> + if (pm_blacklist) {
> const struct snd_pci_quirk *q;
>
> - val = CONFIG_SND_HDA_POWER_SAVE_DEFAULT;
> q = snd_pci_quirk_lookup(chip->pci, power_save_blacklist);
> if (q && val) {
> dev_info(chip->card->dev, "device %04x:%04x is on the power_save blacklist, forcing power_save to 0\n",
>
prev parent reply other threads:[~2018-03-12 13:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 13:04 [PATCH] ALSA: hda - Revert power_save option default value Takashi Iwai
2018-03-12 13:14 ` Hans de Goede [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=534c274a-b0b4-f96f-7812-edd4d7ce67df@redhat.com \
--to=hdegoede@redhat.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).