Skip to contentSkip to conversation

devfs + PCI serial card = no extra serial ports

DISCUSSION Adam J. Richter 3 participants 3 messages Mar 8, 2003 – Mar 14, 2003

lore
Share & tools
lore
#0 lore raw

[Sorry if this is a duplicate. I sent it about 12 hours ago, and it still has not appeared on marc.theaimsgroup.com or www.uwsg.indiana.edu.-Adam]

Quoted 7 lines · Theodore Ts'o
Quoted 5 lines · Bryan Whitehead

It seems devfsd has an annoying "feature". I bought a PCI card to get a couple (2) more serial ports. The kernel doesn't seem to set up the serial ports at boot, so devfs never creates an entry. However, post boot, since there is no entries, I cannot configure the serial ports with setserial. So basically devfsd = no PCI based serial add on?

Quoted 5 lines

Yep. This I pointed this out as a flaw to devfs a long, long time (years!) ago, but Richard chose not to listen to me. Personally, I solve this (and other) problems by simply refusing to use devfs.

- Ted

Let me see if I understand the problem. The sitution is
that you have "stem cell" devices which initially are not defined to talk to a particular port, but which are then differentiated by a user level program doing ioctls to set the associated IO ports, interrupts and even UART types. For example, exactly which kernel device is associated with which hardware device is controlled by user level software.

There is nothing in devfs that prevents you from registering
devfs devices even if they are not yet bound to specific hardware (you do not need a sysfs mapping, for example). So, you should be able to register /dev/tts/0..N at initialization, where N is the maximum number of serial devices you want to support.

Another approach, which I think provides a little more
information to users, makes for a more readable /dev tree and should make some programs a few cycles faster would be to what my version of /dev/loop does (not the one currently in Linus's tree, alas): start by just creating /dev/tts/0, and then create /dev/tts/n+1 whenever /dev/tts/n is assigned and /dev/tts/n+1 has not already been defined. For /dev/loop, it was also useful to have the extra devices unregister when the highest number device became undefined (if a device in the middle were de-defined, it would not disappear until all higher numbered devices were also de-defined).

Is this the issue, or do I misunderstand?

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."

#1 lore raw

[snip]

Quoted 5 lines

There is nothing in devfs that prevents you from registering
devfs devices even if they are not yet bound to specific hardware (you do not need a sysfs mapping, for example). So, you should be able to register /dev/tts/0..N at initialization, where N is the maximum number of serial devices you want to support.

are you saying there is a way to force devfs to make more entries in /dev/tts/ without any hardware being attached to the entries? Then i can use setserial? so on boot I'd have 4 entries in /dev/tts ?

Or are you saying I write a script to goto /dev/tts after boot and mknod the ports that are missing?

Quoted 22 lines

Another approach, which I think provides a little more
information to users, makes for a more readable /dev tree and should make some programs a few cycles faster would be to what my version of /dev/loop does (not the one currently in Linus's tree, alas): start by just creating /dev/tts/0, and then create /dev/tts/n+1 whenever /dev/tts/n is assigned and /dev/tts/n+1 has not already been defined. For /dev/loop, it was also useful to have the extra devices unregister when the highest number device became undefined (if a device in the middle were de-defined, it would not disappear until all higher numbered devices were also de-defined).

Is this the issue, or do I misunderstand?

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 4 lines
Bryan Whitehead
SysAdmin - JPL - Interferometry Systems and Technology
Phone: 818 354 2903
[email protected]
#2 lore raw
Quoted 10 lines · Bryan Whitehead

[snip]

Quoted 5 lines

There is nothing in devfs that prevents you from registering
devfs devices even if they are not yet bound to specific hardware (you do not need a sysfs mapping, for example). So, you should be able to register /dev/tts/0..N at initialization, where N is the maximum number of serial devices you want to support.

are you saying there is a way to force devfs to make more entries in /dev/tts/ without any hardware being attached to the entries? Then i can use setserial? so on boot I'd have 4 entries in /dev/tts ?

Don't do this. The whole concept of opening a device node for a device which is _absent_, then doing magic ioctls on it to make the driver probe for the hardware, is utterly bogus.

Fix it properly instead -- disallow opening of a /dev/ttySx node with uart type unknown, and implement a proper way to tell the serial driver 'please look for a device _here_', via sysfs or something.

Signature · 1 line
dwmw2