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: 132113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 99E47B6FF0 for ; Mon, 19 Dec 2011 07:38:53 +1100 (EST) Received: from localhost ([::1]:52654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcNVS-0007JR-Ha for incoming@patchwork.ozlabs.org; Sun, 18 Dec 2011 15:38:50 -0500 Received: from eggs.gnu.org ([140.186.70.92]:43022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcNUt-0005NR-4I for qemu-devel@nongnu.org; Sun, 18 Dec 2011 15:38:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RcNUq-0006zP-TT for qemu-devel@nongnu.org; Sun, 18 Dec 2011 15:38:14 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:38904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcNUq-0006yK-LC for qemu-devel@nongnu.org; Sun, 18 Dec 2011 15:38:12 -0500 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 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: patches@linaro.org Subject: [Qemu-devel] [PATCH 03/10] hw/sd.c: On CRC error, set CRC error status bit rather than clearing it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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; }