From: Andy Whitcroft <apw@canonical.com>
To: Pierre Ossman <drzeus-mmc@drzeus.cx>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mmc: add MODALIAS linkage for MMC/SD devices
Date: Thu, 15 Jan 2009 15:00:03 +0000 [thread overview]
Message-ID: <20090115150003.GB6896@shadowen.org> (raw)
In-Reply-To: <20090112160519.3ba21848@mjolnir.drzeus.cx>
On Mon, Jan 12, 2009 at 04:05:19PM +0100, Pierre Ossman wrote:
> On Tue, 6 Jan 2009 18:56:38 +0000
> Andy Whitcroft <apw@canonical.com> wrote:
>
> > Currently we are using an explicit udev rule to trigger loading of the
> > mmc-block module when an MMC or SD card is detected:
> >
> > SUBSYSTEM=="mmc", RUN+="/sbin/modprobe -Qba mmc-block"
> >
> > It makes much more sense for the mmc bus driver and the mmc-block module to
> > share MODALIAS information so that they are linked automatically.
> >
>
> First, I'd just like to state that I agree that the current situation
> is far from optimal. Things should "just work".
>
> That said, the MMC/SD stuff is a bit of a mess (the entire ecosystem,
> not just the Linux implementation). The classical method of matching
> devices to drivers isn't a perfect fit here. There is simply no nice
> and proper layering.
>
> So right now I think that udev (or equivalent system) is the cleanest
> solution. If nothing else, it means we don't have to create a kernel
> ABI that might be problematic to maintain in the future. Feel free to
> convince me I'm wrong though. :)
The problem is that the kernel has an internal dependancy for using these
cards on the mmc-block driver but that is not expressed by the kernel.
This means that we have to maintain an external dependancy in the udev
package. Unfortuanatly that is is not versioned with the kernel so
that adds a per distro maintenance burden ensuring udev is in step with
the kernel.
> > Add MODALIAS attributes to the uevents as generated, and add the
> > corresponding MODULE_ALIAS marks to the mmc-block module so that it is
> > automatically loaded by udev. I have followed the example set by the
> > SCSI subsystem in pushing out numeric typed aliases:
> >
> > mmc:t-0xNN
> >
> > Where NN is the MMC type as defined in include/linux/mmc/card.h.
>
> Currently the only type that isn't matched is MMC_TYPE_SDIO. But that
> will probably change once we support combo cards. At that point, all
> types will result in mmc_block being loaded and we're basically back to
> always loading mmc_block on card insertion.
>
> There is also the fact that type isn't the primary thing that mmc_block
> uses to determine if it can use the card. The more interesting thing is
> the command classes. But since those aren't defined for pure SDIO
> cards, it's not something we can sensibly use for MODALIAS.
>
> In essence, the crappy design of MMC and SD means there is no decent
> identifier for the card at this level.
Yeah I can see how we might end up still loading the driver for all SDIO
cards once we support them correctly; possibly even for ones with no
storage if we are unable to tell from the underlying device. The good
thing about expressing it this way is that should the kernel find out how
to do it we can modify the aliases and prevent the module loading on all
distros automatically.
> Your patch leaves room for adding things in the future, but it
> doesn't seem right adding an ABI with fields that we already know are
> pretty useless at identifying devices.
>
> Is the udev method causing practical problems, or is this a matter of
> trying to do things the proper way just for the sake of it?
It is about reducing external dependancies to simplify life for the
distro packagers.
Would it make more sense to simply use mmc: with no data as the MODALIAS
tag here. And make mmc-block have mmc:* as an alias. That way the
actual (useless) numeric data is not exposed but we still will load the
mmc-block module for everything exactly as we do with the udev rule.
This should still make things work from a distro point of view and not
expose anything which might then get relied on. If we do it so extra
data can still be added later we won't prevent sane data being exposed
should we ever have any.
If you are happier with that I can re-spin the patches that way?
-apw
next prev parent reply other threads:[~2009-01-15 15:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-06 18:56 [PATCH 1/1] mmc: add MODALIAS linkage for MMC/SD devices Andy Whitcroft
2009-01-12 15:05 ` Pierre Ossman
2009-01-15 15:00 ` Andy Whitcroft [this message]
2009-01-24 17:56 ` Pierre Ossman
2009-01-24 23:45 ` Kay Sievers
2009-01-25 15:48 ` Pierre Ossman
2009-01-25 16:00 ` Kay Sievers
2009-01-26 9:35 ` Andy Whitcroft
2009-01-27 12:12 ` Andy Whitcroft
2009-01-27 19:14 ` Pierre Ossman
2009-01-27 19:26 ` Kay Sievers
2009-01-28 15:06 ` Andy Whitcroft
2009-01-28 19:58 ` Pierre Ossman
[not found] <20090218205654.05896ece@mjolnir.ossman.eu>
2009-02-23 12:38 ` Andy Whitcroft
2009-03-02 21:10 ` Pierre Ossman
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=20090115150003.GB6896@shadowen.org \
--to=apw@canonical.com \
--cc=drzeus-mmc@drzeus.cx \
--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