From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: "pavel@ucw.cz" <pavel@ucw.cz>,
"len.brown@intel.com" <len.brown@intel.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"airlied@linux.ie" <airlied@linux.ie>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"shuahkhan@gmail.com" <shuahkhan@gmail.com>
Subject: Re: [PATCH 1/2] power: add new interface to return pm_transition state
Date: Mon, 24 Jun 2013 21:44 +0200 [thread overview]
Message-ID: <2196353.NSocUzaxzG@vostro.rjw.lan> (raw)
In-Reply-To: <B8EFE96D1287C24090BAD9D858E15E6172F2C0@sisaex02sj>
On Monday, June 24, 2013 04:20:06 PM Shuah Khan wrote:
> 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.
There are multiple bus types with legacy callbacks. PCI and platform for
two examples and USB does something similar. Please have a look at these.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
prev parent reply other threads:[~2013-06-24 19:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-22 20:11 Shuah Khan
2013-06-22 21:26 ` Rafael J. Wysocki
2013-06-24 16:20 ` Shuah Khan
2013-06-24 19:44 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2196353.NSocUzaxzG@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=shuah.kh@samsung.com \
--cc=shuahkhan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®