All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Julius Werner <jwerner@chromium.org>,
	Shawn Nematbakhsh <shawnn@chromium.org>,
	<linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Don Zickus <dzickus@redhat.com>,
	Oliver Neukum <oliver@neukum.org>
Subject: Re: [PATCH] usb: xhci: Disable runtime PM suspend for quirky controllers.
Date: Wed, 29 May 2013 16:11:39 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1305291558330.885-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20130529193828.GK32085@xanatos>

On Wed, 29 May 2013, Sarah Sharp wrote:

> On Tue, May 28, 2013 at 02:41:18PM -0700, Julius Werner wrote:
> > The policy we want to achieve is to disable runtime PM iff there is a
> > device connected that doesn't have persist_enabled or a reset_resume()
> > handler and whose parent/root hub resets on resume, right?
> 
> Makes sense.  However, not all distros may want that policy, so there
> should be a way to change that policy via sysfs.  Some distros may
> choose to take the power savings over having a particular USB device
> work, especially in the server market.
> 
> Don, Oliver, what do you think of this patch:
> http://marc.info/?l=linux-usb&m=136941922715772&w=2
> 
> Julius is proposing to limit the scope of the patch a bit, but the
> impact will still be that TI hosts will be active more often than not.

In many cases, the usual default of allowing the root hub to 
autosuspend will be acceptable.  In cases where it isn't, I think we 
will have to rely on userspace to tell us.  The simplest way is for 
userspace to forbid autosuspend.

That may not be flexible enough, but at this point there doesn't seem 
to be any way for the kernel to include all the different policies that 
userspace might want.  All we can do is make the information available.

There already is a "quirks" attribute in sysfs, but it's probably not 
good enough for this.  The contents are subject to change if we 
renumber the QUIRK bits.  Maybe something more like the "avoid_reset" 
attribute.

A problem with registering sysfs attributes from within xhci-hcd is
that they won't become visible until some time after the device is
registered.  If a udev script runs too quickly, it won't see the
attribute.

> > So couldn't
> > we remove the HCD-specific XHCI_RESET_ON_RESUME and set the (existing)
> > generic USB_QUIRK_RESET_RESUME on the root hub instead?  Then we could
> > handle all of this in the USB core (during device initialization and
> > when changing persist_enabled through sysfs) by just checking for
> > udev->reset_resume on all parent hubs of the device in question (and
> > use pm_runtime_get/put() on said device to prevent its parents from
> > suspending as appropriate).
> 
> Alan, what happens if we set USB_QUIRK_RESET_RESUME on the roothub?
> I don't think that currently translates into the host controller's Reset
> register getting written, which is what I think Julius is proposing.

Hmmm.  Now that I look more closely, setting the RESET_RESUME quirk on
the root hub would prevent it from ever going into runtime suspend,
which is not what we are after.  (The quirk disables autosuspend for
devices whose drivers don't support reset-resume or require remote
wakeup.)

Oh, well.

Alan Stern


  reply	other threads:[~2013-05-29 20:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-24 18:12 [PATCH] usb: xhci: Disable runtime PM suspend for quirky controllers Shawn Nematbakhsh
2013-05-24 21:05 ` Sarah Sharp
2013-05-25 14:11   ` Alan Stern
2013-05-25 16:59     ` Shawn Nematbakhsh
     [not found]     ` <CALaWCOOGEDtF1z29df2ST9kV-VpMa9VbvFK0Hh71WJG5f_pngA@mail.gmail.com>
2013-05-28 20:58       ` Sarah Sharp
2013-05-28 21:41         ` Julius Werner
2013-05-29 14:23           ` Alan Stern
2013-05-29 19:38           ` Sarah Sharp
2013-05-29 20:11             ` Alan Stern [this message]
2013-05-29 20:32             ` Don Zickus
2013-06-03 11:33               ` Oliver Neukum
2013-08-09 17:22       ` Sarah Sharp
2013-08-12 15:49         ` Shawn Nematbakhsh

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=Pine.LNX.4.44L0.1305291558330.885-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=dzickus@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jwerner@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=shawnn@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.