linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add sysfs mem device support  [2/4]
@ 2003-12-23  0:26 Greg KH
  2003-12-23 13:15 ` Christoph Hellwig
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Greg KH @ 2003-12-23  0:26 UTC (permalink / raw)
  To: linux-hotplug

This adds /sys/class/mem which enables all mem char devices to show up
properly in udev.

Has been posted to linux-kernel every so often since last July, and
acked by a number of other kernel developers.


diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c
--- a/drivers/char/mem.c	Mon Dec 22 16:02:08 2003
+++ b/drivers/char/mem.c	Mon Dec 22 16:02:08 2003
@@ -24,6 +24,7 @@
 #include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/ptrace.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -657,7 +658,7 @@
 	.open		= memory_open,	/* just a selector for the real open */
 };
 
-static const struct {
+static const struct mem_dev {
 	unsigned int		minor;
 	char			*name;
 	umode_t			mode;
@@ -676,6 +677,23 @@
 	{11,"kmsg",    S_IRUGO | S_IWUSR,           &kmsg_fops},
 };
 
+static void release_mem_dev(struct class_device *class_dev)
+{
+	kfree(class_dev);
+}
+
+static struct class mem_class = {
+	.name		= "mem",
+	.release	= &release_mem_dev,
+};
+
+static ssize_t show_dev(struct class_device *class_dev, char *buf)
+{
+	struct mem_dev *mem_dev = class_get_devdata(class_dev);
+	return print_dev_t(buf, MKDEV(MEM_MAJOR, mem_dev->minor));
+}
+static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
+
 static int __init chr_dev_init(void)
 {
 	int i;
@@ -683,7 +701,20 @@
 	if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
 		printk("unable to get major %d for memory devs\n", MEM_MAJOR);
 
+	class_register(&mem_class);
 	for (i = 0; i < ARRAY_SIZE(devlist); i++) {
+		struct class_device *class_dev;
+
+		class_dev = kmalloc(sizeof(*class_dev), GFP_KERNEL);
+		if (class_dev) {
+			memset(class_dev, 0x00, sizeof(*class_dev));
+			class_dev->class = &mem_class;
+			strncpy(class_dev->class_id, devlist[i].name, BUS_ID_SIZE);
+			class_set_devdata(class_dev, (void *)&devlist[i]);
+			if (!class_device_register(class_dev));
+				class_device_create_file(class_dev, &class_device_attr_dev);
+		}
+
 		devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
 				S_IFCHR | devlist[i].mode, devlist[i].name);
 	}


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
@ 2003-12-23 13:15 ` Christoph Hellwig
  2003-12-23 15:31 ` Rob Love
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2003-12-23 13:15 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Dec 22, 2003 at 04:26:09PM -0800, Greg KH wrote:
> This adds /sys/class/mem which enables all mem char devices to show up
> properly in udev.
> 
> Has been posted to linux-kernel every so often since last July, and
> acked by a number of other kernel developers.

This is pointless.  The original point of sysfs and co was to present the
physical device tree, where these devices absolutely fit into.  Why are
you doing this at all?  Creating thse through udev doesn't make sense as
they need to be present anyway..



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
  2003-12-23 13:15 ` Christoph Hellwig
@ 2003-12-23 15:31 ` Rob Love
  2003-12-23 16:07 ` Rob Love
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Rob Love @ 2003-12-23 15:31 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2003-12-23 at 08:15, Christoph Hellwig wrote:

> This is pointless.  The original point of sysfs and co was to present the
> physical device tree, where these devices absolutely fit into.  Why are
> you doing this at all?  Creating thse through udev doesn't make sense as
> they need to be present anyway..

Creating them via udev is the point.

Remember, the ultimate goal is to have udev in initramfs during early
boot, and all of these vital devices will be created.

For udev to work as intended, all devices on the system must be
represented in sysfs.

	Rob Love




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
  2003-12-23 13:15 ` Christoph Hellwig
  2003-12-23 15:31 ` Rob Love
@ 2003-12-23 16:07 ` Rob Love
  2003-12-23 16:39 ` Christoph Hellwig
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Rob Love @ 2003-12-23 16:07 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2003-12-23 at 10:31, Rob Love wrote:

> Creating them via udev is the point.
> 
> Remember, the ultimate goal is to have udev in initramfs during early
> boot, and all of these vital devices will be created.
> 
> For udev to work as intended, all devices on the system must be
> represented in sysfs.

Oh, I think I get your point, now.

The devices actually do not need to be in sysfs, but we do need to
generate a hotplug event for them.

Nonetheless, I think it makes sense to also put them in sysfs.  I think
of sysfs has a "device tree" and not necessarily a "physical device
tree".

	Rob Love




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (2 preceding siblings ...)
  2003-12-23 16:07 ` Rob Love
@ 2003-12-23 16:39 ` Christoph Hellwig
  2003-12-23 17:56 ` Rob Love
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2003-12-23 16:39 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Dec 23, 2003 at 10:31:56AM -0500, Rob Love wrote:
> Creating them via udev is the point.
> 
> Remember, the ultimate goal is to have udev in initramfs during early
> boot, and all of these vital devices will be created.

I disagree. For fully static devices like the mem devices the udev indirection
is completely superflous.



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (3 preceding siblings ...)
  2003-12-23 16:39 ` Christoph Hellwig
@ 2003-12-23 17:56 ` Rob Love
  2003-12-23 18:01 ` Greg KH
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Rob Love @ 2003-12-23 17:56 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2003-12-23 at 11:39, Christoph Hellwig wrote:

> I disagree. For fully static devices like the mem devices the udev indirection
> is completely superflous.

I see your point, so I really do not want to argue, but here is my
rationale for why everything should be done seamlessly via udev:

In a nutshell, we want a single, clean, automatic solution to device
naming.  If some "static" devices are hard coded, we introduce a special
case.  Why do that?  Why have special cases when udev can seamlessly
manage the whole thing?  Say we decide to remove /dev/foo in the kernel
- that should be reflected in udev simply by way of it no longer being
created on boot.

That is my thoughts.  I dislike special casing.  And without it, udev
can seamlessly handle everything, automatically.

But I _do_ see your point.  It is silly to generate a hotplug event for
a static device on every boot, etc. etc.  But I think the cleanliness of
not special casing certain devices in the udev solution is worth it.

	Rob Love




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (4 preceding siblings ...)
  2003-12-23 17:56 ` Rob Love
@ 2003-12-23 18:01 ` Greg KH
  2003-12-23 19:16 ` Christoph Hellwig
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Greg KH @ 2003-12-23 18:01 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Dec 23, 2003 at 01:15:23PM +0000, Christoph Hellwig wrote:
> On Mon, Dec 22, 2003 at 04:26:09PM -0800, Greg KH wrote:
> > This adds /sys/class/mem which enables all mem char devices to show up
> > properly in udev.
> > 
> > Has been posted to linux-kernel every so often since last July, and
> > acked by a number of other kernel developers.
> 
> This is pointless.  The original point of sysfs and co was to present the
> physical device tree, where these devices absolutely fit into.

No. The point of sysfs and co was to present the physical _and_ logical
device tree.  Mem devices are devices.  This patch also provides a place
to move the /proc/sys/kernel/random files out of proc and into sysfs.

In order for tools like udev to work, we must export all char devices
that are registered with the kernel.  We can't do this at
register_chrdev() time, as that only allocates a whole major.  And
people haven't converted over to using register_chrdev_region only when
they really have a device present yet.

With devices such as the misc devices, we only care about the devices we
really have in the system at that time.  It also gives us the ability to
show the linkage between the logical device, and the physical one (for
misc devices.)

Now yeah, I can see that some people might think it's a bit overkill to
move the mem devices here, but why not?  They are logical devices in the
system, and as stated above, it provides a place within sysfs to move
user modifiable attributes of these devices out of /proc (as they do not
pertain to anything related to processes.)

I do agree that the duplication of the code should be fixed, and I'll go
do that right now (I should have realized that after cut-and-pasting
that logic the third time, sorry about that.)  If that is done, the
overhead to support mem devices will drop to a very tiny ammount.

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (5 preceding siblings ...)
  2003-12-23 18:01 ` Greg KH
@ 2003-12-23 19:16 ` Christoph Hellwig
  2003-12-23 19:19 ` Rob Love
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2003-12-23 19:16 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Dec 23, 2003 at 10:01:27AM -0800, Greg KH wrote:
> In order for tools like udev to work, we must export all char devices
> that are registered with the kernel.  We can't do this at
> register_chrdev() time, as that only allocates a whole major.  And
> people haven't converted over to using register_chrdev_region only when
> they really have a device present yet.

Then add a random-junk-not-converted-yet devclass instead of duplicting
the adhoc code everywhere.  Still I'd vote for going to the proper interface
directly instead of adding bad hacks all over the places.  If that means
waiting for 2.7 to open, so what?

> With devices such as the misc devices, we only care about the devices we
> really have in the system at that time.  It also gives us the ability to
> show the linkage between the logical device, and the physical one (for
> misc devices.)

But why is it tied to the obsoltet misc mechanism (or the obsolete usb major
thing, etc..)

> Now yeah, I can see that some people might think it's a bit overkill to
> move the mem devices here, but why not?  They are logical devices in the
> system, and as stated above, it provides a place within sysfs to move
> user modifiable attributes of these devices out of /proc (as they do not
> pertain to anything related to processes.)

What user-modifiable attributes?



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (6 preceding siblings ...)
  2003-12-23 19:16 ` Christoph Hellwig
@ 2003-12-23 19:19 ` Rob Love
  2003-12-23 19:22 ` Christoph Hellwig
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Rob Love @ 2003-12-23 19:19 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2003-12-23 at 14:16, Christoph Hellwig wrote:

> What user-modifiable attributes?

See /proc/sys/kernel/random

Junk like that should be ripped from procfs and put in sysfs
corresponding to its device file.

	Rob Love




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (7 preceding siblings ...)
  2003-12-23 19:19 ` Rob Love
@ 2003-12-23 19:22 ` Christoph Hellwig
  2003-12-23 19:24 ` viro
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2003-12-23 19:22 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Dec 23, 2003 at 02:19:43PM -0500, Rob Love wrote:
> On Tue, 2003-12-23 at 14:16, Christoph Hellwig wrote:
> 
> > What user-modifiable attributes?
> 
> See /proc/sys/kernel/random
> 
> Junk like that should be ripped from procfs and put in sysfs
> corresponding to its device file.

Well, it's not just for /dev/random but also for all in-kernel cosumers
of random numbers, so doing this as a sysctl makes quite a lot of sense.

Whether sysctl should be mached into procfs or sysfs or rather be it's
own fs is an entirely different question.  Interface-wise the latter
would make most sense.



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (8 preceding siblings ...)
  2003-12-23 19:22 ` Christoph Hellwig
@ 2003-12-23 19:24 ` viro
  2003-12-23 19:25 ` Rob Love
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: viro @ 2003-12-23 19:24 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Dec 23, 2003 at 02:19:43PM -0500, Rob Love wrote:
> On Tue, 2003-12-23 at 14:16, Christoph Hellwig wrote:
> 
> > What user-modifiable attributes?
> 
> See /proc/sys/kernel/random
> 
> Junk like that should be ripped from procfs and put in sysfs
> corresponding to its device file.

Junk like that is called "sysctl" and is a part of userland ABI.


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (9 preceding siblings ...)
  2003-12-23 19:24 ` viro
@ 2003-12-23 19:25 ` Rob Love
  2003-12-23 19:28 ` Rob Love
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Rob Love @ 2003-12-23 19:25 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2003-12-23 at 14:22, Christoph Hellwig wrote:

> Well, it's not just for /dev/random but also for all in-kernel cosumers
> of random numbers, so doing this as a sysctl makes quite a lot of sense.

And /dev/random is the user-space abstraction representing the random
number generator... 

> Whether sysctl should be mached into procfs or sysfs or rather be it's
> own fs is an entirely different question.  Interface-wise the latter
> would make most sense.

What to do with sysctl's in the long run is a good question.

	Rob Love




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (10 preceding siblings ...)
  2003-12-23 19:25 ` Rob Love
@ 2003-12-23 19:28 ` Rob Love
  2003-12-23 19:42 ` Jeff Garzik
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Rob Love @ 2003-12-23 19:28 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2003-12-23 at 14:24, viro@parcelfarce.linux.theplanet.co.uk
wrote:

> Junk like that is called "sysctl" and is a part of userland ABI.

Right.  And I agree 100% that we need to respect that ABI.

Long-term, though, we need to think about a saner home for sysctl's than
procfs.  hch's suggestion of giving them their own filesystem is a good
idea to start with.

Right now, though, I think it is a shining exemplar of sanity to
associate device-related attributes with the device's directory in
sysfs.

	Rob Love




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (11 preceding siblings ...)
  2003-12-23 19:28 ` Rob Love
@ 2003-12-23 19:42 ` Jeff Garzik
  2003-12-23 19:45 ` Rob Love
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Jeff Garzik @ 2003-12-23 19:42 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Dec 23, 2003 at 02:25:56PM -0500, Rob Love wrote:
> On Tue, 2003-12-23 at 14:22, Christoph Hellwig wrote:
> 
> > Well, it's not just for /dev/random but also for all in-kernel cosumers
> > of random numbers, so doing this as a sysctl makes quite a lot of sense.
> 
> And /dev/random is the user-space abstraction representing the random
> number generator... 

Not precisely.  If your userspace program can obtain random numbers in
some other way, it should...  /dev/random shouldn't be considered as the
canonical source for random bits for the entire machine.

	Jeff





-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (12 preceding siblings ...)
  2003-12-23 19:42 ` Jeff Garzik
@ 2003-12-23 19:45 ` Rob Love
  2003-12-23 20:00 ` Stephan Maciej
  2003-12-23 20:33 ` viro
  15 siblings, 0 replies; 17+ messages in thread
From: Rob Love @ 2003-12-23 19:45 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2003-12-23 at 14:42, Jeff Garzik wrote:

> Not precisely.  If your userspace program can obtain random numbers in
> some other way, it should...  /dev/random shouldn't be considered as the
> canonical source for random bits for the entire machine.

s/the random number generator/the kernel's random number generator
(random.c)/

E.g., my point was that the device file was the user-space
representation of the kernel rng, so associating the kernel rng
attributes with the device file made sense.  I did not mean to imply it
was the be-all and end-all of rng's on the machine.

	Rob Love




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (13 preceding siblings ...)
  2003-12-23 19:45 ` Rob Love
@ 2003-12-23 20:00 ` Stephan Maciej
  2003-12-23 20:33 ` viro
  15 siblings, 0 replies; 17+ messages in thread
From: Stephan Maciej @ 2003-12-23 20:00 UTC (permalink / raw)
  To: linux-hotplug

On Tuesday 23 December 2003 17:39, Christoph Hellwig wrote:
> I disagree. For fully static devices like the mem devices the udev
> indirection is completely superflous.

It can be considered superfluous, but OTOH I think when creating a clean 
interface it's desirable to keep the number of exceptional items as small as 
possible, IOW zero.

Stephan


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] add sysfs mem device support  [2/4]
  2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
                   ` (14 preceding siblings ...)
  2003-12-23 20:00 ` Stephan Maciej
@ 2003-12-23 20:33 ` viro
  15 siblings, 0 replies; 17+ messages in thread
From: viro @ 2003-12-23 20:33 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Dec 23, 2003 at 09:00:04PM +0100, Stephan Maciej wrote:
> On Tuesday 23 December 2003 17:39, Christoph Hellwig wrote:
> > I disagree. For fully static devices like the mem devices the udev
> > indirection is completely superflous.
> 
> It can be considered superfluous, but OTOH I think when creating a clean 
> interface it's desirable to keep the number of exceptional items as small as 
> possible, IOW zero.

Trying to get rid of them for the sake of getting rid of them can very well
make interface (a) not clean and (b) harder to cleanup up later.


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2003-12-23 20:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-23  0:26 [PATCH] add sysfs mem device support [2/4] Greg KH
2003-12-23 13:15 ` Christoph Hellwig
2003-12-23 15:31 ` Rob Love
2003-12-23 16:07 ` Rob Love
2003-12-23 16:39 ` Christoph Hellwig
2003-12-23 17:56 ` Rob Love
2003-12-23 18:01 ` Greg KH
2003-12-23 19:16 ` Christoph Hellwig
2003-12-23 19:19 ` Rob Love
2003-12-23 19:22 ` Christoph Hellwig
2003-12-23 19:24 ` viro
2003-12-23 19:25 ` Rob Love
2003-12-23 19:28 ` Rob Love
2003-12-23 19:42 ` Jeff Garzik
2003-12-23 19:45 ` Rob Love
2003-12-23 20:00 ` Stephan Maciej
2003-12-23 20:33 ` viro

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).