]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mmc: atmel-mci: pio hang on block errors
authorTerry Barnaby <terry@beam.ltd.uk>
Mon, 8 Apr 2013 16:05:47 +0000 (12:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2013 03:08:25 +0000 (20:08 -0700)
commit51b0bfff72d38c16dc81a06244cf14dc10605ed0
tree0ad5a5c803b065c4dacaf392864b163cfe27c21f
parentda52815aeca48bfc954672fc66e5bcad2fbc99bd
mmc: atmel-mci: pio hang on block errors

commit bdbc5d0c60f3e9de3eeccf1c1a18bdc11dca62cc upstream.

The driver is doing, by default, multi-block reads. When a block error
occurs, card/block.c instigates a single block read: "mmcblk0: retrying
using single block read".  It leaves the sg chain intact and just changes
the length attribute for the first sg entry and the overall sg_len
parameter.  When atmci_read_data_pio is called to read the single block
of data it ignores the sg_len and expects to read more than 512 bytes as
it sees there are multiple items in the sg list. No more data comes as
the controller has only been commanded to get one block.

Signed-off-by: Terry Barnaby <terry@beam.ltd.uk>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/atmel-mci.c