From patchwork Tue Jan 11 16:35:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 472081 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0BGaMfU007018 for ; Tue, 11 Jan 2011 16:36:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932429Ab1AKQgE (ORCPT ); Tue, 11 Jan 2011 11:36:04 -0500 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:37360 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932428Ab1AKQgD (ORCPT ); Tue, 11 Jan 2011 11:36:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=sERcdCka0CH+AAo1pLQJsXoN8ws/NP+s9Ir+oHy7A1U=; b=UsXkg0Y1AHzxr6kaQKLER+D5ZXinGZEjmedVnfOvELdEoX8rgXrbMdOXWO08TaXCeCH+gggyrAFooXl/+/TfyXB2BJNN9v04k3FMTtRC8gCDUa8Yc3WSeD6vgBzJD1Mo68io/r8UdQCcZ5dialuJPbFKlkU1RmGkj0szwisQH3k=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1PchCP-0005CP-N6; Tue, 11 Jan 2011 16:35:58 +0000 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.72) (envelope-from ) id 1PchCO-0004sT-HV; Tue, 11 Jan 2011 16:35:56 +0000 Date: Tue, 11 Jan 2011 16:35:56 +0000 From: Russell King - ARM Linux To: Chris Ball Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] MMCI: don't read command response when invalid Message-ID: <20110111163556.GA18746@n2100.arm.linux.org.uk> References: <20110111163502.GJ11039@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110111163502.GJ11039@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 11 Jan 2011 16:36:22 +0000 (UTC) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 5630228..040de4f 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -394,15 +394,15 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, host->cmd = NULL; - cmd->resp[0] = readl(base + MMCIRESPONSE0); - cmd->resp[1] = readl(base + MMCIRESPONSE1); - cmd->resp[2] = readl(base + MMCIRESPONSE2); - cmd->resp[3] = readl(base + MMCIRESPONSE3); - if (status & MCI_CMDTIMEOUT) { cmd->error = -ETIMEDOUT; } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) { cmd->error = -EILSEQ; + } else { + cmd->resp[0] = readl(base + MMCIRESPONSE0); + cmd->resp[1] = readl(base + MMCIRESPONSE1); + cmd->resp[2] = readl(base + MMCIRESPONSE2); + cmd->resp[3] = readl(base + MMCIRESPONSE3); } if (!cmd->data || cmd->error) {