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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ace7e7f7-c3bf-f38c-0e70-da826175e3c5@linux.intel.com>
Date:   Mon, 8 Apr 2019 12:43:47 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Jan Kotas <jank@...ence.com>
Cc:     "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "vkoul@...nel.org" <vkoul@...nel.org>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        "sanyog.r.kale@...el.com" <sanyog.r.kale@...el.com>
Subject: Re: [alsa-devel] [PATCH] soundwire: fix pm_runtime_get_sync return
 code checks



On 4/8/19 2:12 AM, Jan Kotas wrote:
> 
> 
>> On 5 Apr 2019, at 17:04, Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com> wrote:
>>
>> On 4/5/19 2:26 AM, Jan Kotas wrote:
>>>
>>>   
>>>   	ret = pm_runtime_get_sync(slave->bus->dev);
>>> -	if (ret < 0)
>>> +	if (ret < 0 && ret != -EACCES)
>>>
>> There was a patch submitted on 3/28 by Srinivas Kandagatla who suggested an alternate solution for exactly the same code.
>>
>> +	if (pm_runtime_enabled(slave->bus->dev)) {
>> +		ret = pm_runtime_get_sync(slave->bus->dev);
>> +		if (ret < 0)
>> +			return ret;
>>
>> I am far from an expert on pm_runtime but Srinivas' solution looks more elegant to me.
> 
> Hello Pierre,
> 
> Please take a look at this patch, that was my inspiration:
> https://lists.linuxfoundation.org/pipermail/linux-pm/2011-June/031930.html

The two patches seems to be identical:

static inline bool pm_runtime_enabled(struct device *dev)
{
	return !dev->power.disable_depth;
}

static int rpm_resume()
[...]
else if (dev->power.disable_depth > 0)
		retval = -EACCES;


However I am still not clear on why this might fail.

I can only think of one possible explanation: there is no explicit 
pm_runtime_enable() in the soundwire code, so maybe the expectation is 
that the pm_runtime status is inherited from the parent (in the intel 
case the PCI driver), and that's missing in non-intel configurations?

> I also took a look, and it seems the value returned by
> pm_runtime_get_syncis simply ignored in a lot of places,
> so checking its value may be excessive.
But not checking seems careless at best...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ