julianoes commented on code in PR #18771:
URL: https://github.com/apache/nuttx/pull/18771#discussion_r3121436930


##########
drivers/mtd/w25n.c:
##########
@@ -627,7 +993,32 @@ static int w25n_erase(FAR struct mtd_dev_s *dev, off_t 
startblock,
 
   for (i = 0; i < nblocks; i++)
     {
-      ret = w25n_block_erase(priv, startblock + i);
+      uint32_t block = startblock + i;
+      int attempt;
+
+      for (attempt = 0; attempt < 2; attempt++)
+        {
+          ret = w25n_block_erase(priv, block);
+          if (ret == OK || ret != -EIO)

Review Comment:
   I will make a comment in source but that's intentional. We only  want to 
catch E-FAIL from chip but not ETIMEDOUT.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to