From: "Frantisek Rysanek" <Frantisek.Rysanek@post.cz>
To: linux-kernel@vger.kernel.org
Subject: need to make my chrdev visible to udev: how to tug at sysfs from kspace?
Date: Fri, 24 Nov 2006 17:37:42 +0100 [thread overview]
Message-ID: <45672DE6.10097.6E8BEF43@localhost> (raw)
Dear Everyone,
this may be a RTFM question, I just can't seem to find the right docs
:-)
I have a simple custom device called the UNO-2050 - essentially a PCI
device based on a generic slave bridge by PLX (PLX9052).
I've written a driver that registers a character device, so that I
have something to open() when I need to send some ioctl()'s into
kernel space.
After some quick search in drivers/char/mem.c and other places,
I've come up with a sequence of register_chrdev(), class_create()
and class_device_create(), along the lines of
uno2050_major = register_chrdev(0,"uno-2050",&uno2050_fops);
uno2050_class = class_create(THIS_MODULE, "uno-2050");
class_device_create(
uno2050_class,
&board->fn[1].pdev->bus->class_dev,
MKDEV(uno2050_major,
board->fn[1].uno2050_minor),
&board->fn[1].pdev->dev,
"uno-2050-%d", board->fn[1].uno2050_minor
);
I get a nice sysfs class "uno-2050" and a sysfs class device called
"uno-2050-0".
Now comes the interesting point:
If I insert my driver module at runtime, well after udev has started,
I get a nice and functional device node of /dev/uno-2050-0.
If OTOH I compile that same driver monolithically into the kernel, so
that the device is detected before initrd is mounted and before udev
is started ("cold plug"?), udev doesn't create the device node,
although the sysfs entries (and a line in /proc/devices) are clearly
there, and if I make the device node by hand, I can use the device...
At least, this is the way it behaves in Fedora 6 and Mandriva 2006.0.
What am I doing wrong? Should I better post my initrc/rc.sysinit?
I do have /proc, /sys and /dev/pts mounted before I attempt to start
udev.
Thanks in advance for any ideas...
Frank Rysanek
reply other threads:[~2006-11-24 16:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=45672DE6.10097.6E8BEF43@localhost \
--to=frantisek.rysanek@post.cz \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.