2019-01-07 |
backend_bucket_circular: remove unused variables
...
This ports the following barebox commit:
| commit 0d0a472
| Author: Ulrich Ölmann <u.oelmann@pengutronix.de>
| Date: Wed Oct 10 14:23:40 2018 +0200
|
| state: backend_bucket_circular: remove unused variables
|
| This has been forgotten in commit 9d6d91931afb ("state: Remove -EUCLEAN
| check
| from userspace tool").
|
| Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: backend_bucket_circular: fix memory leak
...
This ports the following barebox commit:
| commit 87a0df3
| Author: Ulrich Ölmann <u.oelmann@pengutronix.de>
| Date: Mon Oct 8 19:45:23 2018 +0200
|
| state: backend_bucket_circular: fix memory leak
|
| Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: backend_bucket_circular: fix for non power of 2 writesize
...
This includes sys/param.h to have the definition of roundup() and ports the
following barebox commit:
| commit f701414
| Author: Ladislav Michl <ladis@linux-mips.org>
| Date: Tue Sep 25 12:58:45 2018 +0200
|
| state: backend_bucket_circular: fix for non power of 2 writesize
|
| backend_bucket_circular currently assumes writesize is power of 2,
| which makes it fail on dataflash devices, where this assumption
| is false.
|
| Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: Add property to protect existing data
...
This ports the following barebox commit:
| commit 67c1c08
| Author: Daniel Schultz <d.schultz@phytec.de>
| Date: Thu Apr 12 11:13:01 2018 +0200
|
| common: state: Add property to protect existing data
|
| After an update to a newer barebox version with an enabled state
| framework, existing data in storage memories could be overwritten.
|
| Add a new property to check in front of every write task, if the meta
| magic field only contains the magic number, zeros or ones.
|
| Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: remove checks for xzalloc() returning NULL
...
This ports the following barebox commit:
| commit 25e67cb
| Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
| Date: Mon Sep 25 12:02:35 2017 +0200
|
| remove checks for xzalloc() returning NULL
|
| xzalloc() either returns memory or panics, so checking for NULL is useless.
|
| Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: backend_bucket_circular: promote old state debug message to info
...
This ports the following barebox commit:
| commit 0f5ecaf
| Author: Philipp Zabel <p.zabel@pengutronix.de>
| Date: Tue Jul 18 15:15:23 2017 +0200
|
| state: backend_bucket_circular: promote old state debug message to info
|
| A report about the changed on-storage state format might be interesting
| to the user.
|
| Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: backend_bucket_circular: fix old state reads
...
This ports the following barebox commit:
| commit a0c2642
| Author: Philipp Zabel <p.zabel@pengutronix.de>
| Date: Tue Jul 18 15:14:45 2017 +0200
|
| state: backend_bucket_circular: fix old state reads
|
| When the circular bucket meta magic was not found, it is assumed that
| the whole written state is in the old on-storage format. In that case,
| the size of the circular bucket meta must not be subtracted from the
| read length, or the (complete_len > len) check in the raw backend's
| verify function will fail:
|
| state: Error, invalid data_len 16 in header, have data of len 24
|
| Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: backend_bucket_circular: drop unused free_pattern constant
...
This ports the following barebox commit:
| commit b876c2b
| Author: Antony Pavlov <antonynpavlov@gmail.com>
| Date: Wed May 3 14:41:18 2017 +0300
|
| state: backend_bucket_circular: drop unused free_pattern constant
|
| Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
state: backend_bucket_circular: Do not leak memory
...
This ports the following barebox commit:
| commit af18710
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date: Wed Apr 19 10:13:58 2017 +0200
|
| state: backend_bucket_circular: Do not leak memory
|
| buf was just allocated, free it before returning an error.
|
| Reported-by: Sam Ravnborg <sam@ravnborg.org>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Ulrich Ölmann
authored
on 18 Dec 2018
Roland Hieber
committed
on 7 Jan 2019
|
2018-11-09 |
Fix compiler warnings about wrong type conversion in messages.
...
These warning were observed with gcc-6.3 on x86-64.
Signed-off-by: Philipp Rosenberger <p.rosenberger@linutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Philipp Rosenberger
authored
on 18 Oct 2018
Sascha Hauer
committed
on 9 Nov 2018
|
2017-03-31 |
state: Remove -EUCLEAN check from userspace tool
...
The state code is used for the userspace tool aswell, kept in sync
manually. This patch only introduces a change for the userspace
tool, not for barebox.
In Linux userspace there is no direct possibility to check for -EUCLEAN.
To indirectly check for -EUCLEAN the state tool reads the number of
corrected bits before and after reading a block. Unfortunately it does
not take the number of acceptable bitflips into account, but instead
returns -EUCLEAN even when only a single bitflip occurred on a whole
page. To be correct the algorithm must be more complicated: We would
have to read the bitflip_threshold from sysfs. This value is per ECC
step (often 512 byte), not per page. We would have to read the page
in ECC step size chunks, testing for bitflips lower than the threshold
for each chunk. Even if we would do that, there's still another issue.
The eccstats ioctl delivers the eccstats for the whole device, so a
concurrent reader would falsify the result.
Let's decide that this is not worth the hassle and assume that no
device has enough uptime that a cleanup in barebox is not sufficient.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend bucket circular: Explain metadata
...
Explain why we have metadata and where it is used.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_circular: Set minumum writesize to 8
...
NOR flashes have a write size of 1. With this the metadata may
end up on non-4-byte-aligned offsets. Force the minimum writesize
to 8 so that the metadata is always at aligned offsets.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend: Add some documentation
...
Write some sentences to make the concepts clearer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: Convert all bufs to void *
...
A void * is a much better type for a buffer than a u8 * as it
can be casted to any other type implicitly. Convert all buffers
used by the state framework to void *.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: replace len_hint logic
...
The len_hint mechanism is rather hard to understand as it's not clear
from where to where the hint is passed and also it's not clear what
happens if the hint is empty or wrong.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: drop lazy_init
...
lazy_init is an optimization that makes it possible to read only up to
the first valid bucket when starting. However, when restoring consistency,
immediately afterwards we have we have to initialize all buckets anyway,
so being lazy doesn't give us any gain. Remove it to simplify the code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_circular: Read whole PEB
...
When the circular backend searches for the last page written in the
eraseblock, it iterates backwards pagewise from the end of the block.
This is ok for NAND flash, but on NOR flash, which does not have pages,
the code ends up iterating bytewise backwards, calling into mtd each
time. This is very time consuming, so optimize this by reading the whole
eraseblock once and just iterate over the buffer in memory.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
2017-03-21 |
state: use packed attribute for on storage structs
...
These structs are used for on-storage data layouts. They should be not
affected by different integer precisions and alignment optimizations of
32bit or 64bit machines. Using the architecture independent integer data
types, like uint32_t, achieves the former, using the packed attribute
the later.
Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 21 Mar 2017
|
state: bucket_circular: -EUCLEAN means data could be read
...
-EUCLEAN returned from state_mtd_peb_read() means that the
data shall still be used. This fixes initialization of buckets
which need cleanup.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 21 Mar 2017
|
2017-01-16 |
barebox-state: Fix comment
...
Writes are always beginning at a page and pages can't be erased.
It's 'eraseblock' that is meant here.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 16 Jan 2017
|
2016-07-05 |
Update barebox-state
...
Fixed direct bucket
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Markus Pargmann
committed
on 5 Jul 2016
|
2016-06-02 |
barebox-state: Check ECC stats for circular buckets
...
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Markus Pargmann
committed
on 2 Jun 2016
|
2016-05-27 |
barebox-state: Import updated state code
...
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Markus Pargmann
committed
on 27 May 2016
|