linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: Pierre Ossman <drzeus-mmc-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Mikael Starvik <mikael.starvik-VrBV9hrLPhE@public.gmane.org>,
	Hans-Peter Nilsson
	<hans-peter.nilsson-VrBV9hrLPhE@public.gmane.org>,
	Mike Lavender
	<mike-UTnDXsALFwNjMdQLN6DIHgC/G2K4zDHf@public.gmane.org>
Subject: Re: [patch 1/4] MMC-over-SPI header updates
Date: Wed, 13 Jun 2007 14:33:20 -0700	[thread overview]
Message-ID: <200706131433.21238.david-b@pacbell.net> (raw)
In-Reply-To: <466FAA0C.9020102-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>

On Wednesday 13 June 2007, Pierre Ossman wrote:
> David Brownell wrote:
> > 
> > The point is that this way we can keep the host driver out of the business
> > of deciding whether or not to enable CRC mode.  The main alternative would
> > be to move that module parameter into the MMC core.
> 
> Why would we want to turn it off?

It starts "off", and needs to be turned "on".  Reasons to leave it
off include performance (I measured over 30% slower with CRCs on while
writing a 120+ MB SD partition), and of course the fact that the CRC
stuff is the very newest feature in the code (thanks Jan!), and is not
yet as trustworthy (viz. the intermittent bug I noted).


> > This directly matches every MMC spec I've seen ... they define the response
> > format in those terms.  And I made this change per your request ... the host
> > driver checks for "R1", "R2", etc which are built up from those components.
> > 
> 
> The components we defined for native mode cannot be found in the specs, we
> derived them from the descriptions. So the same thing goes for SPI.

Umm ... no, not really; did you cross-check with the SPI specs?  All
the requests return one status byte.  One returns a second one.  One
returns the OCR in the place that second byte would be.  Some leave
the chip in a "busy" state.  Those are the components out of which
the SPI_R1, SPI_R1B, SPI_R2, and SPI_R3 are built.  (R3 is the one
which includes OCR.)


> The point of this exercise is that we do not have to modify host drivers when
> new response types show up (which it has when MMC got extended to SD, and SD to
> SDIO).

That seems like a fantasy to me.  We don't know in advance how those
types will be defined (or if they even will be!), so there's no way
we can know whether or not new types will need to be defined.

In fact it's almost certain that we *would* have to change that low
level protocol code to understand additional response types.  The
handling for them has to be hand coded in all cases...


> So when R666 shows up, which happens to contain the anti-christ and be 5 bytes
> long, we can describe this using existing defines and not have to modify the
> host drivers. Having a name like "OCR" then does not describe properly what we
> want the host to do.

Leaving the semantic question of where those 5 bytes would need to be
stored.  Clearly since it was defined as a new response type, the answer
used for R3 would not be appropriate... and R3 is the only 5 byte response
currently defined.


> > I'll note that the "native" bits include meaning too ... opcode is most
> > certainly meaning, as is CRC.
> > 
> 
> Granted, this is a bit fuzzy in some areas. These two are sometimes not reported
> by hw, we can only tell it to check that they are correct. And there is no real
> variation what we want to do with these values. Compare that to the payload
> where it is difficult, if not impossible, for the host driver to determine what
> we want to do with it.

You're missing the point that those values you're objecting to are fully
defined as part of the protocol, so we *DO* know exactly what to do ...

 
> Just trust me on this, we do _not_ want semantics in the host drivers. It has
> caused problems with at least three host drivers so far, and omap is still
> unable to use SD cards because it tries to parse responses by itself.

This isn't the OMAP driver though.  And I can't exactly make sense of the
guts of your objection (see next).

 
> The rule of thumb is, data the core wants back should not be parsed by the host
> driver. Things the core just wants validated is ok to parse in the host driver.

That's a fine policy.  (Though I've observed that most policies driving
interface design need to be broken sometimes.)

You've objected surprisingly vociferously ... given that so far as I
understand what you mean, that's the exact rule now followed in the
mmc_spi host driver!

 
> > 
> > OK, I can remove that stuff now that the raw SPI status bytes are being
> > returned in resp[] ... I'll have to update the spi_mmc driver though,
> > and I'll hold off on that for a bit since I expect you'll send comments
> > specifically on that driver.
> > 
> 
> Great. I'll ignore the mapping parts in there for now then and review the rest
> of the code.

Well, the R1_STATE bits of the mapping.

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

  parent reply	other threads:[~2007-06-13 21:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-10 19:57 [patch 0/4] MMC-over-SPI for 2.6.22-rc4-mm David Brownell
     [not found] ` <200706101257.45278.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-10 20:05   ` [patch 1/4] MMC-over-SPI header updates David Brownell
     [not found]     ` <200706101305.53151.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-12 17:22       ` Pierre Ossman
     [not found]         ` <466ED661.1010407-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-12 18:06           ` David Brownell
     [not found]             ` <200706121106.42067.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-13  8:25               ` Pierre Ossman
     [not found]                 ` <466FAA0C.9020102-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-13 21:33                   ` David Brownell [this message]
     [not found]                     ` <200706131433.21238.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-15 17:53                       ` Pierre Ossman
     [not found]                         ` <4672D202.3000901-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-16 18:50                           ` David Brownell
     [not found]                             ` <200706161150.58273.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-20 15:52                               ` Pierre Ossman
     [not found]                                 ` <46794D3B.1060009-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-22 20:08                                   ` David Brownell
2007-06-10 20:06   ` [patch 2/4] MMC-over-SPI card driver update David Brownell
     [not found]     ` <200706101306.39081.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-12 17:28       ` Pierre Ossman
2007-06-10 20:07   ` [patch 3/4] MMC-over-SPI core updates David Brownell
     [not found]     ` <200706101307.11394.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-13  8:12       ` Pierre Ossman
     [not found]         ` <466FA700.2080009-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-14  0:53           ` David Brownell
     [not found]             ` <200706131753.47453.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-15 18:03               ` Pierre Ossman
     [not found]                 ` <4672D474.4060707-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-16 21:16                   ` David Brownell
     [not found]                     ` <200706161416.17802.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-20 15:56                       ` Pierre Ossman
     [not found]                         ` <46794E1B.6010907-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-22 20:42                           ` David Brownell
2007-06-10 20:08   ` [patch 4/4] MMC-over-SPI host driver David Brownell
     [not found]     ` <200706101308.07910.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-13 19:32       ` Pierre Ossman
     [not found]         ` <46704637.2090309-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-14  4:05           ` David Brownell
     [not found]             ` <200706132105.51711.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-15 18:26               ` Pierre Ossman
     [not found]                 ` <4672D9C5.9080707-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-17 20:29                   ` David Brownell
     [not found]                     ` <200706171329.12709.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-20 16:20                       ` Pierre Ossman
     [not found]                         ` <467953E0.8050408-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-20 17:05                           ` David Brownell
     [not found]                             ` <20070620170511.EC564F31CB-ZcXrCSuhvln6VZ3dlLfH/g4gEjPzgfUyLrfjE7I9kuVHxeISYlDBzl6hYfS7NtTn@public.gmane.org>
2007-06-20 17:51                               ` Pierre Ossman
     [not found]                                 ` <4679691C.2060803-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
2007-06-22 21:18                                   ` David Brownell
     [not found]                                     ` <200706221418.44214.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-30 18:46                                       ` Pierre Ossman
2007-07-12 18:14                                   ` David Brownell
2007-07-12 17:52                   ` 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=200706131433.21238.david-b@pacbell.net \
    --to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
    --cc=drzeus-mmc-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org \
    --cc=hans-peter.nilsson-VrBV9hrLPhE@public.gmane.org \
    --cc=mikael.starvik-VrBV9hrLPhE@public.gmane.org \
    --cc=mike-UTnDXsALFwNjMdQLN6DIHgC/G2K4zDHf@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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;
as well as URLs for NNTP newsgroup(s).