From patchwork Wed Sep 25 14:56:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1167403 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Jy3NwnAG"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46dhrs0Fgmz9sP3 for ; Thu, 26 Sep 2019 01:32:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 90B37C2208B; Wed, 25 Sep 2019 15:12:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 08F09C22110; Wed, 25 Sep 2019 15:00:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B5159C22040; Wed, 25 Sep 2019 15:00:33 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id D2807C22040 for ; Wed, 25 Sep 2019 14:58:20 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id a1so14639866ioc.6 for ; Wed, 25 Sep 2019 07:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SgfN2Qj7b1Xr0jQAnl5Gy4vGye0HEVYBV3xyXzz4dX8=; b=Jy3NwnAGj0SYcjOJANnoOSCEjSipleUl3jVDiwIwn9uPcu3h191hB0qlt5oV6KTmMO dUXL7+fEFvyXp+/TfmZdKyLyow3ie/lCigtVNhiaAKKQsA9A8wMPSIiwZykkXrnMbP+4 NQ/JspOFBoD+qHbF8z0wG1grx0NLerLyaAe0M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SgfN2Qj7b1Xr0jQAnl5Gy4vGye0HEVYBV3xyXzz4dX8=; b=k/bmaZpmz7HtOqhnRtdYFmbGQS4VPfTK+XGeB5kFaJPvVW4s7wqp4hVw6KXWHhHTSm 4p85xkAqfXa6wyLmTWhxDIQ2fSupegkhGtmwZdT0WqXFdUGuDBEYBf+92lPP8bbylRrI gjD5y1t0TGeBQAAqvRgjEX5RtL40t3fsYwOX6Ren34k9PIqxlLsZGLJK4ph0geAOW29b 3JIU6uflzZ/hH554WFdbJQIDuJFu2n/WLptV6PdB1t6vYGSwiZYr2TSXIkP6eQd9Hvnh oCC7Unyq3NKdCVZrMOlsFbgN8KDZ0ana+sG4DAh7HCd+Yvy7aIla36BVPmDxy8jKSo8a A1ww== X-Gm-Message-State: APjAAAUs3AlFdnjotuQYPqG3e6jZTd7/gtNOmgYHLdkHQVpTu9G2VRZl NlAO8Gadcboi72FYjFRpe6TL9fPg5BA= X-Google-Smtp-Source: APXvYqzTuiRcCC6z8Cppq3b9Ru2l/4Ausso/WSARCr8XeVmwWKUgocMbW/O2ZGVu6MlBAqibEJMT+A== X-Received: by 2002:a02:6284:: with SMTP id d126mr5586140jac.51.1569423499600; Wed, 25 Sep 2019 07:58:19 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id d9sm4254964ioq.9.2019.09.25.07.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 07:58:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 25 Sep 2019 08:56:00 -0600 Message-Id: <20190925145750.200592-17-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.444.g18eeb5a265-goog In-Reply-To: <20190925145750.200592-1-sjg@chromium.org> References: <20190925145750.200592-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 016/126] sandbox: mmc: Fix up MMC emulator for valgrind X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present running sandbox with valgrind produces some warnings due to the MMC emulator not filling in all the expected fields. Fix it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- drivers/mmc/sandbox_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/sandbox_mmc.c b/drivers/mmc/sandbox_mmc.c index 2fa7d8c3dcd..7ca8da0946c 100644 --- a/drivers/mmc/sandbox_mmc.c +++ b/drivers/mmc/sandbox_mmc.c @@ -27,6 +27,7 @@ static int sandbox_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, { switch (cmd->cmdidx) { case MMC_CMD_ALL_SEND_CID: + memset(cmd->response, '\0', 16); break; case SD_CMD_SEND_RELATIVE_ADDR: cmd->response[0] = 0 << 16; /* mmc->rca */ @@ -43,11 +44,14 @@ static int sandbox_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, case MMC_CMD_SEND_CSD: cmd->response[0] = 0; cmd->response[1] = 10 << 16; /* 1 << block_len */ + cmd->response[2] = 0; + cmd->response[3] = 0; break; case SD_CMD_SWITCH_FUNC: { if (!data) break; u32 *resp = (u32 *)data->dest; + resp[3] = 0; resp[7] = cpu_to_be32(SD_HIGHSPEED_BUSY); if ((cmd->cmdarg & 0xF) == UHS_SDR12_BUS_SPEED) resp[4] = (cmd->cmdarg & 0xF) << 24;