You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/11/16 16:26:05 UTC

[incubator-nuttx] branch master updated: mpfs: emmcsd: boost waitresponse perf

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 6db480a  mpfs: emmcsd: boost waitresponse perf
6db480a is described below

commit 6db480a7f9c260ced7a77af77383497b1474c914
Author: Eero Nurkkala <ee...@offcode.fi>
AuthorDate: Tue Nov 16 12:22:14 2021 +0200

    mpfs: emmcsd: boost waitresponse perf
    
    When waiting for a response to a sent command, the command
    complete bit (MPFS_EMMCSD_SRS12_CC) should always guarantee
    the completion of that particular command. There's no need
    to have some combinations skipping the check of the command
    complete bit. Thus, remove the 'waitbits' parameter as it's
    unnecessary.
    
    Signed-off-by: Eero Nurkkala <ee...@offcode.fi>
---
 arch/risc-v/src/mpfs/mpfs_emmcsd.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/arch/risc-v/src/mpfs/mpfs_emmcsd.c b/arch/risc-v/src/mpfs/mpfs_emmcsd.c
index a4455a8..3772bac 100755
--- a/arch/risc-v/src/mpfs/mpfs_emmcsd.c
+++ b/arch/risc-v/src/mpfs/mpfs_emmcsd.c
@@ -2332,7 +2332,6 @@ static int mpfs_waitresponse(struct sdio_dev_s *dev, uint32_t cmd)
   struct mpfs_dev_s *priv = (struct mpfs_dev_s *)dev;
   uint32_t status;
   int32_t timeout;
-  uint32_t waitbits = 0;
 
   mcinfo("cmd: %08" PRIx32 "\n", cmd);
 
@@ -2363,22 +2362,17 @@ static int mpfs_waitresponse(struct sdio_dev_s *dev, uint32_t cmd)
 
   /* Then wait for the response (or timeout) */
 
-  if (cmd & MMCSD_DATAXFR_MASK)
-    {
-      waitbits = MPFS_EMMCSD_SRS12_CC;
-    }
-
   do
     {
       status = getreg32(MPFS_EMMCSD_SRS12);
     }
-  while (!(status & (waitbits | MPFS_EMMCSD_SRS12_EINT))
+  while (!(status & (MPFS_EMMCSD_SRS12_CC | MPFS_EMMCSD_SRS12_EINT))
          && --timeout);
 
   if (timeout == 0 || (status & MPFS_EMMCSD_SRS12_ECT))
     {
-      mcerr("ERROR: Timeout cmd: %08" PRIx32 " stat: %08" PRIx32 " wb: %08"
-            PRIx32 "\n", cmd, status, waitbits);
+      mcerr("ERROR: Timeout cmd: %08" PRIx32 " stat: %08" PRIx32 "\n", cmd,
+            status);
       return -EBUSY;
     }