From: Oliver Neukum <oliver@neukum.name>
To: linux-hotplug@vger.kernel.org
Subject: Re: Which node has the device been bound to?
Date: Mon, 03 Jun 2002 21:09:36 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-102313862225446@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-102266789207618@msgid-missing>
> > A name can change meaning. An open file cannot. It'll either
> > be what the ioctl() will tell you, or it'll be gone. If you operate on
> > a device that is gone the kernel will return an error and all is well.
>
> Yes, you get a response from an ioctl that points you to a /dev node or
> a driverfs file. Then the device is disconnected and whatever you had
> pointing to that device (the /dev file pointer) is replaced with a new
> device connecting. Same problem as before :)
Nope. You had opened the device. The name changes meaning.
The fd does not.
> > If you parse what driverfs gives you, you operate on changing
> > data without a lock. I can see no way to change that.
>
> I don't see a way around this even with ioctl().
Ioctl() works atomic. If locks are needed, the ioctl() handler can safely
implement them.
> But what is the real problem here? What do you want to solve? Mapping
> of a /dev node to a physical device? Or mapping of a physical device to
> a /dev node? Or something else?
The former. The latter has some principal problems.
To do the former you need to have an atomic operation on an
opened device.
Thus you need to have the device node open and you need
the ioctl to not return a pointer to a driverfs file. You either return
its content or an fd.
Regards
Oliver
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
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
next prev parent reply other threads:[~2002-06-03 21:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-29 10:23 Which node has the device been bound to? Kim Deokhwan
2002-05-31 16:53 ` Oliver Neukum
2002-05-31 17:12 ` Dmitri
2002-05-31 18:26 ` Greg KH
2002-06-01 0:05 ` Oliver Neukum
2002-06-01 0:21 ` Greg KH
2002-06-01 1:14 ` Oliver Neukum
2002-06-03 18:00 ` Greg KH
2002-06-03 21:09 ` Oliver Neukum [this message]
2002-06-03 21:58 ` Greg KH
2002-06-03 22:43 ` Oliver Neukum
2002-06-03 22:46 ` Greg KH
2002-06-03 23:05 ` Oliver Neukum
2002-06-03 23:16 ` Greg KH
2002-06-03 23:37 ` Oliver Neukum
2002-06-03 23:50 ` Greg KH
2002-06-04 19:00 ` David Brownell
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=marc-linux-hotplug-102313862225446@msgid-missing \
--to=oliver@neukum.name \
--cc=linux-hotplug@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;
as well as URLs for NNTP newsgroup(s).