From patchwork Sun Dec 18 20:37:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 5837 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D1EC624056 for ; Sun, 18 Dec 2011 20:38:05 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id BF536A18284 for ; Sun, 18 Dec 2011 20:38:05 +0000 (UTC) Received: by eaac11 with SMTP id c11so1269910eaa.11 for ; Sun, 18 Dec 2011 12:38:05 -0800 (PST) Received: by 10.205.120.14 with SMTP id fw14mr750256bkc.53.1324240684794; Sun, 18 Dec 2011 12:38:04 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.40.4 with SMTP id i4cs108675bke; Sun, 18 Dec 2011 12:38:04 -0800 (PST) Received: by 10.180.103.131 with SMTP id fw3mr22568146wib.57.1324240682915; Sun, 18 Dec 2011 12:38:02 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id e1si9482618wbh.119.2011.12.18.12.38.02 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Dec 2011 12:38:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RcNUe-00070U-O3; Sun, 18 Dec 2011 20:38:00 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 03/10] hw/sd.c: On CRC error, set CRC error status bit rather than clearing it Date: Sun, 18 Dec 2011 20:37:53 +0000 Message-Id: <1324240680-26905-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1324240680-26905-1-git-send-email-peter.maydell@linaro.org> References: <1324240680-26905-1-git-send-email-peter.maydell@linaro.org> If we fail to validate the CRC for an SD command we should be setting COM_CRC_ERROR, not clearing it. (This bug actually has no effect currently because sd_req_crc_validate() always returns success.) Signed-off-by: Peter Maydell --- hw/sd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index 245b6c3..e57852e 100644 --- a/hw/sd.c +++ b/hw/sd.c @@ -1300,7 +1300,7 @@ int sd_do_command(SDState *sd, SDRequest *req, } if (sd_req_crc_validate(req)) { - sd->card_status &= ~COM_CRC_ERROR; + sd->card_status |= COM_CRC_ERROR; return 0; }