From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vojtech Pavlik Date: Fri, 09 Feb 2001 07:42:40 +0000 Subject: Re: Adding PCMCIA support to the kernel tree -- developers needed. Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Thu, Feb 08, 2001 at 02:22:46PM +0100, Oliver Neukum wrote: > > > There's the little issue of a very limited device node space. > > > > You don't necessarily have to expand it, you just need to use it with > > care. > > If you want stable names based on bus position then you absolutely > need to expand it. For USB at least you have no other way to get a stable > name. True, if you don't want what's described below. But anyway, something like that is needed for user friendliness, noone will want to type the whole topology path each time he wants to access a device. > > > That doesn't mean that I don't agree with the diagnosis. > > > I just don't see a way to implement the remedy cleanly. > > > > Well, I think letting the hotplug program decide what the device will > > appear as (the name or possibly also major/minor numbers) could work? > > I believe it could work, but at the same time I think it is a very bad idea. > > a) How do you operate during system start ? Either assign the numbers by detection order or not at all and assume the hotplug agent is started early from the root partition - then when it starts, it'll see the unhandled (new) devices.. Can't do much else anyway. > b) How do you do the transition ? See above. There will be undetected devices, those will be handled by the hotplug agent. For those already assigned at kernel boot, either leave them as they are or rename them via some system call. > c) How do you handle locking ? You need total mutual exclusion. Uh, mutual exclusion of what? I can't handle a device in the bus path that's and one below/above it simultaneously. I can handle devices on different branches simultaneously. It's possible that the hotplug agent will want the same minor number for two different devices, one of these calls will fail and will have to be retried with a different number by the hotplug agent. Any other problems? > d) How do you handle an error in the hotplug agent ? By falling back to assign-first-available default behavior. > e) What other algorithmus that couldn't be trivially implemented in kernel do > you want to use ? I want a config file, where the user can specify that: a) The ethercard with MAC 00:06:08:fa:9c:dd is to be registered always as eth0 b) Any USB mouse that's connected to a hub connected to the first port of the USB card in first PCI slot is to be /dev/input/mouse2 c) Any IDE drive with serial number 8937298A is to be /dev/hdf d) et similar. You can't do this sanely in the kernel. > Either you use stable names, or you let the kernel decide the name and > give it to the hotplug agent. > The first approach isn't all that good because it ruins things like > /dev/videoX or /dev/audioX. > The second requires hotplug notification on device registration. I think the hotplug agent should decide about the name. -- Vojtech Pavlik SuSE Labs _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel