Re: [PATCH 3/3] mmc: Add per-card debugfs support

From: Pierre Ossman
Date: Sat Jun 28 2008 - 11:22:22 EST


On Sat, 28 Jun 2008 16:15:24 +0200
Haavard Skinnemoen <haavard.skinnemoen@xxxxxxxxx> wrote:

> Pierre Ossman <drzeus-mmc@xxxxxxxxx> wrote:
> > On Sat, 28 Jun 2008 15:48:44 +0200
> > Haavard Skinnemoen <haavard.skinnemoen@xxxxxxxxx> wrote:
> >
> > > Pierre Ossman <drzeus-mmc@xxxxxxxxx> wrote:
> > > > The status command doesn't work on SDIO cards, so this seems like the
> > > > wrong place for it.
> > >
> > > Where do you want it then?
> > >
> >
> > drivers/mmc/core/mmc.c seems like the correct place (and some coupling
> > from sd.c as well). See if you can do something that's similar to how
> > sysfs nodes are handled by the bus handlers.
>
> Hmm...I thought card.c seemed like a good place for card-specific debug
> information. Even though this particular attribute isn't relevant to
> some types of cards, is that a reason to create the whole directory
> elsewhere and add complicated dependencies between files?
>

The directory might be suitable there, just not the "status" file. The
MMC code used to be a horrible mess of "if":s, "but":s and "when":s in
order to handle the crappy details of MMC vs SD. I'd like to avoid
going back to that nightmare as much as possible. The layering can
never be perfect, but right now it's at least just core.c that needs to
know about the different systems.

An alternative to sticking it into mmc.c is to create a debugfs.c that
contains all the uglyness. Debugging code isn't quite as important to
keep crystal clear.

Rgds
--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
rdesktop, core developer http://www.rdesktop.org

WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/