From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Lan Tianyu <tianyu.lan@intel.com>,
Alan Stern <stern@rowland.harvard.edu>,
linux-usb@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/4] usb: introduce usb force power off mechanism
Date: Mon, 08 Apr 2013 21:32:01 +0200 [thread overview]
Message-ID: <1770111.9r7BqGUQad@vostro.rjw.lan> (raw)
In-Reply-To: <20130408173354.GG6117@xanatos>
On Monday, April 08, 2013 10:33:54 AM Sarah Sharp wrote:
> On Mon, Apr 08, 2013 at 09:01:44AM -0700, Greg KH wrote:
> > On Mon, Apr 08, 2013 at 08:57:43AM -0700, Sarah Sharp wrote:
> > > On Mon, Apr 08, 2013 at 06:29:36AM -0700, Greg KH wrote:
> > > > On Mon, Apr 08, 2013 at 08:58:09PM +0800, Lan Tianyu wrote:
> > > > > Hi Alan & Sarah:
> > > > > I just recall why I put power off and power on in one ioctl.
> > > > > At first, I also tried to make power on and power off into two ioctls.
> > > > > But I found after powering off a device, the usbfs device node will
> > > > > be removed and so can't power on the port via the same usbfs node.
> > > > >
> > > > > For this point, we should add usbfs node for usb port?
> > > >
> > > > No.
> > >
> > > I agree that we shouldn't add more usbfs files without thinking very
> > > carefully about it, since lots of tools like libusb use them. However,
> > > we do need a way to manually power off a port, wait a variable length of
> > > time (or perhaps for a distro-specific event like screen unblank), and
> > > turn the port on.
> > >
> > > So how do we turn the port power back on with the options we have?
> > > Would userspace have to turn the port power off via usbfs, and then
> > > manually back on by setting the port's sysfs power/control to 'on'?
> >
> > Whatever method we use, it should be the same interface for both on
> > and off, so I would prefer to just use the sysfs one, as usbfs does not
> > represent ports, only USB devices.
>
> I would prefer that as well. However, the port power sysfs file
> power/control is created by the runtime PM core, and I think it doesn't
> have a way to manually turn power off. All we get with the current
> framework is 'on' or 'auto'. There may be times when userspace wants to
> override the kernel's policy for 'auto' and force a port power off.
>
> Perhaps the runtime PM core needs to be extended to have a way to allow
> userspace to manually force a device into a lower power state?
We actually considered that when the PM core's runtime PM framework was
being implemented and the answer was "no". The reason being that user space
has no idea whether or not the device *can* be turned off at the given
time, so the kernel can't guarantee any requests to turn devices off to be
satisfied at any given time. I believe this is the case for USB ports too.
I don't think anything has changed in that respect since then.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-04-08 19:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44L0.1303291617280.1467-100000@iolanthe.rowland.org>
[not found] ` <5162BEE1.5060404@intel.com>
[not found] ` <20130408132936.GB10940@kroah.com>
[not found] ` <20130408155743.GE6117@xanatos>
[not found] ` <20130408160144.GA12665@kroah.com>
[not found] ` <20130408160144.GA12665-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-04-08 17:33 ` [PATCH 2/4] usb: introduce usb force power off mechanism Sarah Sharp
2013-04-08 19:32 ` Rafael J. Wysocki [this message]
[not found] ` <Pine.LNX.4.44L0.1304081229100.1529-100000@iolanthe.rowland.org>
2013-04-08 17:55 ` Sarah Sharp
2013-04-08 19:24 ` Alan Stern
2013-04-08 19:39 ` Rafael J. Wysocki
2013-04-08 20:35 ` Sarah Sharp
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=1770111.9r7BqGUQad@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=gregkh@linuxfoundation.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=stern@rowland.harvard.edu \
--cc=tianyu.lan@intel.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