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]
Date:   Thu, 28 Jan 2021 09:09:59 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     Kai-Heng Feng <kai.heng.feng@...onical.com>
Cc:     rjw@...ysocki.net, kenny@...ix.com, Pavel Machek <pavel@....cz>,
        Len Brown <len.brown@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-pm@...r.kernel.org (open list:HIBERNATION (aka Software Suspend,
        aka swsusp)), linux-kernel@...r.kernel.org (open list)
Subject: Re: [PATCH] PM: sleep: core: Resume suspended device if direct-complete is disabled

On Thu, 31 Dec 2020 07:03:19 +0100,
Kai-Heng Feng wrote:
> 
> HDA controller can't be runtime-suspended after commit 215a22ed31a1
> ("ALSA: hda: Refactor codjc PM to use direct-complete optimization"),
> which enables direct-complete for HDA codec.
> 
> The HDA codec driver doesn't expect direct-complete will be disabled
> after it returns a positive value from prepare() callback. So freeze()
> is called directly when it's runtime-suspended, breaks the balance of
> its internal codec_powered counting.
> 
> So if a device is prepared for direct-complete but PM core breaks the
> assumption, resume the device to keep PM operations balanced.
> 
> Fixes: 215a22ed31a1 ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>

Kai-Heng, is this fix still needed for 5.11?

The description mentions about HD-audio controller, while the recent
revert was the HD-audio codec, so I suppose it's still affected?


thanks,

Takashi

> ---
>  drivers/base/power/main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index 46793276598d..9c0e25a92ad0 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -1849,6 +1849,10 @@ static int device_prepare(struct device *dev, pm_message_t state)
>  		(ret > 0 || dev->power.no_pm_callbacks) &&
>  		!dev_pm_test_driver_flags(dev, DPM_FLAG_NO_DIRECT_COMPLETE);
>  	spin_unlock_irq(&dev->power.lock);
> +
> +	if (ret > 0 && !dev->power.direct_complete)
> +		pm_runtime_resume(dev);
> +
>  	return 0;
>  }
>  
> -- 
> 2.29.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ