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: <B8EFE96D1287C24090BAD9D858E15E6172F2C0@sisaex02sj>
Date:	Mon, 24 Jun 2013 16:20:06 +0000
From:	Shuah Khan <shuah.kh@...sung.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	"pavel@....cz" <pavel@....cz>,
	"len.brown@...el.com" <len.brown@...el.com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"airlied@...ux.ie" <airlied@...ux.ie>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	"shuahkhan@...il.com" <shuahkhan@...il.com>,
	Shuah Khan <shuah.kh@...sung.com>
Subject: Re: [PATCH 1/2] power: add new interface to return pm_transition state

On 06/22/2013 03:17 PM, Rafael J. Wysocki wrote:
> On Saturday, June 22, 2013 02:11:14 PM Shuah Khan wrote:
>> Add a new interface get_pm_transition() to return pm_transition state.
>> This interface is intended to be used from dev_pm_ops class and type
>> suspend interfaces that call legacy pm ops driver suspend interfaces.
>> Legacy suspend pm_ops take pm_message_t as a parameter.
>>
>> e.g: drm_class_suspend() calls into driver suspend routines
>> via drm_dev->driver->suspend(drm_dev, state).
>>
>> Once drm_class_suspend() is converted to dev_pm_ops, it will no longer
>> have access to pm_transition which it has to pass into driver legacy
>> suspend calls. get_pm_transition() interface addresses this need.
>
> That shouldn't be necessary because each transition has its own callback
> in strict dev_pm_ops.
>
> Thanks,
> Rafael
>

Yes that is correct that there is no need pass in or know pm_transition 
with dev_pm_ops. The issue I am running into is the legacy pm_ops class 
suspend/resume routines call. In the example, I mentioned in my 
changelog, drm_class_suspend() calls legacy pm_ops and passes in state. 
It passes in the state to the driver legacy suspend routine. I have seen 
code paths in drivers that differentiate between PM_EVENT_FREEZE, 
PM_EVENT_SUSPEND, PM_EVENT_SLEEP etc.

I considered passing PM_EVENT_SUSPEND to 
drm_dev->driver->suspend(drm_dev, state) from drm_class_suspend() which 
would eliminate the need for this new interface. However, I am concerned 
about breaking driver legacy suspend routines that key of off the state 
to execute different code paths for PM_EVENT_FREEZE vs. 
PM_EVENT_SUSPEND. Suspend routines get called when state is is 
PM_EVENT_FREEZE based on my testing.

I would rather not add a new interface. Hoping you will have another 
idea on how to pass in the state to legacy suspend/resume without adding 
this new interface. My thinking is that this new interface is temporary 
measure until all of the legacy suspend routines get converted to 
dev_pm_ops and at the tile legacy interface gets removed, this new 
interface can go away as well.

thanks,
-- Shuah

Shuah Khan, Linux Kernel Developer - Open Source Group Samsung Research 
America (Silicon Valley) shuah.kh@...sung.com | (970) 672-0658
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ