The patch titled mmc: properly use the new multi block-write error handling has been added to the -mm tree. Its filename is mmc-properly-use-the-new-multi-block-write-error-handling.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: mmc: properly use the new multi block-write error handling From: Pierre Ossman <drzeus@xxxxxxxxx> Use the new multi block-write error reporting flag and properly tell the block layer how much data was transferred before the error. Signed-off-by: Pierre Ossman <drzeus@xxxxxxxxx> Cc: Russell King <rmk@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/mmc/mmc_block.c | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff -puN drivers/mmc/mmc_block.c~mmc-properly-use-the-new-multi-block-write-error-handling drivers/mmc/mmc_block.c --- a/drivers/mmc/mmc_block.c~mmc-properly-use-the-new-multi-block-write-error-handling +++ a/drivers/mmc/mmc_block.c @@ -158,13 +158,13 @@ static int mmc_blk_issue_rq(struct mmc_q { struct mmc_blk_data *md = mq->data; struct mmc_card *card = md->queue.card; + struct mmc_blk_request brq; int ret; if (mmc_card_claim_host(card)) goto cmd_err; do { - struct mmc_blk_request brq; struct mmc_command cmd; u32 readcmd, writecmd; @@ -278,17 +278,27 @@ static int mmc_blk_issue_rq(struct mmc_q cmd_err: mmc_card_release_host(card); + ret = 1; + /* - * This is a little draconian, but until we get proper - * error handling sorted out here, its the best we can - * do - especially as some hosts have no idea how much - * data was transferred before the error occurred. + * For writes and where the host claims to support proper + * error reporting, we first ok the successful blocks. + * + * For reads we just fail the entire chunk as that should + * be safe in all cases. */ + if (rq_data_dir(req) != READ && + (card->host->caps & MMC_CAP_MULTIWRITE)) { + spin_lock_irq(&md->lock); + ret = end_that_request_chunk(req, 1, brq.data.bytes_xfered); + spin_unlock_irq(&md->lock); + } + spin_lock_irq(&md->lock); - do { + while (ret) { ret = end_that_request_chunk(req, 0, req->current_nr_sectors << 9); - } while (ret); + } add_disk_randomness(req->rq_disk); blkdev_dequeue_request(req); _ Patches currently in -mm which might be from drzeus@xxxxxxxxx are origin.patch acpi-fix-section-for-cpu-init-functions.patch mmc-driver-for-ti-flashmedia-card-reader-source.patch mmc-driver-for-ti-flashmedia-card-reader-kconfig-makefile.patch mmc-fix-mmio-vs-memory-races-in-sdhci.patch mmc-avoid-some-resets-without-card.patch mmc-use-own-work-queue.patch mmc-properly-use-the-new-multi-block-write-error-handling.patch mmc-multi-sector-write-transfers.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html