lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hblewn7ij.wl-tiwai@suse.de>
Date:   Mon, 14 Dec 2020 08:58:44 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     Kai-Heng Feng <kai.heng.feng@...onical.com>
Cc:     tiwai@...e.com, Jaroslav Kysela <perex@...ex.cz>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Guennadi Liakhovetski <guennadi.liakhovetski@...ux.intel.com>,
        Alex Deucher <alexander.deucher@....com>,
        Mike Rapoport <rppt@...nel.org>,
        alsa-devel@...a-project.org (moderated list:SOUND),
        linux-kernel@...r.kernel.org (open list)
Subject: Re: [PATCH] ALSA: hda: Enable runtime PM when codec probe fails

On Mon, 14 Dec 2020 07:06:20 +0100,
Kai-Heng Feng wrote:
> 
> When codec probe fails, it doesn't enable runtime suspend, and can
> prevent graphics card from getting powered down:
> [    4.280991] snd_hda_intel 0000:01:00.1: no codecs initialized
> 
> $ cat /sys/bus/pci/devices/0000:01:00.1/power/runtime_status
> active
> 
> So enable runtime PM when codec probe fails, to let graphics card be
> able to runtime suspend again.

Well, the runtime status is also active if the driver isn't probed at
all.  In that sense, keeping the status active at the driver load
failure is rather consistent, IMO.  If the driver fails or unloaded,
it should restore the status as if it were beforehand.


thanks,

Takashi

> 
> Merge azx_probe_continue() into azx_probe() and just let probe fail for
> this case could be a better approach. However that's a much bigger task
> so let's settle with a quirk workaround.
> 
> BugLink: https://bugs.launchpad.net/bugs/1907212
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
> ---
>  sound/pci/hda/hda_intel.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 6852668f1bcb..3fd920069268 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -2328,7 +2328,7 @@ static int azx_probe_continue(struct azx *chip)
>  	if (bus->codec_mask) {
>  		err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
>  		if (err < 0)
> -			goto out_free;
> +			goto out_enable_rpm;
>  	}
>  
>  #ifdef CONFIG_SND_HDA_PATCH_LOADER
> @@ -2360,6 +2360,7 @@ static int azx_probe_continue(struct azx *chip)
>  
>  	set_default_power_save(chip);
>  
> +out_enable_rpm:
>  	if (azx_has_pm_runtime(chip)) {
>  		pm_runtime_use_autosuspend(&pci->dev);
>  		pm_runtime_allow(&pci->dev);
> -- 
> 2.29.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ