<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/mtd/mtdcore.c, branch v2020.04</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/mtd/mtdcore.c?h=v2020.04</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/mtd/mtdcore.c?h=v2020.04'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2020-02-06T02:33:46Z</updated>
<entry>
<title>dm: core: Require users of devres to include the header</title>
<updated>2020-02-06T02:33:46Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-02-03T14:36:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=61b29b82683863a970fd4609a7c58512872616bc'/>
<id>urn:sha1:61b29b82683863a970fd4609a7c58512872616bc</id>
<content type='text'>
At present devres.h is included in all files that include dm.h but few
make use of it. Also this pulls in linux/compat which adds several more
headers. Drop the automatic inclusion and require files to include devres
themselves. This provides a good indication of which files use devres.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Anatolij Gustschin &lt;agust@denx.de&gt;
</content>
</entry>
<entry>
<title>mtd: Rename free() to rfree()</title>
<updated>2020-02-06T02:33:46Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-02-03T14:35:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8d38a8459b0de45f5ff41f3e11c278a5cf395fd0'/>
<id>urn:sha1:8d38a8459b0de45f5ff41f3e11c278a5cf395fd0</id>
<content type='text'>
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>mtd: mtdcore: Drop unused mtd_table</title>
<updated>2019-12-03T13:43:24Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2019-11-27T01:41:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=56e5a393464161f973dfe43745571a532b8c77d0'/>
<id>urn:sha1:56e5a393464161f973dfe43745571a532b8c77d0</id>
<content type='text'>
The array 'mtd_table' is unused in the code.  Remove this as gcc doesn't
always discard unused global variables.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>mtd: fix Coverity integer handling issue</title>
<updated>2019-04-12T05:29:17Z</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2018-11-18T20:11:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3f3aef4b9dc88278f31567fe6f26095fd9477b1a'/>
<id>urn:sha1:3f3aef4b9dc88278f31567fe6f26095fd9477b1a</id>
<content type='text'>
A Coverity robot reported an integer handling issue
(OVERFLOW_BEFORE_WIDEN) in the potentially overflowing expression:

    (mtd_div_by_ws(mtd-&gt;size, mtd) - mtd_div_by_ws(offs, mtd)) *
    mtd_oobavail(mtd, ops)

While such overflow will certainly never happen due to the numbers
handled, it is cleaner to fix this operation anyway.

The problem is that all the maths include 32-bit quantities, while the
result is stored in an explicit 64-bit value.

As maxooblen will just be compared with a size_t, let's change the
type of the variable to a size_t. This will not fix anything but will
clarify a bit the situation. Then, do an explicit cast to fix Coverity
warning.

Addresses-Coverity-ID: 184180 ("Integer handling issues")
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.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>
<entry>
<title>mtd: Add a function to report when the MTD dev list has been updated</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:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4c47fd0b6bce62162e11b8a22e2eaf0d8f6673b1'/>
<id>urn:sha1:4c47fd0b6bce62162e11b8a22e2eaf0d8f6673b1</id>
<content type='text'>
We need to parse mtdparts/mtids again everytime a device has been
added/removed from the MTD list, but there's currently no way to know
when such an update has been done.

Add an -&gt;updated field to the idr struct that we set to true every time
a device is added/removed and expose a function returning the value
of this field and resetting it to false.

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: mtdpart: implement proper partition handling</title>
<updated>2018-10-02T16:42:32Z</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2018-09-29T10:58:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2a74930da57f6fbe3c24509f1d481f435acd2356'/>
<id>urn:sha1:2a74930da57f6fbe3c24509f1d481f435acd2356</id>
<content type='text'>
Instead of collecting partitions in a flat list, create a hierarchy
within the mtd_info structure: use a partitions list to keep track of
the partitions of an MTD device (which might be itself a partition of
another MTD device), a pointer to the parent device (NULL when the MTD
device is the root one, not a partition).

By also saving directly in mtd_info the offset of the partition, we
can get rid of the mtd_part structure.

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: Fallback to -&gt;_read/write() when -&gt;_read/write_oob() is missing</title>
<updated>2018-09-20T14:40:49Z</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2018-08-16T15:30:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ca040d8512f4d93a7eb83f7b8fec8f4b8b1d3192'/>
<id>urn:sha1:ca040d8512f4d93a7eb83f7b8fec8f4b8b1d3192</id>
<content type='text'>
Some MTD sublayers/drivers are implementing -&gt;_read/write() and
not -&gt;_read/write_oob().

While for NAND devices both are usually valid, for NOR devices, using
the _oob variant has no real meaning. But, as the MTD layer is supposed
to hide as much as possible the flash complexity to the user, there is
no reason to error out while it is just a matter of rewritting things
internally.

Add a fallback on mtd-&gt;_read() (resp. mtd-&gt;_write()) when the user calls
mtd_read_oob() (resp. mtd_write_oob()) while mtd-&gt;_read_oob() (resp.
mtd-&gt;_write_oob) is not implemented. There is already a fallback on the
_oob variant if the former is used.

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: Add sanity checks in mtd_write/read_oob()</title>
<updated>2018-09-20T14:40:49Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2018-08-16T15:30:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8fad769f1eab88a2bcf0b714694158968f58715a'/>
<id>urn:sha1:8fad769f1eab88a2bcf0b714694158968f58715a</id>
<content type='text'>
Unlike what's done in mtd_read/write(), there are no checks to make sure
the parameters passed to mtd_read/write_oob() are consistent, which
forces implementers of -&gt;_read/write_oob() to do it, which in turn leads
to code duplication and possibly errors in the logic.

Do general sanity checks, like ops fields consistency and range checking.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Cc: Peter Pan &lt;peterpandong@micron.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
[Miquel: squashed the fix about the chip's size check]
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mtd: Uninline mtd_write_oob and move it to mtdcore.c</title>
<updated>2018-09-20T14:40:49Z</updated>
<author>
<name>Ezequiel Garcia</name>
<email>ezequiel@vanguardiasur.com.ar</email>
</author>
<published>2018-08-16T15:30:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5f50d82d8918b711717b4bbd96c6f348eb6e2a2c'/>
<id>urn:sha1:5f50d82d8918b711717b4bbd96c6f348eb6e2a2c</id>
<content type='text'>
There's no reason for having mtd_write_oob inlined in mtd.h header.
Move it to mtdcore.c where it belongs.

Signed-off-by: Ezequiel Garcia &lt;ezequiel@vanguardiasur.com.ar&gt;
Acked-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Jacek Anaszewski &lt;j.anaszewski@samsung.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
</feed>
