<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mtd/ubi/io.c, branch linux-2.6.37.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-12-03T13:49:21Z</updated>
<entry>
<title>UBI: fix corrupted PEB detection for NOR flash</title>
<updated>2010-12-03T13:49:21Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-12-02T04:34:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ac760c2f78ddd8e1bd633767b01becfbbf96720'/>
<id>urn:sha1:7ac760c2f78ddd8e1bd633767b01becfbbf96720</id>
<content type='text'>
My new shiny code for corrupted PEB detection has NOR specific bug.
We tread PEB as corrupted and preserve it, if

1. EC header is OK.
2. VID header is corrupted.
3. data area is not "all 0xFFs"

In case of NOR we have 'nor_erase_prepare()' quirk, which invalidates
the headers before erasing the PEB. And we invalidate first the VID
header, and then the EC header. So if a power cut happens after we have
invalidated the VID header, but before we have invalidated the EC
header, we end up with a PEB which satisfies the above 3 conditions,
and the scanning code will treat it as corrupted, and will print
scary warnings, wrongly.

This patch fixes the issue by firt invalidating the EC header, then
invalidating the VID header. In case of power cut inbetween, we still
just lose the EC header, and UBI can deal with this situation gracefully.

Thanks to Anatolij Gustschin &lt;agust@denx.de&gt; for tracking this down.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Reported-by: Anatolij Gustschin &lt;agust@denx.de&gt;
Tested-by: Anatolij Gustschin &lt;agust@denx.de&gt;
</content>
</entry>
<entry>
<title>UBI: make check_pattern function non-static</title>
<updated>2010-10-19T14:19:57Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-07-31T06:37:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bb00e180a93a6c8e89c3b2d1f9473781e1e2d2a4'/>
<id>urn:sha1:bb00e180a93a6c8e89c3b2d1f9473781e1e2d2a4</id>
<content type='text'>
This patch turns static function 'check_pattern()' into a non-static
'ubi_check_pattern()'. This is just a preparation for the chages which
are coming in the next patches.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: handle bit-flips when no header found</title>
<updated>2010-10-19T14:19:56Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-09-03T11:22:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=92e1a7d9e7e07fb1cf0cbbcdf202938d0819b54d'/>
<id>urn:sha1:92e1a7d9e7e07fb1cf0cbbcdf202938d0819b54d</id>
<content type='text'>
Currently UBI has one small flaw - when we read EC or VID header, but find only
0xFF bytes, we return UBI_IO_FF and do not report whether we had bit-flips or
not. In case of the VID header, the scanning code adds this PEB to the free list,
even though there were bit-flips.

Imagine the following situation: we start writing VID header to a PEB and have a
power cut, so the PEB becomes unstable. When we scan and read the PEB, we get
a bit-flip. Currently, UBI would just ignore this and treat the PEB as free. This
patch changes UBI behavior and now UBI will schedule this PEB for erasure.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: remove duplicate IO error codes</title>
<updated>2010-10-19T14:19:56Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-09-02T23:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74d82d2660058e32644f0c673656b2a1d01d3688'/>
<id>urn:sha1:74d82d2660058e32644f0c673656b2a1d01d3688</id>
<content type='text'>
The 'UBI_IO_PEB_EMPTY' and 'UBI_IO_PEB_FREE' are essentially the same
and mean that there are only 0xFF bytes instead of headers. Simplify
UBI a little by turning them into a single 'UBI_IO_FF' error code.

Also, stop maintaining commentaries in 'ubi_io_read_vid_hdr()' which are
almost identical to commentaries in 'ubi_io_read_ec_hdr()'.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: rename IO error code</title>
<updated>2010-10-19T14:19:56Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-09-02T22:30:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=756e1df1d2b8b572a92dd1b82d2a432d5b280b1c'/>
<id>urn:sha1:756e1df1d2b8b572a92dd1b82d2a432d5b280b1c</id>
<content type='text'>
Rename UBI_IO_BAD_HDR_READ into UBI_IO_BAD_HDR_EBADMSG which is presumably more
self-documenting and readable. Indeed, the '_READ' suffix does not tell much and
even confuses, while '_EBADMSG' tells about uncorrectable ECC error, because we
use -EBADMSG all over the place to represent ECC errors.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: fix error message and compilation warnings</title>
<updated>2010-06-14T05:47:49Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-06-14T05:15:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5d5b1f8c12a7637ee1145f2f00358eb375edb54'/>
<id>urn:sha1:f5d5b1f8c12a7637ee1145f2f00358eb375edb54</id>
<content type='text'>
Fix the followong compilation warnings introduced by commit
095751a6e0838a712393a74eb0b7b6559dbdbe81:

drivers/mtd/ubi/scan.c: In function 'check_what_we_have':
drivers/mtd/ubi/scan.c:960: warning: passing argument 1 of 'get_random_bytes' discards qualifiers from pointer target type

Fix the following compilation warnings introduced by commit
1a49af2ca019dcb4614c32f832bbcb814b61409c:

drivers/mtd/ubi/io.c: In function 'ubi_io_read':
drivers/mtd/ubi/io.c:153: warning: initialization makes integer from pointer without a cast
drivers/mtd/ubi/io.c:170: warning: format '%s' expects type 'char *', but argument 5 has type 'int'
drivers/mtd/ubi/io.c:177: warning: format '%zd' expects type 'signed size_t', but argument 7 has type 'int'
drivers/mtd/ubi/io.c:177: warning: too many arguments for format

Also, amend the ECC error code string and add brackets and whitespace
there - this should make the message readable.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: improve ECC error message</title>
<updated>2010-06-11T14:23:37Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-06-08T07:59:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a49af2ca019dcb4614c32f832bbcb814b61409c'/>
<id>urn:sha1:1a49af2ca019dcb4614c32f832bbcb814b61409c</id>
<content type='text'>
ECC errors are quite typical errors on NAND, so it is worth improving
the UBI message and print something like

ubi_io_read: error -74 (ECC error) while reading 4096 bytes from PEB 1:4 ...

rather than

ubi_io_read: error -74 while reading 4096 bytes from PEB 1:4 ...

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>UBI: introduce a new IO return code</title>
<updated>2010-06-04T08:30:42Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-05-03T06:04:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb89580e1a8388d206bf143c6c39d001095106ba'/>
<id>urn:sha1:eb89580e1a8388d206bf143c6c39d001095106ba</id>
<content type='text'>
This patch introduces the %UBI_IO_BAD_HDR_READ return code for
the I/O level function. We will use this code in order to distinguish
between "corrupted header possibly because this is non-ubi data" and
"corrupted header possibly because of real data corruption and ECC error".

So far this patch does not introduce any functional change, just a
preparation.

This patch is pased on a patch from
Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
Tested-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
</content>
</entry>
<entry>
<title>UBI: simplify IO error codes</title>
<updated>2010-06-04T08:30:42Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2010-04-30T13:50:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=786d78318586cbdc8aec539fe5a4942490267fef'/>
<id>urn:sha1:786d78318586cbdc8aec539fe5a4942490267fef</id>
<content type='text'>
We do not really need 2 separate error codes for indicating bad VID
and bad EC headers (UBI_IO_BAD_EC_HDR, UBI_IO_BAD_VID_HDR), it is
enough to have only one UBI_IO_BAD_HDR return code.

This patch does not introduce any functional change, only some
code simplification.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
Tested-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
</content>
</entry>
<entry>
<title>UBI: misc comment fixes</title>
<updated>2010-05-07T05:33:32Z</updated>
<author>
<name>Shinya Kuribayashi</name>
</author>
<published>2010-05-06T10:22:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be436f6238a17b8432b9de0212bcfc838afb1f85'/>
<id>urn:sha1:be436f6238a17b8432b9de0212bcfc838afb1f85</id>
<content type='text'>
Signed-off-by: Shinya Kuribayashi &lt;shinya.kuribayashi.px@renesas.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
</feed>
