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: Fri, 22 Apr 2016 13:53:00 +0200 [thread overview]
Message-ID: <571A109C.6090206@denx.de> (raw)
In-Reply-To: <571A0175.2070807@nod.at>
Hello Richard,
Am 22.04.2016 um 12:48 schrieb Richard Weinberger:
> Heiko,
>
> Am 22.04.2016 um 12:20 schrieb Heiko Schocher:
>>> Think of places where work is scheduled but the caller blocked
>>> the worker because the work has to be done later.
>>> Fastmap is one of these use cases but AFAIK it won't matter
>>> as no CPU scheduler is involved and will interrupt Fastmap.
>>
>> Can you explain this a little bit?
>
> As I said, when you are in a code region where parallel
> work must not happen as it will, for example, confuse your state
> you block the worker.
> But you are still allowed to schedule new work which will
> executed after you unblock it.
> For the fastmap example I gave it should be fine but I didn't check
> all code paths in UBI for u-boot single thread safety. :-)
>
> What I wanted to say is that executing work directly at schedule
> time does not match 1:1 the POV of Linux UBI and is error prone.
> These are issues you won't notice by compile testing.
Ok, thanks for the explanation!
> 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!
>>> 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...
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-22 11:53 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 [this message]
2016-04-22 12:21 ` Boris Brezillon
2016-04-25 5:46 ` Heiko Schocher
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=571A109C.6090206@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