Re: [PATCH 2/2] Fix console handling during suspend/resume

Greg KH
2006-06-26T23:30:59Z

On Sun, Jun 25, 2006 at 04:23:28AM -0400, Adam Belay wrote:
> On Fri, Jun 23, 2006 at 09:04:10PM -0700, David Brownell wrote:
> > On Friday 23 June 2006 8:12 pm, you wrote:
> > > > One thing that might help us get there is if we passed a suspend notification
> > > > to the class devices (i.e. the higher level subsystems).
> > >
> > > Good point. We probably should. That really really makes sense, and that
> > > also automagically solves the "network device" issue.
> >
> > I'm not sure doing that with class devcies is the right idea, at least
> > until they show up in the driver model tree as physical children of the
> > parent hardware (so that the driver model tree automatically handles
> > sequence constraints.
>
> I agree totally, class devices should be the real children of their physical
> device instances. It's really all about representing how the drivers are
> _actually_ layered. In the PCI network device case, the code always follows
> this structure:
>
> PCI Device -> Network Device Driver (e.g. e1000) -> Network Device Class

This now possible to do in Linus's current git tree, all of the
infrastructure is now present for you to convert all instances of
"struct class_device" with "struct device" and no userspace program
should even notice the difference (all of the proper symlinks will be
created by the driver core).

So patches are welcome to start converting things over now.

For examples of the needed conversion, look at the usb core changes that
moved the usb_device class items. It was literally just a rename of the
structure used and the functions called. For some subsystems, the work
will be a bit more, but hopefully not.

So this solves the "class devices don't get suspend notices" issue,
before it even happened :)

thanks,

greg k-h