From patchwork Fri Mar 9 17:26:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 131190 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1269434lja; Fri, 9 Mar 2018 09:49:33 -0800 (PST) X-Google-Smtp-Source: AG47ELtb3QY/bDQ4VCjmUFs0JShj4DWBqmawFnuJANeSpUflPDzwSSolr4GBct7aCm9Bt1oXHaMR X-Received: by 2002:a25:543:: with SMTP id 64-v6mr3973549ybf.130.1520617773091; Fri, 09 Mar 2018 09:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520617773; cv=none; d=google.com; s=arc-20160816; b=nB8XCC+oPCKqZSdKMSRfJ6P1tUbrB0xFgcZAESgjsXbabOh+pa+Ib82IiuCq9D1e9e 53XNTdqBHDsIJxilwAilK6yInFO+YD74aaHbvRC3nhnB7ztTiFxoRzSBByb/U4xx2LnW zj9Z2eTkriN3MYaITYm0SFrJ5Fgfncv7EgTxgKJJNw0KrLJH9UA7YVD5qap2S2lWOXb4 /1jlAG5fh1qTkVnMIwiy5BTTyvwqgeu18KjffGul6AiH7VrzVgdT5tuBd1mtG7/VcWqa ztiMBogjri0VJ2hR2ZZcnTVW2afkwefFKhV2gR3mTqhliq5ClpHKgrOeVyFmhGeuE2Xb sd0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=osb7W1G4F2DB2w3nCjQ+xUADMBnf6VpulCVMh92A4Zw=; b=UMDC52PC8quKeK1R5Tl7i4dSBWBh8F2iXmFVkTxNOHGB8Gh1+ELU0xmFcMzP4P2ffZ 3zGOjRMwNUFAbmRvF0J+0/yH4UkRf0+C5jhi0Oc2Ka3rOT3yEOgkq8A6214jB6SZTAxE rveSbiVkL/hvxzkHjzRbqMhTVIJsmuXKUzLL827eDBhNoJ6yTC5mxyUYgwOw3gVpxEzH 5+UD8PYpZdnyl2VERVorEB74/SK2EZll41qemvo7qkPedgfT9KOgsCHpzpvyvzZJmXO6 t28icXHKnowFtNgC72lCF3jy2t4psBtnp+ty7u7upeohfdXtIqRlE33wx0mB3d40AUxR C9gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k190si270432ywg.126.2018.03.09.09.49.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 09 Mar 2018 09:49:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euM96-0002ph-Gm for patch@linaro.org; Fri, 09 Mar 2018 12:49:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euLmx-0008UK-Ma for qemu-devel@nongnu.org; Fri, 09 Mar 2018 12:26:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euLmw-00069v-GQ for qemu-devel@nongnu.org; Fri, 09 Mar 2018 12:26:39 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:47006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1euLmw-000693-6M for qemu-devel@nongnu.org; Fri, 09 Mar 2018 12:26:38 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1euLmv-00078f-8d for qemu-devel@nongnu.org; Fri, 09 Mar 2018 17:26:37 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 17:26:17 +0000 Message-Id: <20180309172622.4277-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180309172622.4277-1-peter.maydell@linaro.org> References: <20180309172622.4277-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 20/25] sdcard: Do not trace CMD55, except when we already expect an ACMD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Acked-by: Alistair Francis Message-id: 20180309153654.13518-2-f4bug@amsat.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/sd/sd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.16.2 diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 933890e86f..4a9520e38e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -866,13 +866,18 @@ static void sd_lock_command(SDState *sd) sd->card_status &= ~CARD_IS_LOCKED; } -static sd_rsp_type_t sd_normal_command(SDState *sd, - SDRequest req) +static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) { uint32_t rca = 0x0000; uint64_t addr = (sd->ocr & (1 << 30)) ? (uint64_t) req.arg << 9 : req.arg; - trace_sdcard_normal_command(req.cmd, req.arg, sd_state_name(sd->state)); + /* CMD55 precedes an ACMD, so we are not interested in tracing it. + * However there is no ACMD55, so we want to trace this particular case. + */ + if (req.cmd != 55 || sd->expecting_acmd) { + trace_sdcard_normal_command(req.cmd, req.arg, + sd_state_name(sd->state)); + } /* Not interpreting this as an app command */ sd->card_status &= ~APP_CMD;