598d518e0f99b6bd4c63170a9bda9d57d81c1150
[openwrt/svn-archive/archive.git] / target / linux / xburst / patches-3.10 / 005-MMC-JZ4740-Fix-handling-of-read-errors.patch
1 From 81d112d6c0e16fd0136ce2c5f511ba81ed1f23d2 Mon Sep 17 00:00:00 2001
2 From: Paul Cercueil <paul@crapouillou.net>
3 Date: Sun, 3 Jun 2012 13:07:19 +0200
4 Subject: [PATCH 05/16] MMC: JZ4740: Fix handling of read errors.
5
6 For no reason, the code handling write errors was implemented while
7 the code handling read errors was missing.
8
9 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
10 ---
11 drivers/mmc/host/jz4740_mmc.c | 8 ++++++++
12 1 file changed, 8 insertions(+)
13
14 --- a/drivers/mmc/host/jz4740_mmc.c
15 +++ b/drivers/mmc/host/jz4740_mmc.c
16 @@ -231,6 +231,14 @@ static void jz4740_mmc_transfer_check_st
17 host->req->cmd->error = -EIO;
18 data->error = -EIO;
19 }
20 + } else if (status & JZ_MMC_STATUS_READ_ERROR_MASK) {
21 + if (status & (JZ_MMC_STATUS_TIMEOUT_READ)) {
22 + host->req->cmd->error = -ETIMEDOUT;
23 + data->error = -ETIMEDOUT;
24 + } else {
25 + host->req->cmd->error = -EIO;
26 + data->error = -EIO;
27 + }
28 }
29 }
30