<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/mtd/mtdcore.c, branch v5.14</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>mtd: core: handle flashes without OTP gracefully</title>
<updated>2021-07-15T22:49:20+00:00</updated>
<author>
<name>Michael Walle</name>
<email>michael@walle.cc</email>
</author>
<published>2021-07-07T13:53:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=45bb1faa29effbd4ca4d581b32373f2eda309b95'/>
<id>45bb1faa29effbd4ca4d581b32373f2eda309b95</id>
<content type='text'>
There are flash drivers which registers the OTP callbacks although the
flash doesn't support OTP regions and return -ENODATA for these
callbacks if there is no OTP. If this happens, the probe of the whole
flash will fail. Fix it by handling the ENODATA return code and skip
the OTP region nvmem setup.

Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210707135359.32398-1-michael@walle.cc
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are flash drivers which registers the OTP callbacks although the
flash doesn't support OTP regions and return -ENODATA for these
callbacks if there is no OTP. If this happens, the probe of the whole
flash will fail. Fix it by handling the ENODATA return code and skip
the OTP region nvmem setup.

Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210707135359.32398-1-michael@walle.cc
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: core: use MTD_DEVICE_ATTR_RO/RW() helper macros</title>
<updated>2021-06-11T18:42:57+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2021-06-03T12:53:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a17da115ac042fd560cba2f8e4057722cf0c42cd'/>
<id>a17da115ac042fd560cba2f8e4057722cf0c42cd</id>
<content type='text'>
Use MTD_DEVICE_ATTR_RO/RW() helper macros instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210603125323.12142-3-thunder.leizhen@huawei.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use MTD_DEVICE_ATTR_RO/RW() helper macros instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210603125323.12142-3-thunder.leizhen@huawei.com
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: core: add MTD_DEVICE_ATTR_RO/RW() helper macros</title>
<updated>2021-06-11T18:42:50+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2021-06-03T12:53:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b4e248632c968d985f0ecfd7924423fbefc39d1c'/>
<id>b4e248632c968d985f0ecfd7924423fbefc39d1c</id>
<content type='text'>
Compared with the definition of DEVICE_ATTR_RO/RW(), the read and write
function names of the sysfs attribute have an additional "mtd_" prefix.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210603125323.12142-2-thunder.leizhen@huawei.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compared with the definition of DEVICE_ATTR_RO/RW(), the read and write
function names of the sysfs attribute have an additional "mtd_" prefix.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210603125323.12142-2-thunder.leizhen@huawei.com
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: core: Potential NULL dereference in mtd_otp_size()</title>
<updated>2021-05-26T08:41:43+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-05-14T14:27:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c3c8c051df3ee5042dd91593593a8b0e008f4c85'/>
<id>c3c8c051df3ee5042dd91593593a8b0e008f4c85</id>
<content type='text'>
If kmalloc() fails then it could lead to a NULL dereference.  Check and
return -ENOMEM on error.

Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/YJ6Iw3iNvGycAWV6@mwanda
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If kmalloc() fails then it could lead to a NULL dereference.  Check and
return -ENOMEM on error.

Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/YJ6Iw3iNvGycAWV6@mwanda
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: core: Fix freeing of otp_info buffer</title>
<updated>2021-05-26T08:39:27+00:00</updated>
<author>
<name>Jon Hunter</name>
<email>jonathanh@nvidia.com</email>
</author>
<published>2021-05-18T18:55:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bc8e157fdb466536557b97b6c0df6d7b46a2b91b'/>
<id>bc8e157fdb466536557b97b6c0df6d7b46a2b91b</id>
<content type='text'>
Commit 4b361cfa8624 ("mtd: core: add OTP nvmem provider support") is
causing the following panic ...

 ------------[ cut here ]------------
 kernel BUG at /local/workdir/tegra/linux_next/kernel/mm/slab.c:2730!
 Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
 Modules linked in:
 CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.13.0-rc2-next-20210518 #1
 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
 PC is at ___cache_free+0x3f8/0x51c
 ...
 [&lt;c029bb1c&gt;] (___cache_free) from [&lt;c029c658&gt;] (kfree+0xac/0x1bc)
 [&lt;c029c658&gt;] (kfree) from [&lt;c06da094&gt;] (mtd_otp_size+0xc4/0x108)
 [&lt;c06da094&gt;] (mtd_otp_size) from [&lt;c06dc864&gt;] (mtd_device_parse_register+0xe4/0x2b4)
 [&lt;c06dc864&gt;] (mtd_device_parse_register) from [&lt;c06e3ccc&gt;] (spi_nor_probe+0x210/0x2c0)
 [&lt;c06e3ccc&gt;] (spi_nor_probe) from [&lt;c06e9578&gt;] (spi_probe+0x88/0xac)
 [&lt;c06e9578&gt;] (spi_probe) from [&lt;c066891c&gt;] (really_probe+0x214/0x3a4)
 [&lt;c066891c&gt;] (really_probe) from [&lt;c0668b14&gt;] (driver_probe_device+0x68/0xc0)
 [&lt;c0668b14&gt;] (driver_probe_device) from [&lt;c0666cf8&gt;] (bus_for_each_drv+0x5c/0xbc)
 [&lt;c0666cf8&gt;] (bus_for_each_drv) from [&lt;c0668694&gt;] (__device_attach+0xe4/0x150)
 [&lt;c0668694&gt;] (__device_attach) from [&lt;c06679e0&gt;] (bus_probe_device+0x84/0x8c)
 [&lt;c06679e0&gt;] (bus_probe_device) from [&lt;c06657f8&gt;] (device_add+0x48c/0x868)
 [&lt;c06657f8&gt;] (device_add) from [&lt;c06eb784&gt;] (spi_add_device+0xa0/0x168)
 [&lt;c06eb784&gt;] (spi_add_device) from [&lt;c06ec9a8&gt;] (spi_register_controller+0x8b8/0xb38)
 [&lt;c06ec9a8&gt;] (spi_register_controller) from [&lt;c06ecc3c&gt;] (devm_spi_register_controller+0x14/0x50)
 [&lt;c06ecc3c&gt;] (devm_spi_register_controller) from [&lt;c06f0510&gt;] (tegra_spi_probe+0x33c/0x450)
 [&lt;c06f0510&gt;] (tegra_spi_probe) from [&lt;c066abec&gt;] (platform_probe+0x5c/0xb8)
 [&lt;c066abec&gt;] (platform_probe) from [&lt;c066891c&gt;] (really_probe+0x214/0x3a4)
 [&lt;c066891c&gt;] (really_probe) from [&lt;c0668b14&gt;] (driver_probe_device+0x68/0xc0)
 [&lt;c0668b14&gt;] (driver_probe_device) from [&lt;c0668e30&gt;] (device_driver_attach+0x58/0x60)
 [&lt;c0668e30&gt;] (device_driver_attach) from [&lt;c0668eb8&gt;] (__driver_attach+0x80/0xc8)
 [&lt;c0668eb8&gt;] (__driver_attach) from [&lt;c0666c48&gt;] (bus_for_each_dev+0x78/0xb8)
 [&lt;c0666c48&gt;] (bus_for_each_dev) from [&lt;c0667c44&gt;] (bus_add_driver+0x164/0x1e8)
 [&lt;c0667c44&gt;] (bus_add_driver) from [&lt;c066997c&gt;] (driver_register+0x7c/0x114)
 [&lt;c066997c&gt;] (driver_register) from [&lt;c010223c&gt;] (do_one_initcall+0x50/0x2b0)
 [&lt;c010223c&gt;] (do_one_initcall) from [&lt;c11011f0&gt;] (kernel_init_freeable+0x1a8/0x1fc)
 [&lt;c11011f0&gt;] (kernel_init_freeable) from [&lt;c0c09190&gt;] (kernel_init+0x8/0x118)
 [&lt;c0c09190&gt;] (kernel_init) from [&lt;c01001b0&gt;] (ret_from_fork+0x14/0x24)
 ...
 ---[ end trace 0f652dd222de75d7 ]---

In the function mtd_otp_size() a buffer is allocated by calling
kmalloc() and a pointer to the buffer is stored in a variable 'info'.
The pointer 'info' may then be incremented depending on the length
returned from mtd_get_user/fact_prot_info(). If 'info' is incremented,
when kfree() is called to free the buffer the above panic occurs because
we are no longer passing the original address of the buffer allocated.
Fix this by indexing through the buffer allocated to avoid incrementing
the pointer.

Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
Signed-off-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210518185503.162787-1-jonathanh@nvidia.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 4b361cfa8624 ("mtd: core: add OTP nvmem provider support") is
causing the following panic ...

 ------------[ cut here ]------------
 kernel BUG at /local/workdir/tegra/linux_next/kernel/mm/slab.c:2730!
 Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
 Modules linked in:
 CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.13.0-rc2-next-20210518 #1
 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
 PC is at ___cache_free+0x3f8/0x51c
 ...
 [&lt;c029bb1c&gt;] (___cache_free) from [&lt;c029c658&gt;] (kfree+0xac/0x1bc)
 [&lt;c029c658&gt;] (kfree) from [&lt;c06da094&gt;] (mtd_otp_size+0xc4/0x108)
 [&lt;c06da094&gt;] (mtd_otp_size) from [&lt;c06dc864&gt;] (mtd_device_parse_register+0xe4/0x2b4)
 [&lt;c06dc864&gt;] (mtd_device_parse_register) from [&lt;c06e3ccc&gt;] (spi_nor_probe+0x210/0x2c0)
 [&lt;c06e3ccc&gt;] (spi_nor_probe) from [&lt;c06e9578&gt;] (spi_probe+0x88/0xac)
 [&lt;c06e9578&gt;] (spi_probe) from [&lt;c066891c&gt;] (really_probe+0x214/0x3a4)
 [&lt;c066891c&gt;] (really_probe) from [&lt;c0668b14&gt;] (driver_probe_device+0x68/0xc0)
 [&lt;c0668b14&gt;] (driver_probe_device) from [&lt;c0666cf8&gt;] (bus_for_each_drv+0x5c/0xbc)
 [&lt;c0666cf8&gt;] (bus_for_each_drv) from [&lt;c0668694&gt;] (__device_attach+0xe4/0x150)
 [&lt;c0668694&gt;] (__device_attach) from [&lt;c06679e0&gt;] (bus_probe_device+0x84/0x8c)
 [&lt;c06679e0&gt;] (bus_probe_device) from [&lt;c06657f8&gt;] (device_add+0x48c/0x868)
 [&lt;c06657f8&gt;] (device_add) from [&lt;c06eb784&gt;] (spi_add_device+0xa0/0x168)
 [&lt;c06eb784&gt;] (spi_add_device) from [&lt;c06ec9a8&gt;] (spi_register_controller+0x8b8/0xb38)
 [&lt;c06ec9a8&gt;] (spi_register_controller) from [&lt;c06ecc3c&gt;] (devm_spi_register_controller+0x14/0x50)
 [&lt;c06ecc3c&gt;] (devm_spi_register_controller) from [&lt;c06f0510&gt;] (tegra_spi_probe+0x33c/0x450)
 [&lt;c06f0510&gt;] (tegra_spi_probe) from [&lt;c066abec&gt;] (platform_probe+0x5c/0xb8)
 [&lt;c066abec&gt;] (platform_probe) from [&lt;c066891c&gt;] (really_probe+0x214/0x3a4)
 [&lt;c066891c&gt;] (really_probe) from [&lt;c0668b14&gt;] (driver_probe_device+0x68/0xc0)
 [&lt;c0668b14&gt;] (driver_probe_device) from [&lt;c0668e30&gt;] (device_driver_attach+0x58/0x60)
 [&lt;c0668e30&gt;] (device_driver_attach) from [&lt;c0668eb8&gt;] (__driver_attach+0x80/0xc8)
 [&lt;c0668eb8&gt;] (__driver_attach) from [&lt;c0666c48&gt;] (bus_for_each_dev+0x78/0xb8)
 [&lt;c0666c48&gt;] (bus_for_each_dev) from [&lt;c0667c44&gt;] (bus_add_driver+0x164/0x1e8)
 [&lt;c0667c44&gt;] (bus_add_driver) from [&lt;c066997c&gt;] (driver_register+0x7c/0x114)
 [&lt;c066997c&gt;] (driver_register) from [&lt;c010223c&gt;] (do_one_initcall+0x50/0x2b0)
 [&lt;c010223c&gt;] (do_one_initcall) from [&lt;c11011f0&gt;] (kernel_init_freeable+0x1a8/0x1fc)
 [&lt;c11011f0&gt;] (kernel_init_freeable) from [&lt;c0c09190&gt;] (kernel_init+0x8/0x118)
 [&lt;c0c09190&gt;] (kernel_init) from [&lt;c01001b0&gt;] (ret_from_fork+0x14/0x24)
 ...
 ---[ end trace 0f652dd222de75d7 ]---

In the function mtd_otp_size() a buffer is allocated by calling
kmalloc() and a pointer to the buffer is stored in a variable 'info'.
The pointer 'info' may then be incremented depending on the length
returned from mtd_get_user/fact_prot_info(). If 'info' is incremented,
when kfree() is called to free the buffer the above panic occurs because
we are no longer passing the original address of the buffer allocated.
Fix this by indexing through the buffer allocated to avoid incrementing
the pointer.

Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
Signed-off-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210518185503.162787-1-jonathanh@nvidia.com
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: Create partname and partid debug files for child MTDs</title>
<updated>2021-05-10T10:48:45+00:00</updated>
<author>
<name>Petr Malat</name>
<email>oss@malat.biz</email>
</author>
<published>2021-04-30T06:50:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=feb05fae4df10f6b9bf720662623efc88334c095'/>
<id>feb05fae4df10f6b9bf720662623efc88334c095</id>
<content type='text'>
Partname and partid are set by the upper driver (spi-nor) on the master
MTD. If this MTD is partitioned and CONFIG_MTD_PARTITIONED_MASTER is
disabled, the master MTD is not instantiated and partname and partid
aren't available to the userspace.

Always read the partname and partid from the master MTD, they describe
the HW, which can't differ between master and its children.

Signed-off-by: Petr Malat &lt;oss@malat.biz&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210430065057.32018-1-oss@malat.biz
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Partname and partid are set by the upper driver (spi-nor) on the master
MTD. If this MTD is partitioned and CONFIG_MTD_PARTITIONED_MASTER is
disabled, the master MTD is not instantiated and partname and partid
aren't available to the userspace.

Always read the partname and partid from the master MTD, they describe
the HW, which can't differ between master and its children.

Signed-off-by: Petr Malat &lt;oss@malat.biz&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210430065057.32018-1-oss@malat.biz
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: core: add OTP nvmem provider support</title>
<updated>2021-05-10T10:42:55+00:00</updated>
<author>
<name>Michael Walle</name>
<email>michael@walle.cc</email>
</author>
<published>2021-04-24T11:06:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4b361cfa862479fbb1d14ddf01de4dbc7146dcc5'/>
<id>4b361cfa862479fbb1d14ddf01de4dbc7146dcc5</id>
<content type='text'>
Flash OTP regions can already be read via user space. Some boards have
their serial number or MAC addresses stored in the OTP regions. Add
support for them being a (read-only) nvmem provider.

The API to read the OTP data is already in place. It distinguishes
between factory and user OTP, thus there are up to two different
providers.

Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210424110608.15748-6-michael@walle.cc
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Flash OTP regions can already be read via user space. Some boards have
their serial number or MAC addresses stored in the OTP regions. Add
support for them being a (read-only) nvmem provider.

The API to read the OTP data is already in place. It distinguishes
between factory and user OTP, thus there are up to two different
providers.

Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210424110608.15748-6-michael@walle.cc
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: core: Convert sysfs sprintf/snprintf family to sysfs_emit</title>
<updated>2021-05-10T08:44:40+00:00</updated>
<author>
<name>Tian Tao</name>
<email>tiantao6@hisilicon.com</email>
</author>
<published>2021-04-12T09:35:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5b2fbe0ca0e8a88f8da3c96cd6628561852be655'/>
<id>5b2fbe0ca0e8a88f8da3c96cd6628561852be655</id>
<content type='text'>
Use sysfs_emit instead of snprintf to avoid buf overrun,because in
sysfs_emit it strictly checks whether buf is null or buf whether
pagesize aligned, otherwise it returns an error.

Signed-off-by: Tian Tao &lt;tiantao6@hisilicon.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/1618220144-33839-2-git-send-email-tiantao6@hisilicon.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use sysfs_emit instead of snprintf to avoid buf overrun,because in
sysfs_emit it strictly checks whether buf is null or buf whether
pagesize aligned, otherwise it returns an error.

Signed-off-by: Tian Tao &lt;tiantao6@hisilicon.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/1618220144-33839-2-git-send-email-tiantao6@hisilicon.com
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: core: Constify buf in mtd_write_user_prot_reg()</title>
<updated>2021-04-16T18:30:54+00:00</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2021-04-03T06:09:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1df1fc8c62f7527d953c7f3869930067bf5b3f29'/>
<id>1df1fc8c62f7527d953c7f3869930067bf5b3f29</id>
<content type='text'>
The write buffer comes from user and should be const.
Constify write buffer in mtd core and across all _write_user_prot_reg()
users. cfi_cmdset_{0001, 0002} and onenand_base will pay the cost of an
explicit cast to discard the const qualifier since the beginning, since
they are using an otp_op_t function prototype that is used for both reads
and writes. mtd_dataflash and SPI NOR will benefit of the const buffer
because they are using different paths for writes and reads.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210403060931.7119-1-tudor.ambarus@microchip.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The write buffer comes from user and should be const.
Constify write buffer in mtd core and across all _write_user_prot_reg()
users. cfi_cmdset_{0001, 0002} and onenand_base will pay the cost of an
explicit cast to discard the const qualifier since the beginning, since
they are using an otp_op_t function prototype that is used for both reads
and writes. mtd_dataflash and SPI NOR will benefit of the const buffer
because they are using different paths for writes and reads.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210403060931.7119-1-tudor.ambarus@microchip.com
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'nand/for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux into mtd/next</title>
<updated>2021-04-15T19:14:51+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2021-04-15T19:14:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ef4ed780d005d65b1a70ba7803233cace93a73ac'/>
<id>ef4ed780d005d65b1a70ba7803233cace93a73ac</id>
<content type='text'>
MTD core:
* Handle possible -EPROBE_DEFER from parse_mtd_partitions()

NAND core:
* Fix error handling in nand_prog_page_op() (x2)
* Add a helper to retrieve the number of ECC bytes per step
* Add a helper to retrieve the number of ECC steps
* Let ECC engines advertize the exact number of steps
* ECC Hamming:
  - Populate the public nsteps field
  - Use the public nsteps field
* ECC BCH:
  - Populate the public nsteps field
  - Use the public nsteps field

Raw NAND core:
* Add support for secure regions in NAND memory
* Try not to use the ECC private structures
* Remove duplicate include in rawnand.h
* BBT:
  - Skip bad blocks when searching for the BBT in NAND

Raw NAND controller drivers:
* Qcom:
  - Convert bindings to YAML
  - Use dma_mapping_error() for error check
  - Add missing nand_cleanup() in error path
  - Return actual error code instead of -ENODEV
  - Update last code word register
  - Add helper to configure location register
  - Rename parameter name in macro
  - Add helper to check last code word
  - Convert nandc to chip in Read/Write helper
  - Update register macro name for 0x2c offset
* GPMI:
  - Fix a double free in gpmi_nand_init
* Rockchip:
  - Use flexible-array member instead of zero-length array
* Atmel:
  - Update ecc_stats.corrected counter
* MXC:
  - Remove unneeded of_match_ptr()
* R852:
  - replace spin_lock_irqsave by spin_lock in hard IRQ
* Brcmnand:
  - Move to polling in pio mode on oops write
  - Read/write oob during EDU transfer
  - Fix OOB R/W with Hamming ECC
* FSMC:
  - Fix error code in fsmc_nand_probe()
* OMAP:
  - Use ECC information from the generic structures

SPI-NAND core:
* Add missing MODULE_DEVICE_TABLE()

SPI-NAND drivers:
* gigadevice: Support GD5F1GQ5UExxG
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MTD core:
* Handle possible -EPROBE_DEFER from parse_mtd_partitions()

NAND core:
* Fix error handling in nand_prog_page_op() (x2)
* Add a helper to retrieve the number of ECC bytes per step
* Add a helper to retrieve the number of ECC steps
* Let ECC engines advertize the exact number of steps
* ECC Hamming:
  - Populate the public nsteps field
  - Use the public nsteps field
* ECC BCH:
  - Populate the public nsteps field
  - Use the public nsteps field

Raw NAND core:
* Add support for secure regions in NAND memory
* Try not to use the ECC private structures
* Remove duplicate include in rawnand.h
* BBT:
  - Skip bad blocks when searching for the BBT in NAND

Raw NAND controller drivers:
* Qcom:
  - Convert bindings to YAML
  - Use dma_mapping_error() for error check
  - Add missing nand_cleanup() in error path
  - Return actual error code instead of -ENODEV
  - Update last code word register
  - Add helper to configure location register
  - Rename parameter name in macro
  - Add helper to check last code word
  - Convert nandc to chip in Read/Write helper
  - Update register macro name for 0x2c offset
* GPMI:
  - Fix a double free in gpmi_nand_init
* Rockchip:
  - Use flexible-array member instead of zero-length array
* Atmel:
  - Update ecc_stats.corrected counter
* MXC:
  - Remove unneeded of_match_ptr()
* R852:
  - replace spin_lock_irqsave by spin_lock in hard IRQ
* Brcmnand:
  - Move to polling in pio mode on oops write
  - Read/write oob during EDU transfer
  - Fix OOB R/W with Hamming ECC
* FSMC:
  - Fix error code in fsmc_nand_probe()
* OMAP:
  - Use ECC information from the generic structures

SPI-NAND core:
* Add missing MODULE_DEVICE_TABLE()

SPI-NAND drivers:
* gigadevice: Support GD5F1GQ5UExxG
</pre>
</div>
</content>
</entry>
</feed>
