* [RFC] change netdevice to use struct device instead of struct class_device
@ 2006-07-03 22:47 Greg KH
2006-07-03 23:07 ` Jeff Garzik
2006-07-05 14:29 ` Marcel Holtmann
0 siblings, 2 replies; 8+ messages in thread
From: Greg KH @ 2006-07-03 22:47 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
I have a patch here that converts the network device structure to use
the struct device instead of struct class_device structure. It's a bit
too big to post here, so it's at:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/network-class_device-to-device.patch
I can split it out, but then it will not build for the intermediate
steps, which 'git bisect' users might not appreciate. If you all want
me to break it up to make it easier to review, please let me know and
I'll be glad to do it.
With this patch applied, sysfs now looks like:
$ tree /sys/class/net/
/sys/class/net/
|-- eth0 -> ../../devices/pci0000:00/0000:00:02.0/0000:01:00.2/0000:03:0e.0/eth0
|-- gerg -> ../../devices/pci0000:00/0000:00:02.0/0000:01:00.2/0000:03:0c.0/gerg
`-- lo -> ../../devices/lo
Instead of the different directories being in /sys/class/net.
What this buys us is now the different network devices can be called by
the core when the system is shutting down or restoring, with the
suspend/resume changes that Linus has written (and are now in -mm).
This can be used by the network core to stop the queue, or whatever else
it desires.
Other good things happen with this, as the network devices are now real
devices, instead of the second-class citizens that "class_device" was.
(which is one reason why I'm getting rid of class_device entirely).
The patch needs some other changes to the driver core that are also in
my git tree, and included in the -mm release. Specifically these
patches are needed:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device-groups.patch
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device-class-parent.patch
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device-class-attr.patch
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device_rename.patch
And if you are curious, the suspend stuff from Linus is at:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/suspend-infrastructure-cleanup-and-extension.patch
I can gladly keep this in my tree (due to the previously mentioned
requirements) and eventually merge it with Linus after 2.6.18 is out, if
no one objects to it.
thanks,
greg k-h
p.s. That bonding code! WTF is going on with poking around in the
internals of krefs? And why are you returning more than one value
from a sysfs file? I thought I asked that this stuff be fixed up a
long time ago?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] change netdevice to use struct device instead of struct class_device
2006-07-03 22:47 [RFC] change netdevice to use struct device instead of struct class_device Greg KH
@ 2006-07-03 23:07 ` Jeff Garzik
2006-07-03 23:16 ` Greg KH
2006-07-05 14:29 ` Marcel Holtmann
1 sibling, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2006-07-03 23:07 UTC (permalink / raw)
To: Greg KH; +Cc: netdev, linux-kernel, Andrew Morton
Greg KH wrote:
> I have a patch here that converts the network device structure to use
> the struct device instead of struct class_device structure. It's a bit
> too big to post here, so it's at:
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/network-class_device-to-device.patch
So.... this is a userspace ABI change, then?
Jeff
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] change netdevice to use struct device instead of struct class_device
2006-07-03 23:07 ` Jeff Garzik
@ 2006-07-03 23:16 ` Greg KH
2006-07-04 1:57 ` David Miller
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2006-07-03 23:16 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linux-kernel, Andrew Morton
On Mon, Jul 03, 2006 at 07:07:49PM -0400, Jeff Garzik wrote:
> Greg KH wrote:
> >I have a patch here that converts the network device structure to use
> >the struct device instead of struct class_device structure. It's a bit
> >too big to post here, so it's at:
> > http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/network-class_device-to-device.patch
>
> So.... this is a userspace ABI change, then?
No, not really. According to Documentation/ABI/testing/sysfs-class all
code that uses /sys/class/foo/ needs to be able to handle the fact that
those entries might be symlinks and not just directories. Everything
that I know of already works properly because the input layer has had
symlinks in /sys/class/input for quite some time now.
Do you know of any tools that use /sys/class/net/ that can not handle
symlinks there? I've been running this on my boxes for about a week now
with no noticeable issues. Renaming interfaces works just fine too.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] change netdevice to use struct device instead of struct class_device
2006-07-03 23:16 ` Greg KH
@ 2006-07-04 1:57 ` David Miller
2006-07-04 22:31 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2006-07-04 1:57 UTC (permalink / raw)
To: greg; +Cc: jeff, netdev, linux-kernel, akpm
From: Greg KH <greg@kroah.com>
Date: Mon, 3 Jul 2006 16:16:10 -0700
> No, not really. According to Documentation/ABI/testing/sysfs-class all
> code that uses /sys/class/foo/ needs to be able to handle the fact that
> those entries might be symlinks and not just directories. Everything
> that I know of already works properly because the input layer has had
> symlinks in /sys/class/input for quite some time now.
>
> Do you know of any tools that use /sys/class/net/ that can not handle
> symlinks there? I've been running this on my boxes for about a week now
> with no noticeable issues. Renaming interfaces works just fine too.
I do not think this change will cause any problems.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] change netdevice to use struct device instead of struct class_device
2006-07-04 1:57 ` David Miller
@ 2006-07-04 22:31 ` Greg KH
2006-07-05 18:29 ` David Miller
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2006-07-04 22:31 UTC (permalink / raw)
To: David Miller; +Cc: jeff, netdev, linux-kernel, akpm
On Mon, Jul 03, 2006 at 06:57:47PM -0700, David Miller wrote:
> From: Greg KH <greg@kroah.com>
> Date: Mon, 3 Jul 2006 16:16:10 -0700
>
> > No, not really. According to Documentation/ABI/testing/sysfs-class all
> > code that uses /sys/class/foo/ needs to be able to handle the fact that
> > those entries might be symlinks and not just directories. Everything
> > that I know of already works properly because the input layer has had
> > symlinks in /sys/class/input for quite some time now.
> >
> > Do you know of any tools that use /sys/class/net/ that can not handle
> > symlinks there? I've been running this on my boxes for about a week now
> > with no noticeable issues. Renaming interfaces works just fine too.
>
> I do not think this change will cause any problems.
Great, thanks for looking.
Do you mind if I keep this in my tree, due to the dependancies on the
other driver core changes?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] change netdevice to use struct device instead of struct class_device
2006-07-03 22:47 [RFC] change netdevice to use struct device instead of struct class_device Greg KH
2006-07-03 23:07 ` Jeff Garzik
@ 2006-07-05 14:29 ` Marcel Holtmann
2006-07-07 0:02 ` Greg KH
1 sibling, 1 reply; 8+ messages in thread
From: Marcel Holtmann @ 2006-07-05 14:29 UTC (permalink / raw)
To: Greg KH; +Cc: netdev, linux-kernel
Hi Greg,
> The patch needs some other changes to the driver core that are also in
> my git tree, and included in the -mm release. Specifically these
> patches are needed:
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device-groups.patch
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device-class-parent.patch
while converting the Bluetooth subsystem from class devices to real
devices, I had some similar situation with devices without parent. I
actually used a Bluetooth platform device as parent for virtual or
serial based devices.
Regards
Marcel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] change netdevice to use struct device instead of struct class_device
2006-07-04 22:31 ` Greg KH
@ 2006-07-05 18:29 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2006-07-05 18:29 UTC (permalink / raw)
To: greg; +Cc: jeff, netdev, linux-kernel, akpm
From: Greg KH <greg@kroah.com>
Date: Tue, 4 Jul 2006 15:31:01 -0700
> Do you mind if I keep this in my tree, due to the dependancies on the
> other driver core changes?
Feel free.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] change netdevice to use struct device instead of struct class_device
2006-07-05 14:29 ` Marcel Holtmann
@ 2006-07-07 0:02 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2006-07-07 0:02 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: netdev, linux-kernel
On Wed, Jul 05, 2006 at 04:29:23PM +0200, Marcel Holtmann wrote:
> Hi Greg,
>
> > The patch needs some other changes to the driver core that are also in
> > my git tree, and included in the -mm release. Specifically these
> > patches are needed:
> > http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device-groups.patch
> > http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/device-class-parent.patch
>
> while converting the Bluetooth subsystem from class devices to real
> devices, I had some similar situation with devices without parent. I
> actually used a Bluetooth platform device as parent for virtual or
> serial based devices.
The problem with that is you get a bunch of symlinks to that parent
device that you really don't want to have, when we have a device that is
associated with a class.
I was thinking of creating a /sys/devices/virtual/ to put these
unassociated devices into, and I'll play around with that a bit. I
don't know if we will hit some namespace issues with all of the
different devices that aren't associated with a "real" device if we lump
them all together into one directory...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-07-07 0:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-03 22:47 [RFC] change netdevice to use struct device instead of struct class_device Greg KH
2006-07-03 23:07 ` Jeff Garzik
2006-07-03 23:16 ` Greg KH
2006-07-04 1:57 ` David Miller
2006-07-04 22:31 ` Greg KH
2006-07-05 18:29 ` David Miller
2006-07-05 14:29 ` Marcel Holtmann
2006-07-07 0:02 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).