From patchwork Sun Dec 18 20:38:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 132109 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 7CE3CB700D for ; Mon, 19 Dec 2011 07:38:23 +1100 (EST) Received: from localhost ([::1]:48992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcNUy-0005HI-Mp for incoming@patchwork.ozlabs.org; Sun, 18 Dec 2011 15:38:20 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcNUp-0005H7-Nn for qemu-devel@nongnu.org; Sun, 18 Dec 2011 15:38:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RcNUo-0006ym-Tj for qemu-devel@nongnu.org; Sun, 18 Dec 2011 15:38:11 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:38904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcNUo-0006yK-MG for qemu-devel@nongnu.org; Sun, 18 Dec 2011 15:38:10 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RcNUe-00070i-SQ; Sun, 18 Dec 2011 20:38:00 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Sun, 18 Dec 2011 20:38:00 +0000 Message-Id: <1324240680-26905-11-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 10/10] hw/sd.c: Clear status bits when read via response r6 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 Response format r6 includes a subset of the status bits; clear the clear-on-read bits which are read by an r6 response. Signed-off-by: Peter Maydell --- hw/sd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index 6614cbf..2b8ebe4 100644 --- a/hw/sd.c +++ b/hw/sd.c @@ -371,6 +371,7 @@ static void sd_response_r6_make(SDState *sd, uint8_t *response) status = ((sd->card_status >> 8) & 0xc000) | ((sd->card_status >> 6) & 0x2000) | (sd->card_status & 0x1fff); + sd->card_status &= ~(CARD_STATUS_C & 0xc81fff); response[0] = (arg >> 8) & 0xff; response[1] = arg & 0xff;