Received: from eggs.gnu.org ([140.186.70.92]:35946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdKEd-0006ic-T1 for qemu-devel@nongnu.org; Wed, 21 Dec 2011 06:21:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdKEc-0003Zx-Gr for qemu-devel@nongnu.org; Wed, 21 Dec 2011 06:21:23 -0500 Received: from indium.canonical.com ([91.189.90.7]:41638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdKEc-0003Zq-3c for qemu-devel@nongnu.org; Wed, 21 Dec 2011 06:21:22 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RdKEb-0003Gw-EX for ; Wed, 21 Dec 2011 11:21:21 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 6CFC72E8684 for ; Wed, 21 Dec 2011 11:21:21 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 21 Dec 2011 11:15:07 -0000 From: Peter Maydell Sender: bounces@canonical.com References: <20100623102444.24319.59850.malonedeb@palladium.canonical.com> Message-Id: <20111221111507.31495.5620.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 597641] Re: SD card state change from ident to stby Reply-To: Bug 597641 <597641@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org These two issues should now be fixed in qemu git master by commits 25881d3..3799ce4. ** Changed in: qemu Status: New =3D> Fix Committed -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/597641 Title: SD card state change from ident to stby Status in QEMU: Fix Committed Bug description: My environment host : Linux PC(2.6.29.4) Target: ARM-CortexA8 I am not running any OS on the target. Below is my command line: ../src/arm-softmmu/qemu-system-arm -M FPGA_NOOS -kernel elfImage -nograp= hic -sd sd.img Problem scenario 1. CMD13 issued immediately after identication phase reports SD card stat= e as "ident" instead of "stby". = 2. class 0(basic) commands are reported as "ILLEGAL_COMMAND" after the ca= rd is locked. Observation 1. In function sd_do_command(), the status of *previous* command is refle= cted only after the call to sd_set_status(sd). The variable "last_status" s= hould contain the updated value of sd->card_status in order to correctly in= dicate *last command's* card status. = 2. A "not" condition is missing in the if statement in the function sd_do= _command(), thereby falsely exiting the function for class0 commands issued= after card is locked. Below is the patch file that seems to be taking care of the above two pro= blems. *** sd-0.12.4.c 2010-06-23 13:56:05.000000000 +0530 --- sd-0.12.4.rudra.c 2010-06-23 14:08:10.000000000 +0530 *************** *** 1265,1278 **** sd->card_status &=3D ~CARD_STATUS_B; sd_set_status(sd); if (last_status & CARD_IS_LOCKED) ! if (((last_status & APP_CMD) && req->cmd =3D=3D 41) || (!(last_status & APP_CMD) && (sd_cmd_class[req->cmd] =3D=3D 0 || sd_cmd_class[req->cmd] =3D=3D 7 || ! req->cmd =3D=3D 16 || req->cmd =3D=3D 55))) { sd->card_status |=3D ILLEGAL_COMMAND; fprintf(stderr, "SD: Card is locked\n"); return 0; --- 1265,1279 ---- sd->card_status &=3D ~CARD_STATUS_B; sd_set_status(sd); + last_status =3D sd->card_status; if (last_status & CARD_IS_LOCKED) ! if (!(((last_status & APP_CMD) && req->cmd =3D=3D 41) || (!(last_status & APP_CMD) && (sd_cmd_class[req->cmd] =3D=3D 0 || sd_cmd_class[req->cmd] =3D=3D 7 || ! req->cmd =3D=3D 16 || req->cmd =3D=3D 55)))) { sd->card_status |=3D ILLEGAL_COMMAND; fprintf(stderr, "SD: Card is locked\n"); return 0; To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/597641/+subscriptions