From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Pavel Machek <pavel@ucw.cz>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Octavian Purdila <octavian.purdila@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
"Tirdea, Irina" <irina.tirdea@intel.com>,
Oliver Neukum <oneukum@suse.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Brown, Len" <len.brown@intel.com>
Subject: Re: [RFC PATCH] PM / Runtime: runtime: Add sysfs option for forcing runtime suspend
Date: Mon, 21 Sep 2015 11:00:53 -0700 [thread overview]
Message-ID: <20150921180053.GK17389@dtor-ws> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1509211323540.1713-100000@iolanthe.rowland.org>
On Mon, Sep 21, 2015 at 01:32:38PM -0400, Alan Stern wrote:
> On Mon, 21 Sep 2015, Dmitry Torokhov wrote:
>
> > > It sounds like you are suggesting there should be a general mechanism
> > > for userspace to tell the kernel (or the input core) to ignore all
> > > events from a particular input device -- or even from all input devices
> > > -- thereby allowing those devices to go to low power.
> >
> > Yes. In ChromeOS we have a custim "inhibit" control that:
> >
> > 1. Tells input core to ignore all events form a given device
> > 2. Allows driver to put device in low power mode if driver desires to do
> > so. The driver can do it via runtime PM or on it's own. Usually on it's
> > own since when using runtime PM userspace may disable it, which may not
> > be desirable.
> >
> > I would love to have something generic instead of input-specific.
> >
> > >
> > > I don't like to think of this as "forcing runtime suspend". It's more
> > > like telling the kernel that a device is no longer being used, so the
> > > natural runtime PM mechanism can put it in runtime suspend.
> >
> > I'd call it "accelerating" runtime suspend. Userspace tells the kernel
> > that it intends not to use given device and kernel reacts accordingly.
>
> Okay.
>
> > > Perhaps another way to think about it is that these input devices
> > > should not increment their runtime usage counter as part of the open
> > > routine; they should use something other than the number of open file
> > > references to indicate when they can go into runtime suspend. (I'm not
> > > sure what else they should use, though.)
> >
> > I do not really want input specific support; as I mentioned before we
> > have something like that in ChromeOS kernels but I was hesitant bringing
> > it upstream as I believe it is not necessarily input device specific and
> > I would love to have it implemented at device core level.
>
> That's not a bad idea. On the other hand, there must be lots of
> devices which would not be suitable for this. Disk drives, for
> instance.
Of course.
>
> What happens if the "inhibit" control is turned on and the driver puts
> the device into runtime suspend, but then an I/O request arrives?
>
> If the I/O request originated from userspace, it means the
> user is violating the terms of the "inhibit" control. Should
> the request simply fail?
What user? User that inhibited it or user that tried to use the device?
>
> What if the I/O request originated from somewhere in the
> kernel, not from the user?
I think we should treat in-kernel users as all other users.
>
> Or maybe the driver would want to carry out the request,
> overriding the "inhibit" control temporarily. Does it simply
> turn off the control, meaning that the device won't go back
> into runtime suspend until userspace turns the control on
> again?
>
> Or if the driver doesn't turn off the "inhibit" control, then
> how does it know when it can safely put the device back into
> runtime suspend?
>
> Qustions like these make me think that this mechanism is best suited
> for a kind of device that doesn't handle I/O requests. In other words,
> something that just reports events as they occur -- which is another
> way of describing an input device!
Or maybe IIO device. Or hwmon. Or something else. I think if we allow
drivers (or subsystems) to opt in into this mechanism it will solve much
of worries about disks and similar devices that indeed not very suitable
for such mechanism.
Thanks.
-
Dmitry
next prev parent reply other threads:[~2015-09-21 18:00 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 20:42 [RFC PATCH] PM / Runtime: runtime: Add sysfs option for forcing runtime suspend Irina Tirdea
2015-09-07 21:20 ` Rafael J. Wysocki
2015-09-08 1:10 ` Tirdea, Irina
2015-09-08 7:35 ` Oliver Neukum
2015-09-08 20:56 ` Rafael J. Wysocki
2015-09-08 22:25 ` Ulf Hansson
2015-09-08 23:50 ` Rafael J. Wysocki
2015-09-09 11:13 ` Octavian Purdila
2015-09-09 12:22 ` Rafael J. Wysocki
2015-09-09 13:55 ` Oliver Neukum
2015-09-09 15:02 ` Octavian Purdila
2015-09-09 20:25 ` Rafael J. Wysocki
2015-09-10 9:38 ` Oliver Neukum
2015-09-21 12:29 ` Pavel Machek
2015-09-09 15:20 ` Alan Stern
2015-09-09 20:35 ` Rafael J. Wysocki
2015-09-09 20:16 ` Colin Cross
2015-09-21 12:30 ` Pavel Machek
2015-09-21 14:38 ` Alan Stern
2015-09-21 16:16 ` Dmitry Torokhov
2015-09-21 16:34 ` Alan Stern
2015-09-21 16:59 ` Dmitry Torokhov
2015-09-21 17:32 ` Alan Stern
2015-09-21 18:00 ` Dmitry Torokhov [this message]
2015-09-21 20:02 ` Alan Stern
2015-09-21 20:56 ` Dmitry Torokhov
2015-09-22 12:05 ` Oliver Neukum
2015-09-22 14:15 ` Alan Stern
2015-09-22 14:31 ` Oliver Neukum
2015-09-22 15:22 ` Alan Stern
2015-09-23 3:03 ` Oliver Neukum
2015-09-23 7:27 ` Octavian Purdila
2015-09-23 14:55 ` Alan Stern
2015-09-25 0:43 ` Rafael J. Wysocki
2015-09-25 14:29 ` Alan Stern
2015-09-25 20:15 ` Rafael J. Wysocki
2015-09-25 21:13 ` Alan Stern
2015-09-25 21:52 ` Rafael J. Wysocki
2015-09-25 23:04 ` Rafael J. Wysocki
2015-09-26 15:20 ` Alan Stern
2015-09-27 13:41 ` Rafael J. Wysocki
2015-09-27 14:27 ` Alan Stern
2015-09-28 13:41 ` Rafael J. Wysocki
2015-09-28 14:29 ` Alan Stern
2015-09-28 20:03 ` Rafael J. Wysocki
2015-09-28 20:23 ` Alan Stern
2015-10-04 15:16 ` Pavel Machek
2015-09-27 17:02 ` Pavel Machek
2015-09-28 13:47 ` Rafael J. Wysocki
2015-09-21 20:20 ` Pavel Machek
2015-09-08 14:44 ` Alan Stern
2015-09-08 15:15 ` Rafael J. Wysocki
2015-09-08 15:00 ` Alan Stern
2015-09-08 20:28 ` Rafael J. Wysocki
2015-09-09 15:22 ` Alan Stern
2015-09-09 6:26 ` Oliver Neukum
2015-09-09 14:33 ` Alan Stern
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=20150921180053.GK17389@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=irina.tirdea@intel.com \
--cc=len.brown@intel.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=octavian.purdila@intel.com \
--cc=oneukum@suse.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=stern@rowland.harvard.edu \
--cc=ulf.hansson@linaro.org \
/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