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: <38def9e9-5161-9441-c88a-43b21edfec43@amd.com>
Date:   Tue, 13 Jul 2021 12:06:38 +0530
From:   "Mukunda,Vijendar" <vijendar.mukunda@....com>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        broonie@...nel.org, alsa-devel@...a-project.org
Cc:     Sunil-kumar.Dommati@....com, Liam Girdwood <lgirdwood@...il.com>,
        open list <linux-kernel@...r.kernel.org>,
        Takashi Iwai <tiwai@...e.com>, Alexander.Deucher@....com
Subject: Re: [PATCH 10/12] ASoC: amd: add vangogh pci driver pm ops

On 7/8/21 5:11 PM, Mukunda,Vijendar wrote:
> On 7/7/21 10:04 PM, Pierre-Louis Bossart wrote:
>>
>>> +static int snd_acp5x_suspend(struct device *dev)
>>> +{
>>> +	int ret;
>>> +	struct acp5x_dev_data *adata;
>>> +
>>> +	adata = dev_get_drvdata(dev);
>>> +	ret = acp5x_deinit(adata->acp5x_base);
>>> +	if (ret)
>>> +		dev_err(dev, "ACP de-init failed\n");
>>> +	else
>>> +		dev_dbg(dev, "ACP de-initialized\n");
>>> +
>>> +	return ret;
>>> +}
>>> +
>>> +static int snd_acp5x_resume(struct device *dev)
>>> +{
>>> +	int ret;
>>> +	struct acp5x_dev_data *adata;
>>> +
>>> +	adata = dev_get_drvdata(dev);
>>> +	ret = acp5x_init(adata->acp5x_base);
>>> +	if (ret) {
>>> +		dev_err(dev, "ACP init failed\n");
>>> +		return ret;
>>> +	}
>>> +	return 0;
>>> +}
>>> +
>>> +static const struct dev_pm_ops acp5x_pm = {
>>> +	.runtime_suspend = snd_acp5x_suspend,
>>> +	.runtime_resume =  snd_acp5x_resume,
>>> +	.resume =	snd_acp5x_resume,
>>
>> use SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS?
> 
suspend and resume callbacks implementation is same for runtime pm ops
and system level pm ops in ACP PCI driver i.e in suspend callback acp
de-init sequence will be invoked and in resume callback acp init
sequence will be invoked.
As per our understanding if we safeguard code with CONFIG_PM_SLEEP
macro, then runtime pm ops won't work.

Do we need to duplicate the same code as mentioned below?

static const struct dev_pm_ops acp5x_pm = {
        SET_RUNTIME_PM_OPS(snd_acp5x_runtime_suspend,
                           snd_acp5x_runtime_resume, NULL)
        SET_SYSTEM_SLEEP_PM_OPS(snd_acp5x_suspend, snd_acp5x_resume)
};

where snd_acp5x_runtime_suspend() & snd_acp5x_suspend() API
implementation is same. Similarly snd_acp5x_runtime_resume() &
snd_acp5x_resume() implementation is same.
>  We will modify the code.
>>
>> also not clear why you don't have a .suspend here
> It was a miss. we will add .suspend callback which invokes same callback
> "snd_acp5x_suspend".
>>
>> And to avoid warnings use __maybe_unused for those callbacks when PM is disabled?
>>
> Agreed. We will modify the code and post the new version.
>>
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ