From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Date: Thu, 16 Jun 2005 23:04:11 +0000 Subject: Re: $MODALIAS and platform_bus ... Message-Id: <200506161604.11574.david-b@pacbell.net> List-Id: References: <200506161454.22163.david-b@pacbell.net> In-Reply-To: <200506161454.22163.david-b@pacbell.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Thursday 16 June 2005 3:07 pm, Greg KH wrote: > On Thu, Jun 16, 2005 at 02:54:22PM -0700, David Brownell wrote: > > Has anyone done anything to make sure platform_bus devices can > > use this new $MODALIAS infrastructure? I was looking at the > > implications for "coldplug" processing, and there's a hole > > where platform device support would go. > > I didn't think platform devices had any hotplug or "coldplug" type > support today anyway. Exactly. I'm still looking at having buildroot populate things completely ... though this issue is not specific to buildroot. As a rule, "hotplug" support for platform devices is pointless; they should get created as part of board-specific setup, shortly before drivers start to initialize, rather than being dynamically created later on. So "coldplug" is the most relevant setup mode for modular platform device drivers, except maybe in initramfs. (There are also some strange driver modules, basically bad/early conversions from 2.4 code, which don't just provide the driver but also create its device node. I call those bugs; and in any case they can't be hotplugged OR coldplugged.) > > So given a /sys/devices/platform/$NAME/. there are a few things > > standing in the way of automatically initializing those devices: > > > > - No /sys/devices/platform/$NAME/modalias > > - No MODULE_ALIAS(...) in the driver module > > > > ... > > I think just makeing sure the module name matched the $NAME in sysfs, > would allow the modalias stuff to work without changing any drivers. Easier said than done ... they don't always do it, and there's also the issue of "foo.1", "foo.2", "foo.3" and so on. I'd been thinking about aliasing them in /etc/modprobe.conf ... it'd be fine for embedded systems, but less good in general. Then the startup script in /etc/init.d/S00coldplug (that's where buildroot puts them, no LSB here!) could cd /sys/devices/platform and modprobe each $NAME. > But odds are, modules support more than one platform device right? If > so, they are going to have to be changed to use MODULE_ALIAS(). In the SOC example, it varies. There's usually only one USB controller per type per chip, so for example MODULE_ALIAS("ohci") would let the OMAP chips "modprobe $NAME" to load "ohci-hcd"; "omap_udc" is OK now. Likewise MODULE_ALIAS("at91rm9200-ohci") and "at91_udc". But other controllers work differently, like MMC/SD. $NAME can be one or both of "mmci-omap.1" and "mmci-omap.2". Does the aliasing stuff work generically enough that MODULE_ALIAS("mmci-omap.*") could solve that problem? - Dave ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click _______________________________________________ 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