mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Alex Dubov <oakad@yahoo.com>
Cc: joern@logfs.org, linux-kernel@vger.kernel.org, ben@fluff.org
Subject: Re: Smartmedia/xd card support - request for comments
Date: Sat, 19 Apr 2008 08:37:59 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.1.10.0804190806110.3261@apollo.tec.linutronix.de> (raw)
In-Reply-To: <259878.79137.qm@web36703.mail.mud.yahoo.com>

On Fri, 18 Apr 2008, Alex Dubov wrote:

First off, can you please use a mail client which does line breaks at
around 78 chars ?
 
> As you understand, both smartmedia media and hosts follow certain
> spec (publicly available here:
> http://www.ssfdc.or.jp/spec/index_e.htm, basic registration
> required). xd card spec is almost identical, adding some cosmetic
> features and restrictions (such as prohibition of single page
> programming). This means, that smartmedia access protocol can be
> abstracted out in the reader-independent way. You can seen in the
> xd_card_blk.c that it can operate both completely dumb controllers,
> while taking protocol shortcuts (using host->caps) to accommodate
> smarter readers (the only feature currently not there is
> adapter-side page copy - it can be easily added under FBD_COPY
> clause in xd_card_trans_req). The backend itself (jmb38x_xd.c)
> should not concern itself with details of smartmedia spec, as it
> will directly lead to code duplication among backends.

That's all fine. Nobody asked for the backend to know about smartmedia
on FLASH format details. The MTD NAND FLASH layer does not care about
on FLASH data format at all. It provides merily access on the hardware
level.

I agree that your approach of making the SM/XD layer capable of
handling clever and dumb hardware adapters is a good one.

The point where I stringly disagree is that your implementation is
forcing people with dumb hardware (see drivers/mtd/nand/*) to
reimplement the (maybe already) existing drivers in order to make use
of the ssfdc format, which will not work with the following real world
example:

------------------
| NAND controller |----------| On board NAND
| with HW ECC     |
|                 |----------| SmartMedia Card
------------------

Having a separate driver infrastructure for clever controllers, which
provide only semi raw access to the FLASH chip is fine simply because
such controllers do not fit into the MTD layer.

> I meant here the ability of user to look and modify CIS page, as
> well as look at the current block translation table.

Well, you probably do this with an iotctl anyway. So what's preventing
you to modify the mtd block layer to handle client private ioctls.

Also there is no real requirement to use the mtd block layer at all
for that. Putting your layer on top of the raw MTD device is fine IMO.

> > Correct.  Erase() is the only callback-based function and every single
> > driver implements it synchronous anyway.  Improving this situation is
> > needed for mtd's own sake anyway.  Either that or replacing mtd with
> > something else, likely the block device code.
>
> Revamping the underlying architecture of mtd will break a lot of
> stuff in the process, doesn't it?

That's the best excuse I ever heard for not improving code which has
shortcomings.

Thanks,
	tglx

  reply	other threads:[~2008-04-19  6:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-17  8:50 Alex Dubov
2008-04-17  9:01 ` Ben Dooks
2008-04-17  9:11   ` Alex Dubov
2008-04-17 13:10     ` Andy Lutomirski
2008-04-17 13:36       ` Arnd Bergmann
2008-04-17 13:38     ` Thomas Gleixner
2008-04-17 14:07       ` Jörn Engel
2008-04-17 19:11         ` Thomas Gleixner
2008-04-17 21:21           ` Jörn Engel
2008-04-18  8:47             ` Alex Dubov
2008-04-18  9:35               ` Thomas Gleixner
2008-04-19  2:49                 ` Alex Dubov
2008-04-19  5:56                   ` Thomas Gleixner
2008-04-18 14:00               ` Jörn Engel
2008-04-19  3:05                 ` Alex Dubov
2008-04-19  6:37                   ` Thomas Gleixner [this message]
2008-04-19 16:35                     ` Jörn Engel
2008-04-20  2:25                     ` Alex Dubov
2008-04-17 13:35 ` Thomas Gleixner
2008-04-17 14:19 ` Jörn Engel
2008-04-19  8:31 matthieu castet
2008-04-20 16:01 ` Jörn Engel
2008-04-21  1:33   ` Alex Dubov

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=alpine.LFD.1.10.0804190806110.3261@apollo.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=ben@fluff.org \
    --cc=joern@logfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oakad@yahoo.com \
    /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

all inboxes | Powered by JetHome®