[edk2-devel] [PATCH v2 4/7] EmbeddedPkg: Fix response check flag

Loh, Tien Hock posted 7 patches 6 years, 8 months ago
[edk2-devel] [PATCH v2 4/7] EmbeddedPkg: Fix response check flag
Posted by Loh, Tien Hock 6 years, 8 months ago
From: "Tien Hock, Loh" <tien.hock.loh@intel.com>

Do not send CRC response check if the MMC command does not support CRC
response

Signed-off-by: Tien Hock, Loh <tien.hock.loh@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index c44e310c04..e0068655ca 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -385,7 +385,7 @@ DwEmmcSendCommand (
            BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
     break;
   default:
-    Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
+    Cmd = BIT_CMD_RESPONSE_EXPECT;
     break;
   }
 
@@ -396,6 +396,10 @@ DwEmmcSendCommand (
   else
     IsACmd = FALSE;
 
+  if (!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) {
+    Cmd |= BIT_CMD_CHECK_RESPONSE_CRC;
+  }
+
   if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
     mDwEmmcCommand = Cmd;
     mDwEmmcArgument = Argument;
-- 
2.19.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41412): https://edk2.groups.io/g/devel/message/41412
Mute This Topic: https://groups.io/mt/31807963/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 4/7] EmbeddedPkg: Fix response check flag
Posted by Leif Lindholm 6 years, 8 months ago
On Mon, May 27, 2019 at 05:30:25PM +0800, tien.hock.loh@intel.com wrote:
> From: "Tien Hock, Loh" <tien.hock.loh@intel.com>
> 
> Do not send CRC response check if the MMC command does not support CRC
> response
> 
> Signed-off-by: Tien Hock, Loh <tien.hock.loh@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> index c44e310c04..e0068655ca 100644
> --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> @@ -385,7 +385,7 @@ DwEmmcSendCommand (
>             BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
>      break;
>    default:
> -    Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
> +    Cmd = BIT_CMD_RESPONSE_EXPECT;
>      break;
>    }
>  
> @@ -396,6 +396,10 @@ DwEmmcSendCommand (
>    else
>      IsACmd = FALSE;
>  
> +  if (!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) {
> +    Cmd |= BIT_CMD_CHECK_RESPONSE_CRC;
> +  }
> +
>    if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
>      mDwEmmcCommand = Cmd;
>      mDwEmmcArgument = Argument;
> -- 
> 2.19.0
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41537): https://edk2.groups.io/g/devel/message/41537
Mute This Topic: https://groups.io/mt/31807963/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-