From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=I5DcoDPt; spf=pass (domain: linaro.org, ip: 209.85.221.66, mailfrom: leif.lindholm@linaro.org) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by groups.io with SMTP; Tue, 28 May 2019 10:57:00 -0700 Received: by mail-wr1-f66.google.com with SMTP id f8so21271802wrt.1 for ; Tue, 28 May 2019 10:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6iDpI6aVIK79LNyoZJwJn4dI6bBUGNdwmnwCs/K5Tn4=; b=I5DcoDPtplf+d2dvPOeij6ubDQeNavwaQIae5iewNnzGE6GnkuljabVehzzVnjB+Tz rSU56ELWqktAx6iUcW1NWDeAaq/aQ1Pz/lv8W6V2IK5VsAIBc6uMoY4sBMiTanT1Uwbi OXnZkFSbQS5SqtGJEuNTt65y4SPq4OvAnilxZKFDC0mucTF3G56AedKolak2x/Qa9C+S n/xVH+Zdy0TmhXuBSd/yRazmos0JwqkC9CT0RVy76iLSJL/wXXXq2DZJu4skmckCJy4+ Rhp8wZWj+ri/CO9h8StcpNpJptF9TgShqZ2ccdxpf/8dCXZTzDXeyFlhsFdD27LWQYAe qW5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6iDpI6aVIK79LNyoZJwJn4dI6bBUGNdwmnwCs/K5Tn4=; b=hCEMxDpSukMia63b+4HumXveauoAqVtkAAuRDjXhHMufo+githT7zuLbTi4iDp8WPR oXDL87IHKRPbkPDtcgmv9ooVI2n1rVw5Xualc7weT41akcKbptp+BsW+10WJRM3OwQUI yYIOOcsC9XW0RBL7qkB4fZATqg6BJ415jcF9JrMOkjR0ihHnG+8sYViokjYJR5a4M24h xlAxRC4MDmt6IeuoM8lxN+352ihJtGKKEGBrw9ZCaNYVag592MVZZB3EaRUKPVAbUyaa 49sepmMOqYleaszLqOimYhd4x2+RLOBOLiIp9eVmABKz4n7LID4z7eYtan79c5n8Fnok A7zQ== X-Gm-Message-State: APjAAAVZojcfRVULp/aJsxsrKl5Zl/zX+jslKIvGtmGD11YF4x1axyrN jNvoBwQuXmagJiGSHwusYO5QRA== X-Google-Smtp-Source: APXvYqxvmyWhgWHJIsZjjGfovq7d/t0YBzRKAstL4L8RlS2WRWWOKtiTNQZF4aTyNxN4oOfROX/icw== X-Received: by 2002:adf:f311:: with SMTP id i17mr4545020wro.207.1559066218427; Tue, 28 May 2019 10:56:58 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id x7sm1953719wmc.44.2019.05.28.10.56.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 10:56:57 -0700 (PDT) Date: Tue, 28 May 2019 18:56:55 +0100 From: "Leif Lindholm" To: tien.hock.loh@intel.com Cc: devel@edk2.groups.io, thloh85@gmail.com, Ard Biesheuvel Subject: Re: [PATCH v2 3/7] EmbeddedPkg: Send command when MMC ask for response Message-ID: <20190528175655.sydchs25ndqsztez@bivouac.eciton.net> References: <1558949428-190715-1-git-send-email-tien.hock.loh@intel.com> <1558949428-190715-4-git-send-email-tien.hock.loh@intel.com> MIME-Version: 1.0 In-Reply-To: <1558949428-190715-4-git-send-email-tien.hock.loh@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, May 27, 2019 at 05:30:24PM +0800, tien.hock.loh@intel.com wrote: > From: "Tien Hock, Loh" > > Send command when MMC ask for response in DwEmmcReceiveResponse, and > command is a pending command (eg. DMA needs to be set up first) > > Signed-off-by: "Tien Hock, Loh" > Cc: Leif Lindholm > Cc: Ard Biesheuvel > --- > EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > index fd3a5bf685..c44e310c04 100644 > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > @@ -400,6 +400,8 @@ DwEmmcSendCommand ( > mDwEmmcCommand = Cmd; > mDwEmmcArgument = Argument; > } else { > + mDwEmmcCommand = Cmd; > + mDwEmmcArgument = Argument; OK, sorry, I didn't spot this last time around - but these two lines are now present for both sides of the conditional, so should be moved outside. Which (I think) would turn it into mDwEmmcCommand = Cmd; mDwEmmcArgument = Argument; if (!IsPendingReadCommand (Cmd) && !IsPendingWriteCommand (Cmd)) { Status = SendCommand (Cmd, Argument); } > Status = SendCommand (Cmd, Argument); > } > return Status; > @@ -412,10 +414,15 @@ DwEmmcReceiveResponse ( > IN UINT32* Buffer > ) > { > + EFI_STATUS Status = EFI_SUCCESS; > + > if (Buffer == NULL) { > return EFI_INVALID_PARAMETER; > } > > + if(IsPendingReadCommand (mDwEmmcCommand) || IsPendingWriteCommand(mDwEmmcCommand)) Space after if. Space after IsPendingWriteCommand. / Leif > + Status = SendCommand (mDwEmmcCommand, mDwEmmcArgument); > + > if ( (Type == MMC_RESPONSE_TYPE_R1) > || (Type == MMC_RESPONSE_TYPE_R1b) > || (Type == MMC_RESPONSE_TYPE_R3) > @@ -429,7 +436,7 @@ DwEmmcReceiveResponse ( > Buffer[2] = MmioRead32 (DWEMMC_RESP2); > Buffer[3] = MmioRead32 (DWEMMC_RESP3); > } > - return EFI_SUCCESS; > + return Status; > } > > VOID > -- > 2.19.0 >