<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mtd/ubi/wl.c, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-10-22T21:43:24Z</updated>
<entry>
<title>UBI: return ENOSPC if no enough space available</title>
<updated>2015-10-22T21:43:24Z</updated>
<author>
<name>shengyong</name>
</author>
<published>2015-09-28T17:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef110859613fdbe6e866b09c3b2fd9081faa25dd'/>
<id>urn:sha1:ef110859613fdbe6e866b09c3b2fd9081faa25dd</id>
<content type='text'>
commit 7c7feb2ebfc9c0552c51f0c050db1d1a004faac5 upstream.

UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI error: init_volumes: not enough PEBs, required 706, available 686
UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1)
UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 &lt;= NOT ENOMEM
UBI error: ubi_init: cannot attach mtd1

If available PEBs are not enough when initializing volumes, return -ENOSPC
directly. If available PEBs are not enough when initializing WL, return
-ENOSPC instead of -ENOMEM.

Signed-off-by: Sheng Yong &lt;shengyong1@huawei.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: David Gstir &lt;david@sigma-star.at&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>UBI: Fastmap: Remove is_fm_block()</title>
<updated>2015-03-26T21:47:38Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-11-07T12:35:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56794c0a1ae738cb4184ab27501e4d152b0b2771'/>
<id>urn:sha1:56794c0a1ae738cb4184ab27501e4d152b0b2771</id>
<content type='text'>
This function was added to fastmap in a very early stage
to have paranoid assertions.
With the current fastmap implementation this assert will never
trigger as fastmap PEBs are not seen by the WL sub-system.
Remove it to save us some CPU cycles.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Fastmap: Introduce may_reserve_for_fm()</title>
<updated>2015-03-26T21:47:36Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-10-29T09:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2f84c2469e2f2e94a45d86597baec10bfbf06847'/>
<id>urn:sha1:2f84c2469e2f2e94a45d86597baec10bfbf06847</id>
<content type='text'>
...and kill another #ifdef.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Fastmap: Introduce ubi_fastmap_init()</title>
<updated>2015-03-26T21:47:36Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-10-28T16:07:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=acfda79f8808518b0235eb9a13c8b5f762e43a75'/>
<id>urn:sha1:acfda79f8808518b0235eb9a13c8b5f762e43a75</id>
<content type='text'>
...and kill another #ifdef in wl.c. :-)

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Move fastmap specific functions out of wl.c</title>
<updated>2015-03-26T21:47:28Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-11-10T17:21:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78d6d497a648cc04ae26b27af1e01ce3e41a9c72'/>
<id>urn:sha1:78d6d497a648cc04ae26b27af1e01ce3e41a9c72</id>
<content type='text'>
Fastmap is tightly connected to the WL sub-system, many fastmap-specific
functionslive in wl.c.
To get rid of most #ifdefs in wl.c move this functions into a new file
and include it into wl.c

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Fix stale pointers in ubi-&gt;lookuptbl</title>
<updated>2015-03-26T21:46:04Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-11-10T15:16:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee59ba8b064f692a1dee99b6f3ba30b0e904b2c1'/>
<id>urn:sha1:ee59ba8b064f692a1dee99b6f3ba30b0e904b2c1</id>
<content type='text'>
In some error paths the WL sub-system gives up on a PEB
and frees it's ubi_wl_entry struct but does not set
the entry in ubi-&gt;lookuptbl to NULL.
Fastmap can stumble over such a stale pointer as it uses
ubi-&gt;lookuptbl to find all PEBs.

Fix this by introducing a new helper function which free()s
a WL entry and removes the reference from the lookup table.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Fastmap: Locking updates</title>
<updated>2015-03-26T21:46:02Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-11-10T15:28:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=111ab0b26fc1bfad575d1e376e146d194d261e22'/>
<id>urn:sha1:111ab0b26fc1bfad575d1e376e146d194d261e22</id>
<content type='text'>
a) Rename ubi-&gt;fm_sem to ubi-&gt;fm_eba_sem as this semaphore
protects EBA changes.
b) Turn ubi-&gt;fm_mutex into a rw semaphore. It will still serialize
fastmap writes but also ensures that ubi_wl_put_peb() is not
interrupted by a fastmap write. We use a rw semaphore to allow
ubi_wl_put_peb() still to be executed in parallel if no fastmap
write is happening.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Fastmap: Fix race after ubi_wl_get_peb()</title>
<updated>2015-03-26T21:46:01Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-11-10T15:27:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8fb2a514780eee48602424a86e3cd72d3f1bdfb2'/>
<id>urn:sha1:8fb2a514780eee48602424a86e3cd72d3f1bdfb2</id>
<content type='text'>
ubi_wl_get_peb() returns a fresh PEB which can be used by
user of UBI. Due to the pool logic fastmap will correctly
map this PEB upon attach time because it will be scanned.

If a new fastmap is written (due to heavy parallel io)
while the before the fresh PEB is assigned to the EBA table
it will not be scanned as it is no longer in the pool.
So, the race window exists between ubi_wl_get_peb()
and the EBA table assignment.
We have to make sure that no new fastmap can be written
while that.

To ensure that ubi_wl_get_peb() will grab ubi-&gt;fm_sem in read mode
and the user of ubi_wl_get_peb() has to release it after the PEB
got assigned.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Fastmap: Notify user in case of an ubi_update_fastmap() failure</title>
<updated>2015-03-26T21:45:55Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-10-06T12:57:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=943b33564e78130014ca91b575181becc828179e'/>
<id>urn:sha1:943b33564e78130014ca91b575181becc828179e</id>
<content type='text'>
If ubi_update_fastmap() fails notify the user.
This is not a hard error as ubi_update_fastmap() makes sure that upon failure
the current on-flash fastmap will no be used upon next UBI attach.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Fastmap: Fix memory leaks while closing the WL sub-system</title>
<updated>2015-03-26T21:45:48Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-10-06T12:42:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74cdaf24004aea8de350f58979548b3eddc11e9a'/>
<id>urn:sha1:74cdaf24004aea8de350f58979548b3eddc11e9a</id>
<content type='text'>
Add a ubi_fastmap_close() to free all resources used by fastmap
at WL shutdown.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Tested-by: Guido Martínez &lt;guido@vanguardiasur.com.ar&gt;
Reviewed-by: Guido Martínez &lt;guido@vanguardiasur.com.ar&gt;
</content>
</entry>
</feed>
