public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Greg KH <gregkh@suse.de>
Cc: "Marco d'Itri" <md@Linux.IT>, Kay Sievers <kay.sievers@vrfy.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [Bulk] Re: [patch 2.6.19-rc6] fix hotplug for legacy platform drivers
Date: Wed, 6 Dec 2006 16:25:33 -0800	[thread overview]
Message-ID: <200612061625.34324.david-b@pacbell.net> (raw)
In-Reply-To: <20061206060802.GB12997@suse.de>

> > First, for reference, I refer to hotplugging using the trivial ASH scripts
> > from [1], updated by removing no-longer-needed special cases for platform_bus
> > (that original logic didn't work sometimes) and pcmcia. ...
> 
> Ah, so for the platform devices, doing a
> 	modprobe /sys/devices/platform/*
> would load all of the proper modules for the specific platform devices
> that are already present due to the MODULE_ALIAS() stuff?

That's sort of how that original "coldplug" script worked, but it didn't
work except in some trivial cases.  For example, it fails in a common case
when platform_device.id != -1; and for platform devices that are children
of other devices.  And of course there's the syntax issue ... only one
module name at a time (so modprobe in a loop).

The MODULE_ALIAS() stuff only kicks in when the driver name isn't the
same as its module name.  Normally, developers just stick to one name.


> > That should make it clear how accepting that pushback would break hotplug:
> > "modprobe $MODALIAS" would no longer load the right module.  Likewise
> > the more significant case of coldplug; "modprobe $(cat modalias)" would
> > likewise no longer work.
> 
> But, I don't understand why a module would have an alias with the same
> name as itself?  What is that achieving here?  Shouldn't redundancy like
> that be eliminated?

To repeat, I am _not_ the one who has made that proposal.  I'm the one
pointing out that all names for a module (aliases vs. what "ls" shows)
should be treated the same ... introducing a new rule about how hotplug
(or coldplug) must only refer to aliases promotes fragility.


> > The $SUBJECT patch makes those legacy drivers NOT use the $MODALIAS
> > mechanism ... you seem to be overlooking that.
> 
> No, I'm not overlooking that, I think it's a good thing.  I'm just
> wondering if it could be done a different way.  Perhaps in the platform
> device itself instead of the driver core code?

Marco was overlooking it.

I thought about moving that bit elsewhere, but three things came to mind:

 * Space-wise, there are already unused bits there, so this is free;
   but there are no such bits in platform_device.

 * Given that this is a "legacy style" issue, not all such driver
   code is (or will be) on the platform bus.

 * Hey, not all devices and busses support hotplugging, and it'd be
   worth having discussion on that.  The flag is explicitly about
   the _driver_ not supporting hotplug ... a device node creation
   problem.  When the _device_ is physically not hotpluggable, a
   different approach might help rid the kernel of probe()/remove()
   infrastructure.

Given those points, I thought this was probably the best place to
put it; at least as an initial proposal.

Another proposal, which I dislike, is just not to have platform_bus
do hotplug (via $MODALIAS).  That'd be OK for some current embedded
systems, since the devices get created during board startup and are
not added/removed later, but that's exactly the sort of idiosyncratic
restriction I've observed will invariably cause pain later on.  It's
too easy to think of counterexamples, like devices appearing when a
board gets powered up.

- Dave


  reply	other threads:[~2006-12-07  1:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20061122135948.GA7888@bongo.bofh.it>
     [not found] ` <1164623293.3702.4.camel@pim.off.vrfy.org>
     [not found]   ` <20061127190315.GA28107@suse.de>
2006-11-29 22:50     ` [patch 2.6.19-rc6] fix hotplug for legacy platform drivers David Brownell
2006-11-29 23:02       ` Greg KH
2006-11-30  1:27         ` [Bulk] " David Brownell
2006-12-01  7:04           ` Greg KH
2006-12-05  2:28             ` David Brownell
2006-12-05 10:01               ` Marco d'Itri
2006-12-06  0:03                 ` David Brownell
2006-12-06  6:08                   ` Greg KH
2006-12-07  0:25                     ` David Brownell [this message]
2006-12-06 23:56                   ` Marco d'Itri
2006-12-09  6:03                     ` 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=200612061625.34324.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=md@Linux.IT \
    /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