From patchwork Fri Feb 18 13:39: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: 83594 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3B60AB70ED for ; Sat, 19 Feb 2011 00:40:10 +1100 (EST) Received: from localhost ([127.0.0.1]:49797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqQZ3-0005x8-BW for incoming@patchwork.ozlabs.org; Fri, 18 Feb 2011 08:40:05 -0500 Received: from [140.186.70.92] (port=58449 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqQYA-0005uq-Ox for qemu-devel@nongnu.org; Fri, 18 Feb 2011 08:39:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqQY9-0005UK-Db for qemu-devel@nongnu.org; Fri, 18 Feb 2011 08:39:10 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:42380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqQY9-0005Tg-71 for qemu-devel@nongnu.org; Fri, 18 Feb 2011 08:39:09 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1PqQY0-0002xi-P3; Fri, 18 Feb 2011 13:39:00 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 18 Feb 2011 13:39:00 +0000 Message-Id: <1298036340-11363-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.3 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] hw/sd.c: Add missing state change for SD_STATUS, SEND_NUM_WR_BLOCKS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The SD_STATUS and SEND_NUM_WR_BLOCKS commands are supposed to cause the card to send data back to the host. However sd.c was missing the state change to sd_sendingdata_state for these commands, with the effect that the Linux driver would either hang indefinitely waiting for nonexistent data (pl181) or read zeroes and provoke a qemu warning message (omap). Signed-off-by: Peter Maydell --- hw/sd.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index 789ca84..5e29752 100644 --- a/hw/sd.c +++ b/hw/sd.c @@ -1168,6 +1168,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, case 13: /* ACMD13: SD_STATUS */ switch (sd->state) { case sd_transfer_state: + sd->state = sd_sendingdata_state; sd->data_start = 0; sd->data_offset = 0; return sd_r1; @@ -1182,6 +1183,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, case sd_transfer_state: *(uint32_t *) sd->data = sd->blk_written; + sd->state = sd_sendingdata_state; sd->data_start = 0; sd->data_offset = 0; return sd_r1;