qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [Bug 597641] Re: SD card state change from ident to stby


From: Peter Maydell
Subject: [Qemu-devel] [Bug 597641] Re: SD card state change from ident to stby
Date: Tue, 10 Jul 2012 14:40:23 -0000

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
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 Released

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 -nographic 
-sd sd.img

  Problem scenario
  1. CMD13 issued immediately after identication phase reports SD card state as 
"ident" instead of "stby". 
  2. class 0(basic) commands are reported as "ILLEGAL_COMMAND" after the card 
is locked.

  Observation
  1. In function sd_do_command(), the status of *previous* command is reflected 
only after the call to sd_set_status(sd). The variable "last_status" should 
contain the updated value of sd->card_status in order to correctly indicate 
*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 
problems.
  *** 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 &= ~CARD_STATUS_B;
        sd_set_status(sd);

        if (last_status & CARD_IS_LOCKED)
  !         if (((last_status & APP_CMD) &&
                                     req->cmd == 41) ||
                            (!(last_status & APP_CMD) &&
                             (sd_cmd_class[req->cmd] == 0 ||
                              sd_cmd_class[req->cmd] == 7 ||
  !                           req->cmd == 16 || req->cmd == 55))) {
                sd->card_status |= ILLEGAL_COMMAND;
                fprintf(stderr, "SD: Card is locked\n");
                return 0;
  --- 1265,1279 ----

        sd->card_status &= ~CARD_STATUS_B;
        sd_set_status(sd);
  +     last_status = sd->card_status;

        if (last_status & CARD_IS_LOCKED)
  !         if (!(((last_status & APP_CMD) &&
                                     req->cmd == 41) ||
                            (!(last_status & APP_CMD) &&
                             (sd_cmd_class[req->cmd] == 0 ||
                              sd_cmd_class[req->cmd] == 7 ||
  !                           req->cmd == 16 || req->cmd == 55)))) {
                sd->card_status |= 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]