[lkml]   [2009]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] mmc_spi: use EILSEQ for possible transmission errors

Am Dienstag, 19. Mai 2009 schrieb Matt Fleming:
> On Thu, May 14, 2009 at 12:24:27PM +0100, Wolfgang Mües wrote:
> > o This patch changes the reported error code for the responses
> > to a command from EINVAL/EIO to EILSEQ

> Hmm, always returning -EILSEQ is devious. What happens if we sent an
> illegal command?
Isn't this a theoretical question?
Sending an illegal command will never work. Even the programmer of this piece
of software will notice, and such a software will not find it's way into the

And IF it would, and really it's an illegal command, then it does no harm if
it is retried several times. It will never work.

Matt, I do not like this patch either.

But given the fact that a response is NOT checksum-protected, there is NO WAY
we can tell if the received response is a transmission error or a real error
code from the SD/MMC card.

My first patch has not changed the error codes in mmc_spi, but only changed
the actions in block.c.

But Pierre has objected against this: he stated that EINVAL is used by all
(non-SPI) drivers only for true non-recoverable errors, and requested that
another error code should be used by the mmc_spi driver. The apropriate code
for transmission errors is EILSEQ.

Maybe a solution-in-the-middle is to use different error codes in the mmc_spi
framework, which allows to differentiate between individual response codes,
and treat them all as transmission errors in block.c. What error codes can we

> IMHO always assuming that command errors are caused by transmission
> problems is not the right solution.

It's not your or my fault, it's the fault of the spi SD/MMC card protocol
designer. You may send him to me, already prepared: naked and in chains ;-)

i. A. Wolfgang Mües
Auerswald GmbH & Co. KG
Hardware Development
Telefon: +49 (0)5306 9219 0
Telefax: +49 (0)5306 9219 94
Auerswald GmbH & Co. KG, Vor den Grashöfen 1, 38162 Cremlingen
Registriert beim AG Braunschweig HRA 13289
p.h.G Auerswald Geschäftsführungsges. mbH
Registriert beim AG Braunschweig HRB 7463
Geschäftsführer: Dipl-Ing. Gerhard Auerswald
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2009-05-19 13:51    [W:0.086 / U:0.420 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site