Skip to contentSkip to conversation

MMC retry mechanism

DISCUSSION Madhusudhan 3 participants 6 messages Sep 4, 2009 – Sep 14, 2009 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

Hi Adrian,

With respect to the below commit, It looks like currently the retry mechanism only handles the READ path.

I wonder could a similar retry logic feasible for the WRITE path?

Regards,
Madhu

commit 6a79e391df295bd7c2aa1309ea5031f361c197fd

Author: Adrian Hunter <[email protected]>
Date:   Wed Dec 31 18:21:17 2008 +0100

mmc_block: ensure all sectors that do not have errors are read

If a card encounters an ECC error while reading a sector it will

timeout. Instead of reporting the entire I/O request as having

an error, redo the I/O one sector at a time so that all readable

sectors are provided to the upper layers.

#1 lore raw
Quoted 7 lines · On Fri, 4 Sep 2009 17:08:05 -0500 "Madhusudhan" <[email protected]> wrote:

Hi Adrian,

With respect to the below commit, It looks like currently the retry mechanism only handles the READ path.

I wonder could a similar retry logic feasible for the WRITE path?

The claim is that doing so can break some filesystem drivers (notably the journaling ones). There has been several threads and patches about this in the past.

Rgds

Signature · 6 lines
     -- Pierre Ossman

  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.
#2 lore raw
Quoted 17 lines

-----Original Message-----
From: Pierre Ossman [mailto:[email protected]]
Sent: Sunday, September 06, 2009 9:21 AM
To: Madhusudhan
Cc: 'Adrian Hunter'; [email protected]
Subject: Re: MMC retry mechanism

Quoted 5 lines · On Fri, 4 Sep 2009 17:08:05 -0500 "Madhusudhan" <[email protected]> wrote:

Hi Adrian,

With respect to the below commit, It looks like currently the retry mechanism only handles the READ path.

Quoted 7 lines
Quoted 2 lines

I wonder could a similar retry logic feasible for the WRITE path?

The claim is that doing so can break some filesystem drivers (notably the journaling ones). There has been several threads and patches about this in the past.

Okay. Thanks for the info. I would like to read those discussions and the patches, any reference? Or where do I look for them and any good way to search such threads in general?

Regards,
Madhu

Quoted 8 lines

Rgds
--
-- Pierre Ossman

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.

#3 lore raw
Quoted 4 lines · On Sun, 6 Sep 2009 12:58:54 -0500 "Madhusudhan" <[email protected]> wrote:

Okay. Thanks for the info. I would like to read those discussions and the patches, any reference? Or where do I look for them and any good way to search such threads in general?

The subjects have been a bit unclear unfortunately, but you have a couple of threads on LKML with the subject "mmc_spi: do proper retry management in the block layer".

There is also an ancient thread with the subject "MMC performance", which was back when I tried to tackle the issue originally.

There have been more threads over the years, but I'm afraid I don't remember enough about them to find them again.

Rgds

Signature · 6 lines
     -- Pierre Ossman

  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.
#4 lore raw
In reply to Madhusudhan
Quoted 11 lines · Madhusudhan

Hi Adrian,

With respect to the below commit, It looks like currently the retry mechanism only handles the READ path.

I wonder could a similar retry logic feasible for the WRITE path?

Regards,
Madhu

From my point of view, writes should never fail. In theory, the MMC

should have enough reserved blocks to cover bad blocks for the expected lifetime of the device. It should then be just copying and remapping to avoid having to return write errors.

Of course, a lot of cards probably don't do that right. However, I think maybe the block layer already retries failed writes.

Quoted 26 lines

commit 6a79e391df295bd7c2aa1309ea5031f361c197fd

Author: Adrian Hunter <[email protected]>
Date:   Wed Dec 31 18:21:17 2008 +0100

mmc_block: ensure all sectors that do not have errors are read

If a card encounters an ECC error while reading a sector it will

timeout. Instead of reporting the entire I/O request as having

an error, redo the I/O one sector at a time so that all readable

sectors are provided to the upper layers.

#5 lore raw
Quoted 20 lines

-----Original Message-----
From: Adrian Hunter [mailto:[email protected]]
Sent: Monday, September 07, 2009 2:18 AM
To: Madhusudhan
Cc: [email protected]
Subject: Re: MMC retry mechanism

Quoted 9 lines · Madhusudhan

Hi Adrian,

With respect to the below commit, It looks like currently the retry mechanism only handles the READ path.

I wonder could a similar retry logic feasible for the WRITE path?

Regards,
Madhu

Quoted 8 lines

From my point of view, writes should never fail. In theory, the MMC should have enough reserved blocks to cover bad blocks for the expected lifetime of the device. It should then be just copying and remapping to avoid having to return write errors.

Of course, a lot of cards probably don't do that right. However, I think maybe the block layer already retries failed writes.

What if there is a DATA CRC error during a write and the low level driver reports the data.error as -EILSEQ. Will the block layer retry? I thought it is supported only for the read through your patch.

Regards,
Madhu

Quoted 27 lines
Quoted 26 lines

commit 6a79e391df295bd7c2aa1309ea5031f361c197fd

Author: Adrian Hunter <[email protected]>
Date:   Wed Dec 31 18:21:17 2008 +0100

mmc_block: ensure all sectors that do not have errors are read

If a card encounters an ECC error while reading a sector it will

timeout. Instead of reporting the entire I/O request as having

an error, redo the I/O one sector at a time so that all readable

sectors are provided to the upper layers.