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 2024/09/15 02:21:51 UTC

(nuttx) branch master updated (b2221806cb -> 1af4cdf500)

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

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


    from b2221806cb rpmsgdev_server: Support oneway polling
     new c40f9b8d9f driver/ftl: Read the current eraseblock only
     new a6080e4502 Revert "driver/ftl: Read the current eraseblock only"
     new 1af4cdf500 driver/ftl: Read the consecutive eraseblocks

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 drivers/mtd/ftl.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


(nuttx) 01/03: driver/ftl: Read the current eraseblock only

Posted by xi...@apache.org.
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/nuttx.git

commit c40f9b8d9f7ea0342e002332e7f5b0d867383b6f
Author: wangjianyu3 <wa...@xiaomi.com>
AuthorDate: Tue Feb 6 12:40:17 2024 +0800

    driver/ftl: Read the current eraseblock only
    
    case: The next eraseblock is bad
    
    Signed-off-by: wangjianyu3 <wa...@xiaomi.com>
---
 drivers/mtd/ftl.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 5ec0a68462..4fdcb6fba1 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -287,6 +287,7 @@ static ssize_t ftl_mtd_bread(FAR struct ftl_struct_s *dev, off_t startblock,
     {
       off_t startphysicalblock;
       off_t starteraseblock;
+      size_t erase;
       size_t count;
 
       starteraseblock = startblock / dev->blkper;
@@ -296,9 +297,14 @@ static ssize_t ftl_mtd_bread(FAR struct ftl_struct_s *dev, off_t startblock,
           break;
         }
 
-      count = ftl_get_cblock(dev, starteraseblock,
+      erase = ftl_get_cblock(dev, starteraseblock,
                              (nblocks + mask) / dev->blkper);
-      count = MIN(count * dev->blkper, nblocks);
+      count = MIN(erase * dev->blkper, nblocks);
+      if (erase == 1)
+        {
+          count -= startblock & mask;
+        }
+
       startphysicalblock = dev->lptable[starteraseblock] *
                            dev->blkper + (startblock & mask);
       ret = MTD_BREAD(dev->mtd, startphysicalblock, count, buffer);


(nuttx) 03/03: driver/ftl: Read the consecutive eraseblocks

Posted by xi...@apache.org.
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/nuttx.git

commit 1af4cdf50078852fade0a44f031e19951b243259
Author: wangjianyu3 <wa...@xiaomi.com>
AuthorDate: Wed Feb 7 15:39:10 2024 +0800

    driver/ftl: Read the consecutive eraseblocks
    
    Signed-off-by: wangjianyu3 <wa...@xiaomi.com>
---
 drivers/mtd/ftl.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 5ec0a68462..86d33c20ad 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -287,6 +287,7 @@ static ssize_t ftl_mtd_bread(FAR struct ftl_struct_s *dev, off_t startblock,
     {
       off_t startphysicalblock;
       off_t starteraseblock;
+      off_t offset;
       size_t count;
 
       starteraseblock = startblock / dev->blkper;
@@ -296,11 +297,12 @@ static ssize_t ftl_mtd_bread(FAR struct ftl_struct_s *dev, off_t startblock,
           break;
         }
 
+      offset = startblock & mask;
       count = ftl_get_cblock(dev, starteraseblock,
-                             (nblocks + mask) / dev->blkper);
-      count = MIN(count * dev->blkper, nblocks);
+                             (offset + nblocks + mask) / dev->blkper);
+      count = MIN(count * dev->blkper - offset, nblocks);
       startphysicalblock = dev->lptable[starteraseblock] *
-                           dev->blkper + (startblock & mask);
+                           dev->blkper + offset;
       ret = MTD_BREAD(dev->mtd, startphysicalblock, count, buffer);
       if (ret == count || ret == -EUCLEAN)
         {


(nuttx) 02/03: Revert "driver/ftl: Read the current eraseblock only"

Posted by xi...@apache.org.
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/nuttx.git

commit a6080e4502c74ed55c30cecced0f06a76c66e67f
Author: wangjianyu3 <wa...@xiaomi.com>
AuthorDate: Wed Feb 7 15:37:43 2024 +0800

    Revert "driver/ftl: Read the current eraseblock only"
    
    Signed-off-by: wangjianyu3 <wa...@xiaomi.com>
---
 drivers/mtd/ftl.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 4fdcb6fba1..5ec0a68462 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -287,7 +287,6 @@ static ssize_t ftl_mtd_bread(FAR struct ftl_struct_s *dev, off_t startblock,
     {
       off_t startphysicalblock;
       off_t starteraseblock;
-      size_t erase;
       size_t count;
 
       starteraseblock = startblock / dev->blkper;
@@ -297,14 +296,9 @@ static ssize_t ftl_mtd_bread(FAR struct ftl_struct_s *dev, off_t startblock,
           break;
         }
 
-      erase = ftl_get_cblock(dev, starteraseblock,
+      count = ftl_get_cblock(dev, starteraseblock,
                              (nblocks + mask) / dev->blkper);
-      count = MIN(erase * dev->blkper, nblocks);
-      if (erase == 1)
-        {
-          count -= startblock & mask;
-        }
-
+      count = MIN(count * dev->blkper, nblocks);
       startphysicalblock = dev->lptable[starteraseblock] *
                            dev->blkper + (startblock & mask);
       ret = MTD_BREAD(dev->mtd, startphysicalblock, count, buffer);