From: Paul Mundt <lethal@linux-sh.org>
To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: "Hans J. Koch" <hjk@linutronix.de>,
gregkh@suse.de, Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: UIO device name
Date: Wed, 24 Sep 2008 20:47:43 +0900 [thread overview]
Message-ID: <20080924114743.GA9694@linux-sh.org> (raw)
In-Reply-To: <1222255981.12624.215.camel@gentoo-jocke.transmode.se>
On Wed, Sep 24, 2008 at 01:33:01PM +0200, Joakim Tjernlund wrote:
> On Wed, 2008-09-24 at 12:22 +0200, Hans J. Koch wrote:
> > Set info->name to something that's useful for the userspace part of the
> > driver. You can create an individual string for each HW so userspace can
> > easily identify the devices. The string in info->name can be anything
> > you like, it's only used as info given in the "name" sysfs file.
>
> All suggestions so far implies changes i 3 different areas, the kernel
> needs to set a name, then udev(I am using mdev btw so that won't work
> for me) or add some RC scripts to translate the name to the
> wanted /dev/name and then the app needs to know the name.
>
> The udev/scripts is pure overhead and makes it harder for me to have a
> generic root FS. I don't see why not uio can offer the kernel to
> select another name than the standard uio%d name.
>
You are seriously arguing about the overhead of creating a symlink based
on name lookup in a sysfs directory? Well, good luck with that.
Your 3-point argument doesn't parse either. With your rename scheme, the
kernel has to set the name in the rename, _and_ your application has to
know the name anyways. So the only difference is that you have to write
some scripts to take care of setting up the link. This is precisely a
single change over your current scheme of trying to rename stuff in the
kernel, and as a bonus, you don't automatically blow up all of the
userspace UIO tools that depend on the uio%d naming.
> > No hackery, please. The "name" attribute is there for this purpose, use
> > it. Or use one of the other possibilities Paul mentioned.
>
> Yes, this is a hack until UIO has a proper API for choosing a name other
> than uio%d. Seems like it is very essy to do, just pass the wanted name
> to __uio_register_device() and offer an new uio_register_device_name()
> method or add a dev_name field to struct uio_info.
>
Nonsense, there is nothing wrong with UIO's interface as it is today.
It is no different from sound cards, cdroms, and so on. If you want the
pretty name association and consistent numbering, you use udev. If udev
is too heavy for you, then you hack together some scripts or fix up your
udev-replacement so it's actually useful for normal use. This is not the
kernel's problem, all of the information you need is available to you.
The fact you want to do this in the kernel instead of userspace is
irrelevant. We are not going to add to the kernel data structures because
you don't want to write a one line script.
next prev parent reply other threads:[~2008-09-24 11:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 9:21 UIO device name Joakim Tjernlund
2008-09-24 9:35 ` Paul Mundt
2008-09-24 9:57 ` Joakim Tjernlund
2008-09-24 10:14 ` Paul Mundt
2008-09-24 10:22 ` Hans J. Koch
2008-09-24 11:33 ` Joakim Tjernlund
2008-09-24 11:47 ` Paul Mundt [this message]
2008-09-24 12:38 ` Joakim Tjernlund
2008-09-24 22:57 ` Ben Nizette
2008-09-25 10:05 ` Joakim Tjernlund
2008-09-25 10:48 ` Ben Nizette
2008-09-25 11:41 ` Joakim Tjernlund
2008-09-25 11:53 ` Paul Mundt
2008-09-25 12:36 ` Joakim Tjernlund
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=20080924114743.GA9694@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=gregkh@suse.de \
--cc=hjk@linutronix.de \
--cc=joakim.tjernlund@transmode.se \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox