public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: David Brownell <david-b@pacbell.net>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-pm@osdl.org, Jiri Slaby <jirislaby@gmail.com>,
	linux-kernel@vger.kernel.org, Mattia Dongili <malattia@linux.it>,
	pavel@suse.cz, Alan Stern <stern@rowland.harvard.edu>,
	linux-usb-devel@lists.sourceforge.net
Subject: Re: [PATCH] get USB suspend to work again on 2.6.17-mm1
Date: Tue, 27 Jun 2006 16:26:00 -0700	[thread overview]
Message-ID: <20060627232600.GE15225@kroah.com> (raw)
In-Reply-To: <200606261904.06102.david-b@pacbell.net>

On Mon, Jun 26, 2006 at 07:04:05PM -0700, David Brownell wrote:
> On Monday 26 June 2006 4:57 pm, Greg KH wrote:
> > On Fri, Jun 23, 2006 at 10:51:47AM -0400, Alan Stern wrote:
> > > On Thu, 22 Jun 2006, Greg KH wrote:
> > > 
> > > > > Under what scenario could it possibly be legitimate to suspend a
> > > > > usb device -- or interface, or anything else -- with its children
> > > > > remaining active?  The ability to guarantee that could _never_ happen
> > > > > was one of the fundamental motivations for the driver model ...
> > > > 
> > > > I'm not disagreeing with that.  It's just that you are looping all
> > > > struct devices that are attached to a struct usb_device and assuming
> > > > that they are all of type struct usb_interface. ...
> > > 
> > > In fact the code doesn't make that assumption.  It only assumes that the 
> > > dev->power.power_state.event field is set correctly ...
> > 
> > Yes, but it's looking at devices it should _not_ care about.  The USB
> > core should only care about devices it controls, not other devices in
> > the device chain.  Those are for the driver core to handle.
> 
> The basic problem is that the driver core does ** NOT ** maintain such
> integrity constraints.  So it's unsafe to remove those checks for cases
> (like USB) where devices get suspended outside transition to "system sleep"
> states like "standby", "suspend-to-ram", and "suspend-to-disk". [1]
> 
> Go back to my original question:  is there a legitimate scenario where
> that test should fail?  Nobody has come up with even one ...

Again, virtual devices that are no associated with any driver.  Exactly
the situation we have today with the usb endpoints and the usb_device
structures. 

And again, the USB core should not be messing with any devices that it
does not control, that just happen to be hanging off of the USB devices.

> Even so-called "virtual" devices (talking to abstracted hardware) need to
> quiesce.

No they don't.  If they did, they would be bound to a driver and provide
a suspend method.  Look at the current code for 2 examples of struct
devices that meet this critera.

> > Ah, ok, I thought it was somewhere...  David, why don't we walk that
> > list instead?
> 
> Because the type of the child doesn't matter.  If it hasn't suspended,
> the parent must not suspend.  The original point of the driver model was
> to be able to enforce that integrity constraint.

Well, who knows what the original point of the driver model was in this
regard, as that developer is not helping with development anymore :(

> Plus, this way we use the driver model data structures ... in much the
> way the driver model itself would, if it were maintaining such integrity
> constraints.  If the driver model is ever going to fix those issues,
> we'll at least know it has sufficient data at hand.

If we want to add these kinds of constraints to the driver model, great,
let's add them to the core and have that discussion.  But we should NOT
be adding it to a random driver subsystem to try to enforce requirements
the rest of the driver tree does not obey.  That's just insane.

thanks,

greg k-h

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

  parent reply	other threads:[~2006-06-27 23:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22 20:29 [PATCH] get USB suspend to work again on 2.6.17-mm1 Greg KH
2006-06-22 21:27 ` Jiri Slaby
2006-06-22 21:28 ` Mattia Dongili
2006-06-22 21:34 ` Mattia Dongili
2006-06-22 23:24 ` David Brownell
2006-06-22 23:51   ` Greg KH
2006-06-23  2:45     ` Alan Stern
2006-06-23  4:26       ` Greg KH
2006-06-23 14:28         ` Alan Stern
2006-06-23  3:34     ` David Brownell
2006-06-23  4:24       ` Greg KH
2006-06-23 14:51         ` Alan Stern
2006-06-23 15:38           ` David Brownell
2006-06-26 23:57           ` Greg KH
2006-06-27  2:04             ` David Brownell
2006-06-27 15:24               ` Alan Stern
2006-06-27 23:28                 ` Greg KH
2006-06-27 23:26               ` Greg KH [this message]
2006-06-27  9:03             ` Pavel Machek
2006-06-27 17:38               ` David Brownell
2006-06-27 23:20                 ` Greg KH
2006-06-25  2:42       ` [linux-pm] " Jim Gettys
2006-06-25  4:32         ` David Brownell

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=20060627232600.GE15225@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=david-b@pacbell.net \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@osdl.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=malattia@linux.it \
    --cc=pavel@suse.cz \
    --cc=stern@rowland.harvard.edu \
    /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