mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Stefan Riedmueller <s.riedmueller@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH] mtd: ubi: Max out default wear-leveling threshold
Date: Wed, 10 Jul 2019 13:27:30 +0200	[thread overview]
Message-ID: <1562758050-447264-1-git-send-email-s.riedmueller@phytec.de> (raw)

Due to the recursive ubi_thread implementation in the barebox, a large
amount of wear-leveling can lead to a stack overflow.

This was observed during extensive ubi stress tests with the linux
kernel and periodic power cycles. We found that if the wear-leveling
threshold is exceeded and a large amount of erase blocks need
wear-leveling the stack can overflow.

The hardware used to observe this was a phyCORE-i.MX 6 with 1GB NAND flash.

As the kernel is perfectly capable of handling wear-leveling we can
increase the wear-leveling threshold in the barebox to leave it to the
kernel. To minimize the chance of wear-leveling in the barebox max out
the threshold.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
---
 drivers/mtd/ubi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig
index 9a344082b7bb..509a1f77ddcd 100644
--- a/drivers/mtd/ubi/Kconfig
+++ b/drivers/mtd/ubi/Kconfig
@@ -12,7 +12,7 @@ if MTD_UBI
 
 config MTD_UBI_WL_THRESHOLD
 	int "UBI wear-leveling threshold"
-	default 4096
+	default 65536
 	range 2 65536
 	help
 	  This parameter defines the maximum difference between the highest
-- 
2.7.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2019-07-10 11:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 11:27 Stefan Riedmueller [this message]
2019-07-11  7:01 ` Sascha Hauer
2019-07-11 11:04   ` Stefan Riedmüller
2019-07-18  8:24     ` Stefan Riedmüller
2019-07-18 12:19       ` Sascha Hauer
2019-07-18 12:27         ` Stefan Riedmüller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1562758050-447264-1-git-send-email-s.riedmueller@phytec.de \
    --to=s.riedmueller@phytec.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox