From patchwork Sun Jun 9 19:10:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 2694711 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E50ED3FC23 for ; Sun, 9 Jun 2013 19:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405Ab3FITG4 (ORCPT ); Sun, 9 Jun 2013 15:06:56 -0400 Received: from smtp-out-250.synserver.de ([212.40.185.250]:1114 "EHLO smtp-out-250.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433Ab3FITGz (ORCPT ); Sun, 9 Jun 2013 15:06:55 -0400 Received: (qmail 9150 invoked by uid 0); 9 Jun 2013 19:06:50 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@laprican.de X-SynServer-PPID: 8900 Received: from ppp-188-174-124-32.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [188.174.124.32] by 217.119.54.87 with SMTP; 9 Jun 2013 19:06:49 -0000 From: Lars-Peter Clausen To: Chris Ball Cc: Paul Cercueil , Maarten ter Huurne , linux-mmc@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH 3/6] mmc: jz4740: Fix handling of read errors. Date: Sun, 9 Jun 2013 21:10:02 +0200 Message-Id: <1370805005-8104-3-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1370805005-8104-1-git-send-email-lars@metafoo.de> References: <1370805005-8104-1-git-send-email-lars@metafoo.de> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Paul Cercueil For no reason, the code handling write errors was implemented while the code handling read errors was missing. Signed-off-by: Paul Cercueil Signed-off-by: Lars-Peter Clausen --- drivers/mmc/host/jz4740_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index b31359d..3f86592 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -231,6 +231,14 @@ static void jz4740_mmc_transfer_check_state(struct jz4740_mmc_host *host, host->req->cmd->error = -EIO; data->error = -EIO; } + } else if (status & JZ_MMC_STATUS_READ_ERROR_MASK) { + if (status & (JZ_MMC_STATUS_TIMEOUT_READ)) { + host->req->cmd->error = -ETIMEDOUT; + data->error = -ETIMEDOUT; + } else { + host->req->cmd->error = -EIO; + data->error = -EIO; + } } }