All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] UBI: regression since "mtd: ubi: Fix worker handling"
Date: Mon, 21 May 2018 13:38:57 +0000	[thread overview]
Message-ID: <0a34e4d0-7563-313f-ec09-e14ef8f27d58@st.com> (raw)

Hi Richard, Heiko

Since f82290afc847 ("mtd: ubi: Fix worker handling"),
when booting from NAND, on a fresh NAND just after being flashed (and 
only in this case), we got the following log:

ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd2
ubi0: scanning is finished
ubi0 error: ubi_update_fastmap: could not find any anchor PEB
ubi0 error: ubi_update_fastmap: could not find any anchor PEB
ubi0 error: ubi_wl_get_peb: Unable to get a free PEB from user WL pool
ubi0 error: autoresize: cannot auto-resize volume 1
UBI error: cannot attach mtd2UBI error: cannot initialize UBI, error 
-28UBI init error 28


After analysis, in ubi_wl_init(), when performing schedule_erase(),
thread_enabled flag is not yet set to 1, which forbids ubi_do_worker()
to execute pending works.

This has to effect to not populate ubi->free with free physical
eraseblocks.

As temporary workaround i did the following update on my side which fix 
this issue, but i don't consider it neither as a clean patch nor certain 
that it is enough :


@@ -1560,15 +1560,17 @@ int ubi_wl_init(struct ubi_device *ubi, struct 
ubi_attach_info *ai)
  			goto out_free;

  		e->pnum = aeb->pnum;
  		e->ec = aeb->ec;
  		ubi->lookuptbl[e->pnum] = e;
+		ubi->thread_enabled = 1;
  		if (schedule_erase(ubi, e, aeb->vol_id, aeb->lnum, 0)) {
+			ubi->thread_enabled = 0;
  			wl_entry_destroy(ubi, e);
  			goto out_free;
  		}
+		ubi->thread_enabled = 0;
  		found_pebs++;
  	}

  	list_for_each_entry(aeb, &ai->free, u.list) {


Regards

Patrice

             reply	other threads:[~2018-05-21 13:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 13:38 Patrice CHOTARD [this message]
2018-05-21 14:07 ` [U-Boot] UBI: regression since "mtd: ubi: Fix worker handling" Richard Weinberger
2018-05-21 19:31   ` Richard Weinberger
2018-05-22  6:30     ` Heiko Schocher
2018-05-22  6:37       ` Richard Weinberger
2018-05-22  6:51         ` Patrice CHOTARD
2018-05-22  7:21           ` Patrice CHOTARD
2018-05-22  7:29             ` Heiko Schocher
2018-05-22  7:38               ` Patrice CHOTARD

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=0a34e4d0-7563-313f-ec09-e14ef8f27d58@st.com \
    --to=patrice.chotard@st.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.