From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] PM / sleep: Let devices force direct_complete
Date: Tue, 28 Apr 2015 16:54:57 +0200 [thread overview]
Message-ID: <2306163.VOFFyQbfWp@vostro.rjw.lan> (raw)
In-Reply-To: <CAAObsKAJzu3uJ3ZNKfK3U8Ae4W9STXXdyhVrNYsn0MK2uSoZHA@mail.gmail.com>
On Tuesday, April 28, 2015 04:26:39 PM Tomeu Vizoso wrote:
> On 20 April 2015 at 16:12, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Mon, 20 Apr 2015, Tomeu Vizoso wrote:
> >
> >> On 17 April 2015 at 19:30, Alan Stern <stern@rowland.harvard.edu> wrote:
> >> > On Fri, 17 Apr 2015, Laurent Pinchart wrote:
> >> >
> >> >> Hi Tomeu,
> >> >>
> >> >> Thank you for the patch.
> >> >>
> >> >> On Friday 17 April 2015 17:24:49 Tomeu Vizoso wrote:
> >> >> > Introduce a new per-device flag power.force_direct_complete that will
> >> >> > instruct the PM core to ignore the runtime PM status of its descendants
> >> >> > when deciding whether to let this device remain in runtime suspend when
> >> >> > the system goes into a sleep power state.
> >> >> >
> >> >> > This is needed because otherwise it would be needed to get dozens of
> >> >> > drivers to implement the prepare() callback and be runtime PM active
> >> >> > even if they don't have a 1-to-1 relationship with a piece of HW.
> >> >>
> >> >> I'll let PM experts comment on the approach, but I believe the new flag would
> >> >> benefit from being documented (likely in Documentation/power/devices.txt) :-)
> >> >
> >> > Documentation/power/runtime_pm.txt is the right place.
> >> >
> >> > However, I'm not sure that this is the sort of thing Rafael meant when
> >> > he suggested adding a new flag. I thought he meant the PM core would
> >> > look at the new flag only if there was no ->prepare method at all.
> >> > Then if the new flag was set, the PM core would act as though ->prepare
> >> > had returned 1. That way there would be no need to add silly little
> >> > one-line *_prepare() routines all over the place.
> >> >
> >> > Maybe he had something else in mind, though...
> >>
> >> Yeah, I also interpreted it like that, but when I started looking at
> >> how it would work, I found that it would be awkward if the uvcvideo
> >> driver had to track all the devices that get attached below its
> >> devices in order to set that flag to them.
> >>
> >> When thinking about it, it occurred to me that it may make more sense
> >> if we model this as a property of the device bound to the uvcvideo
> >> driver, as what's happening here is that the uvcvideo driver knows
> >> that it's safe to remain in runtime suspend when the system goes to
> >> sleep, and that all its descendant devices can be ignored in that
> >> regard.
> >
> > What you're proposing makes sense, but it is a significant change to
> > the runtime PM core. It should be submitted separately, not as part of
> > an update to the UVC driver, and it should be discussed at length.
> >
> > Basically, you want to mark certain devices to say that they will
> > _always_ use direct-suspend. This means that all descendant devices
> > will be forced to use direct-suspend also, and therefore any driver
> > bound to one of these descendant devices will be unable to communicate
> > with it during a system sleep transition. This is a non-trivial
> > restriction.
> >
> > Among other things, it means that wakeup settings can't be altered
> > during a sleep transition. Therefore this should be allowed only for
> > devices that are not wakeup-capable.
>
> Hi Rafael,
>
> do you have any comments on this?
Well, what Alan has said sounds correct to me.
Rafael
next prev parent reply other threads:[~2015-04-28 14:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 15:24 [PATCH v3 0/2] Allow UVC devices to remain runtime-suspended when sleeping Tomeu Vizoso
2015-04-17 15:24 ` [PATCH v3 1/2] PM / sleep: Let devices force direct_complete Tomeu Vizoso
2015-04-17 15:33 ` Greg Kroah-Hartman
2015-04-17 15:35 ` Laurent Pinchart
2015-04-17 17:30 ` Alan Stern
2015-04-20 7:10 ` Tomeu Vizoso
2015-04-20 14:12 ` Alan Stern
2015-04-28 14:26 ` Tomeu Vizoso
2015-04-28 14:54 ` Rafael J. Wysocki [this message]
2015-04-30 7:11 ` Ulf Hansson
2015-04-30 14:53 ` Alan Stern
2015-05-06 8:30 ` Ulf Hansson
2015-05-06 14:43 ` Alan Stern
2015-05-06 16:05 ` Ulf Hansson
2015-04-17 15:24 ` [PATCH v3 2/2] [media] uvcvideo: Remain runtime-suspended at sleeps Tomeu Vizoso
2015-04-17 17:32 ` Alan Stern
2015-04-20 7:11 ` Tomeu Vizoso
2015-11-09 21:23 ` Laurent Pinchart
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=2306163.VOFFyQbfWp@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=stern@rowland.harvard.edu \
--cc=tomeu.vizoso@collabora.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