<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/mtd, branch v2019.01-rc2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/mtd?h=v2019.01-rc2</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/mtd?h=v2019.01-rc2'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2018-12-05T20:06:24Z</updated>
<entry>
<title>Merge branch 'master' of git://git.denx.de/u-boot-spi</title>
<updated>2018-12-05T20:06:24Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2018-12-05T20:06:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9450ab2ba8d720bd9f73bccc0af2e2b5a2c2aaf1'/>
<id>urn:sha1:9450ab2ba8d720bd9f73bccc0af2e2b5a2c2aaf1</id>
<content type='text'>
- Various MTD fixes from Boris
- Zap various unused / legacy paths.
- pxa3xx NAND update from Miquel

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>mtd: sf: Make sf_mtd.c more robust</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:32Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=08898e8b22d74a4511eadee9b06b11aab43e809c'/>
<id>urn:sha1:08898e8b22d74a4511eadee9b06b11aab43e809c</id>
<content type='text'>
SPI flash based MTD devs can be registered/unregistered at any time
through the sf probe command or the spi_flash_free() function.

This commit does not try to fix the root cause as it would probably
require rewriting most of the code and have an mtd_info object
instance per spi_flash object (not to mention that the the spi-flash
layer is likely to be replaced by a spi-nor layer ported from Linux).

Instead, we try to be as safe as can be by checking the code returned
by del_mtd_device() and complain loudly when there's nothing we can
do about the deregistration failure. When that happens we also reset
sf_mtd_info.priv to NULL, and check for NULL pointer in the mtd hooks
so that -ENODEV is returned instead of hitting a NULL pointer
dereference exception when the MTD instance is later accessed by a user.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
</entry>
<entry>
<title>mtd: sf: Unregister the MTD device prior to removing the spi_flash obj</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7371944a71690abafd0717b5d5f72c67e9f0f414'/>
<id>urn:sha1:7371944a71690abafd0717b5d5f72c67e9f0f414</id>
<content type='text'>
The DM implementation of spi_flash_free() does not unregister the MTD
device before removing the spi dev object. This leads to a use-after-free
bug when the MTD device is later accessed by a MTD user (observed when
attaching the device to UBI after env_sf_load() has called
spi_flash_free()).

Implement -&gt;remove() and call spi_flash_mtd_unregister() from there.

Fixes: 9fe6d8716e09 ("mtd, spi: Add MTD layer driver")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Reviewed-by: Jagan Teki &lt;jagan@openedev.com&gt;
</content>
</entry>
<entry>
<title>mtd: Don't stop MTD partition creation when it fails on one device</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4a5594fa20d0fa6479f477d2bd67967aca201c2f'/>
<id>urn:sha1:4a5594fa20d0fa6479f477d2bd67967aca201c2f</id>
<content type='text'>
MTD partition creation code is a bit tricky. It tries to figure out
when things have changed (either MTD dev list or mtdparts/mtdids vars)
and when that happens it first deletes all the partitions that had been
previously created and then creates the new ones based on the new
mtdparts/mtdids values.
But before deleting the old partitions, it ensures that none of the
currently registered parts are being used and bails out when that's
not the case. So, we end up in a situation where, if at least one MTD
dev has one of its partitions used by someone (UBI for instance), the
partitions update logic no longer works for other devs.

Rework the code to relax the logic and allow updates of MTD parts on
devices that are not being used (we still refuse to updates parts on
devices who have at least one of their partitions used by someone).

Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
</entry>
<entry>
<title>mtd: Make sure we don't parse MTD partitions belonging to another dev</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:29Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2428d9160b80375870c1fff6cbb0214639628282'/>
<id>urn:sha1:2428d9160b80375870c1fff6cbb0214639628282</id>
<content type='text'>
The mtdparts variable might contain partition definitions for several
MTD devices. Each partition layout is separated by a ';', so let's
make sure we don't pick a wrong name when mtdparts is malformed.

Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
</entry>
<entry>
<title>mtd: Make sure the name passed in mtdparts fits in mtd_name[]</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=772aa9799353d1d6bd6d9e2682945d4d7122539a'/>
<id>urn:sha1:772aa9799353d1d6bd6d9e2682945d4d7122539a</id>
<content type='text'>
The local mtd_name[] variable is limited in size. Return an error if
the name passed in mtdparts does not fit in this local var.

Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
</entry>
<entry>
<title>mtd: Be more strict on the "mtdparts=" prefix check</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=429e048e4190b68b078c37c0012c59804e32818b'/>
<id>urn:sha1:429e048e4190b68b078c37c0012c59804e32818b</id>
<content type='text'>
strstr() does not guarantee that the string we're searching for is
placed at the beginning. Use strncmp() instead.

Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
</entry>
<entry>
<title>mtd: Use get_mtdids() instead of env_get("mtdids") in mtd_search_alternate_name()</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=96b06434e56ce5dca391e8417d293132ff7164e0'/>
<id>urn:sha1:96b06434e56ce5dca391e8417d293132ff7164e0</id>
<content type='text'>
The environment is not guaranteed to contain a valid mtdids variable
when called from mtd_search_alternate_name(). Call get_mtdids() instead
of env_get("mtdids").

Fixes: ff4afa8a981e ("mtd: uboot: search for an equivalent MTD name with the mtdids")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
</entry>
<entry>
<title>mtd: sf: Make sure we don't register the same device twice</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=492151b2093ee4df173f7e10da4938ef7c2a2156'/>
<id>urn:sha1:492151b2093ee4df173f7e10da4938ef7c2a2156</id>
<content type='text'>
spi_flash_mtd_register() can be called several times and each time it
will register the same mtd_info instance like if it was a new one.
The MTD ID allocation gets crazy when that happens, so let's track the
status of the sf_mtd_info object to avoid that.

Fixes: 9fe6d8716e09 ("mtd, spi: Add MTD layer driver")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Reviewed-by: Jagan Teki &lt;jagan@openedev.com&gt;
</content>
</entry>
<entry>
<title>mtd: Delete partitions attached to the device when a device is deleted</title>
<updated>2018-12-05T19:15:36Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-12-02T09:54:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a02820fca90ce9ccf243b3fce59c04dabd5671a8'/>
<id>urn:sha1:a02820fca90ce9ccf243b3fce59c04dabd5671a8</id>
<content type='text'>
If we don't do that, partitions might still be exposed while the
underlying device is gone.

Fixes: 2a74930da57f ("mtd: mtdpart: implement proper partition handling")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
</entry>
</feed>
