From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mtd, ubi: set free_count to zero before walking through erase list
Date: Mon, 25 Apr 2016 07:46:37 +0200 [thread overview]
Message-ID: <571DAF3D.3000002@denx.de> (raw)
In-Reply-To: <20160422142141.0e440caa@bbrezillon>
Hello Boris,
Am 22.04.2016 um 14:21 schrieb Boris Brezillon:
> On Fri, 22 Apr 2016 13:53:00 +0200
> Heiko Schocher <hs@denx.de> wrote:
>
>>
>>> An alternative approach would be not executing work
>>> directly while scheduling it but in produce_free_peb().
>>> UBI is designed to work with the worker being disabled.
>>> All UBI work will then happen synchronous and should also work
>>> in u-boot.
>>
>> Sounds good!
>
> Not so good actually. I tried that, and ended up with tasks stalled in
> the work queue because the implementation was never "scheduling" the
> do_work() loop.
>
> Let's keep it simple, in uboot everything is synchronous, and you can't
> be preempted by another task, so it's safe to assume that "scheduling a
> work" == "executing it right away". IMHO, the kernel should also assume
> that "scheduling a work" might involve "the work may have been done
> before the ubi_schedule_work() function returns": when you schedule a
> work to be done and wake up the thread responsible for dequeuing UBI
> works, the scheduler can decide to schedule this thread right away,
> which means this work can be done before the caller gets back to the
> instruction just after ubi_schedule_work().
>
> Of course, this has to be nuanced for the "attach procedure", because at
> this time the UBI thread is not launched yet. But even in this
> specific case, I think it's safer to assume that, maybe one day, the UBI
> thread might be running when ubi_wl_init() is called, which is why I
> suggested to also apply this patch to Linux.
Ok, thanks for this explanation! I posted this patch also on linux-mtd, see:
https://patchwork.ozlabs.org/patch/613492/
>>>>> In the long run I suggest removing the whole Linux UBI implementation
>>>>> from u-boot and add a small (read only!) implementation which can
>>>>> also read UBIFS. Reading UBIFS is not a big deal. Also journal reply
>>>>> can be done in-memory.
>>>>
>>>> Hmm.. I think read only is not for all boards an option, as we also
>>>> create UBI Volumes and/or write to them in U-Boot ...
>>>
>>> Depends.
>>> IMHO a bootloader has exactly one job, loading a kernel
>>> and booting it. And not being a poor man's general purpose operating
>>> system where you can also do management stuff like managing UBI volumes. ;-)
>>
>> Heh...
>
> That's another topic ;).
Oh, yes...
bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2016-04-25 5:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 10:54 [U-Boot] [PATCH] mtd, ubi: set free_count to zero before walking through erase list Heiko Schocher
2016-02-02 11:40 ` Richard Weinberger
2016-02-02 12:53 ` Heiko Schocher
2016-04-21 8:58 ` Boris Brezillon
2016-04-21 10:09 ` Heiko Schocher
2016-04-21 10:25 ` Boris Brezillon
2016-04-21 10:48 ` Heiko Schocher
2016-04-21 12:14 ` Boris Brezillon
2016-04-22 9:34 ` Richard Weinberger
2016-04-22 10:20 ` Heiko Schocher
2016-04-22 10:48 ` Richard Weinberger
2016-04-22 11:53 ` Heiko Schocher
2016-04-22 12:21 ` Boris Brezillon
2016-04-25 5:46 ` Heiko Schocher [this message]
2016-04-25 7:06 ` Richard Weinberger
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=571DAF3D.3000002@denx.de \
--to=hs@denx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox