From patchwork Wed May 22 13:37:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 245621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CF54D2C00A0 for ; Wed, 22 May 2013 23:39:09 +1000 (EST) Received: from localhost ([::1]:36192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9Fz-0000ew-VG for incoming@patchwork.ozlabs.org; Wed, 22 May 2013 09:39:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9EU-0007ZU-Rm for qemu-devel@nongnu.org; Wed, 22 May 2013 09:37:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf9EQ-0006NX-II for qemu-devel@nongnu.org; Wed, 22 May 2013 09:37:34 -0400 Received: from mail-oa0-f41.google.com ([209.85.219.41]:55729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9EQ-0006NO-DR for qemu-devel@nongnu.org; Wed, 22 May 2013 09:37:30 -0400 Received: by mail-oa0-f41.google.com with SMTP id n9so2582244oag.28 for ; Wed, 22 May 2013 06:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=+/DDv6CvzLiottHIjSZsv95WlptPQV5QEP1U6K+BMvM=; b=xf7VxO0Yj3fukGdQzouaLD4FeMlrIybsbUPgEnIrnSOfPjks9IcOtq6DsvA/zSUKgW Jt0FUOMLjX2w5sFWtPohMxkG+Z0DPIEjl/fr+rP/g+ooVNVOVmMJ6ggzRnD+TU0qPeRJ YCiANy9cA43ifxHNhRvodRd9fzd2rJdNP7RYQbiwgm1kRH1zjei5nj0VUTakWctBMW8b JtzL8d8kroGPiRntJumTAYmlTDyL7lC4+Vm3tndZNXRxqgqNIwslbdYoyapcXrY3rG6d uu5NW7r80pU+D7LYxu/rp5DJxIVkLHBumzB7n1pBb5ZytEuhSvJXXzvWmemju4amCHTA 51UA== MIME-Version: 1.0 X-Received: by 10.182.237.50 with SMTP id uz18mr4760006obc.51.1369229849602; Wed, 22 May 2013 06:37:29 -0700 (PDT) Received: by 10.76.13.129 with HTTP; Wed, 22 May 2013 06:37:29 -0700 (PDT) Date: Wed, 22 May 2013 17:37:29 +0400 Message-ID: From: Igor Mitsyanko To: peter.crosthwaite@xilinx.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.219.41 Cc: Peter Maydell , qemu-devel@nongnu.org, edgar.iglesias@gmail.com Subject: Re: [Qemu-devel] [PATCH arm-devs v1 1/5] sd/sd.c: Fix "inquiry" ACMD41 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 On 05/21/2013 10:50 AM, peter.crosthwaite@xilinx.com wrote: From: Peter Crosthwaite the SD command ACMD41 can be used in a read only mode to query device state without doing the SD card initialisation. This is valid even which the device is already initialised. Fix the command to be responsive when in the ready state accordingly. Signed-off-by: Peter Crosthwaite Reviewed-by: Igor Mitsyanko --- hw/sd/sd.c | 1 + 1 file changed, 1 insertion(+) I couldn't find any info in SD specification that would confirm this change correctness, what about table "Table 4-29: Card State Transition Table" which states that ACMD41 is illegal in "ready" state? diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 2e0ef3e..89bfb7a 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1277,6 +1277,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, } switch (sd->state) { case sd_idle_state: + case sd_ready_state: /* We accept any voltage. 10000 V is nothing. */ if (req.arg) sd->state = sd_ready_state;