#
4c1f3637 |
| 06-Oct-2023 |
Kees Cook <keescook@chromium.org> |
mtd: rawnand: cadence: Annotate struct cdns_nand_chip with __counted_by
Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __
mtd: rawnand: cadence: Annotate struct cdns_nand_chip with __counted_by
Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).
As found with Coccinelle[1], add __counted_by for struct cdns_nand_chip.
Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Richard Weinberger <richard@nod.at> Cc: Vignesh Raghavendra <vigneshr@ti.com> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Roger Quadros <rogerq@kernel.org> Cc: Thierry Reding <treding@nvidia.com> Cc: Yang Yingliang <yangyingliang@huawei.com> Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> Cc: Valentin Korenblit <vkorenblit@sequans.com> Cc: ye xingchen <ye.xingchen@zte.com.cn> Cc: linux-mtd@lists.infradead.org Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20231006201734.work.060-kees@kernel.org
show more ...
|
#
6135e730 |
| 09-Oct-2023 |
Rob Herring <robh@kernel.org> |
mtd: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct hea
mtd: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20231009172923.2457844-1-robh@kernel.org
show more ...
|
#
ec185b18 |
| 11-Apr-2023 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
mtd: nand: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error han
mtd: nand: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void.
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> # atmel Reviewed-by: Paul Cercueil <paul@crapouillou.net> # ingenic Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> # ingenic Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> # intel Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> # meson Acked-by: Roger Quadros <rogerq@kernel.org> # omap_elm Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> # renesas Reviewed-by: Heiko Stuebner <heiko@sntech.de> # rockchip Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> # sunxi Acked-by: Thierry Reding <treding@nvidia.com> # tegra Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230411113816.3472237-1-u.kleine-koenig@pengutronix.de
show more ...
|
#
7c3fc998 |
| 18-Oct-2022 |
Valentin Korenblit <vkorenblit@sequans.com> |
mtd: rawnand: cadence: support 64-bit slave dma interface
32-bit accesses on 64-bit sdma trigger sdma_err in intr_status register.
Check dma capabilities before reading/writing from/to sdma interfa
mtd: rawnand: cadence: support 64-bit slave dma interface
32-bit accesses on 64-bit sdma trigger sdma_err in intr_status register.
Check dma capabilities before reading/writing from/to sdma interface.
Link: https://lore.kernel.org/all/b7e5ebb4-0de8-4958-9bc4-fe06ec4c3635@www.fastmail.com/t/
Signed-off-by: Valentin Korenblit <vkorenblit@sequans.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221018093000.12072-1-vkorenblit@sequans.com
show more ...
|
#
4c5f69ae |
| 01-Sep-2022 |
ye xingchen <ye.xingchen@zte.com.cn> |
mtd: rawnand: cadence: Remove an unneeded result variable
Return the value cadence_nand_set_access_width16() directly instead of storing it in another redundant variable.
Reported-by: Zeal Robot <z
mtd: rawnand: cadence: Remove an unneeded result variable
Return the value cadence_nand_set_access_width16() directly instead of storing it in another redundant variable.
Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220901074555.313266-1-ye.xingchen@zte.com.cn
show more ...
|
#
a28ed09d |
| 26-Apr-2022 |
Yang Yingliang <yangyingliang@huawei.com> |
mtd: rawnand: cadence: fix possible null-ptr-deref in cadence_nand_dt_probe()
It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_i
mtd: rawnand: cadence: fix possible null-ptr-deref in cadence_nand_dt_probe()
It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code.
Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220426084913.4021868-1-yangyingliang@huawei.com
show more ...
|
#
dbb7b2e0 |
| 05-May-2021 |
Miquel Raynal <miquel.raynal@bootlin.com> |
mtd: rawnand: Use more recent ONFI specification wording
In particular, first ONFI specifications referred to SDR modes as asynchronous modes, which is not the term we usually have in mind. The spec
mtd: rawnand: Use more recent ONFI specification wording
In particular, first ONFI specifications referred to SDR modes as asynchronous modes, which is not the term we usually have in mind. The spec has then been updated, so do the same here in the NAND subsystem to avoid any possible confusion.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210505213750.257417-7-miquel.raynal@bootlin.com
show more ...
|
#
fb1c7e82 |
| 21-Sep-2020 |
Liu Shixin <liushixin2@huawei.com> |
mtd: rawnand: cadence: remove a redundant dev_err call
There is an error message within devm_ioremap_resource already, so remove the dev_err call to avoid a redundant error message.
Signed-off-by:
mtd: rawnand: cadence: remove a redundant dev_err call
There is an error message within devm_ioremap_resource already, so remove the dev_err call to avoid a redundant error message.
Signed-off-by: Liu Shixin <liushixin2@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200921013805.1724606-1-liushixin2@huawei.com
show more ...
|
#
bace41f8 |
| 27-Aug-2020 |
Miquel Raynal <miquel.raynal@bootlin.com> |
mtd: rawnand: Use the new ECC engine type enumeration
Mechanical switch from the legacy "mode" enumeration to the new "engine type" enumeration in drivers and board files.
The device tree parsing i
mtd: rawnand: Use the new ECC engine type enumeration
Mechanical switch from the legacy "mode" enumeration to the new "engine type" enumeration in drivers and board files.
The device tree parsing is also updated to return the new enumeration from the old strings.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200827085208.16276-11-miquel.raynal@bootlin.com
show more ...
|
#
7999096f |
| 12-Jun-2020 |
Herbert Xu <herbert@gondor.apana.org.au> |
iov_iter: Move unnecessary inclusion of crypto/hash.h
The header file linux/uio.h includes crypto/hash.h which pulls in most of the Crypto API. Since linux/uio.h is used throughout the kernel this
iov_iter: Move unnecessary inclusion of crypto/hash.h
The header file linux/uio.h includes crypto/hash.h which pulls in most of the Crypto API. Since linux/uio.h is used throughout the kernel this means that every tiny bit of change to the Crypto API causes the entire kernel to get rebuilt.
This patch fixes this by moving it into lib/iov_iter.c instead where it is actually used.
This patch also fixes the ifdef to use CRYPTO_HASH instead of just CRYPTO which does not guarantee the existence of ahash.
Unfortunately a number of drivers were relying on linux/uio.h to provide access to linux/slab.h. This patch adds inclusions of linux/slab.h as detected by build failures.
Also skbuff.h was relying on this to provide a declaration for ahash_request. This patch adds a forward declaration instead.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
4c46667b |
| 29-May-2020 |
Miquel Raynal <miquel.raynal@bootlin.com> |
mtd: rawnand: s/data_interface/interface_config/
The name/suffix data_interface is a bit misleading in that the field or functions actually represent a configuration that can be applied by the contr
mtd: rawnand: s/data_interface/interface_config/
The name/suffix data_interface is a bit misleading in that the field or functions actually represent a configuration that can be applied by the controller/chip. Let's rename all fields/functions/hooks that are worth renaming.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
show more ...
|
#
8b88f4e0 |
| 19-May-2020 |
Miquel Raynal <miquel.raynal@bootlin.com> |
mtd: rawnand: cadence: Stop using nand_release()
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup().
Let's stop using nand_release(
mtd: rawnand: cadence: Stop using nand_release()
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup().
Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-6-miquel.raynal@bootlin.com
show more ...
|
#
ce446b4b |
| 18-Apr-2020 |
Boris Brezillon <boris.brezillon@collabora.com> |
mtd: rawnand: Take check_only into account
->exec_op() is passed a check_only argument that encodes when the controller should just check whether the operation is supported or not without executing
mtd: rawnand: Take check_only into account
->exec_op() is passed a check_only argument that encodes when the controller should just check whether the operation is supported or not without executing it. Some controllers simply ignore this arguments, others don't but keep modifying some of the registers before returning. Let's fix all those drivers.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200418194217.1016060-1-boris.brezillon@collabora.com
show more ...
|
#
fb0f6f33 |
| 10-Apr-2020 |
YueHaibing <yuehaibing@huawei.com> |
mtd: rawnand: cadence: Make cadence_nand_attach_chip static
Fix sparse warning:
drivers/mtd/nand/raw/cadence-nand-controller.c:2595:5: warning: symbol 'cadence_nand_attach_chip' was not declared.
mtd: rawnand: cadence: Make cadence_nand_attach_chip static
Fix sparse warning:
drivers/mtd/nand/raw/cadence-nand-controller.c:2595:5: warning: symbol 'cadence_nand_attach_chip' was not declared. Should it be static?
Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200410115228.30440-1-yuehaibing@huawei.com
show more ...
|
#
0d7d6c81 |
| 10-Feb-2020 |
Piotr Sroka <piotrs@cadence.com> |
mtd: rawnand: cadence: reinit completion before executing a new command
Reing the completion object before executing CDMA command to make sure the 'done' flag is OK.
Fixes: ec4ba01e894d ("mtd: rawn
mtd: rawnand: cadence: reinit completion before executing a new command
Reing the completion object before executing CDMA command to make sure the 'done' flag is OK.
Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem") Cc: stable@vger.kernel.org Signed-off-by: Piotr Sroka <piotrs@cadence.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1581328530-29966-4-git-send-email-piotrs@cadence.com
show more ...
|
#
9bf1903b |
| 10-Feb-2020 |
Piotr Sroka <piotrs@cadence.com> |
mtd: rawnand: cadence: change bad block marker size
Increase bad block marker size from one byte to two bytes. Bad block marker is handled by skip bytes feature of HPNFC. Controller expects this val
mtd: rawnand: cadence: change bad block marker size
Increase bad block marker size from one byte to two bytes. Bad block marker is handled by skip bytes feature of HPNFC. Controller expects this value to be an even number.
Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem") Cc: stable@vger.kernel.org Signed-off-by: Piotr Sroka <piotrs@cadence.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1581328530-29966-3-git-send-email-piotrs@cadence.com
show more ...
|
#
e4578af0 |
| 10-Feb-2020 |
Piotr Sroka <piotrs@cadence.com> |
mtd: rawnand: cadence: fix the calculation of the avaialble OOB size
The value of cdns_chip->sector_count is not known at the moment of the derivation of ecc_size, leading to a zero value. Fix this
mtd: rawnand: cadence: fix the calculation of the avaialble OOB size
The value of cdns_chip->sector_count is not known at the moment of the derivation of ecc_size, leading to a zero value. Fix this by assigning ecc_size later in the code.
Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem") Cc: stable@vger.kernel.org Signed-off-by: Piotr Sroka <piotrs@cadence.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1581328530-29966-2-git-send-email-piotrs@cadence.com
show more ...
|
#
397deafc |
| 10-Feb-2020 |
Piotr Sroka <piotrs@cadence.com> |
mtd: rawnand: cadence: get meta data size from registers
Add checking size of BCH meta data size in capabilities registers instead of using fixed value. BCH meta data is used to keep data from NAND
mtd: rawnand: cadence: get meta data size from registers
Add checking size of BCH meta data size in capabilities registers instead of using fixed value. BCH meta data is used to keep data from NAND flash OOB area.
Signed-off-by: Piotr Sroka <piotrs@cadence.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1581328530-29966-1-git-send-email-piotrs@cadence.com
show more ...
|
#
4aa906f1 |
| 18-Dec-2019 |
Vasyl Gomonovych <gomonovych@gmail.com> |
mtd: cadence: Fix cast to pointer from integer of different size warning
Use dma_addr_t type to pass memory address and control data in DMA descriptor fields memory_pointer and ctrl_data_ptr To fix
mtd: cadence: Fix cast to pointer from integer of different size warning
Use dma_addr_t type to pass memory address and control data in DMA descriptor fields memory_pointer and ctrl_data_ptr To fix warning: cast to pointer from integer of different size
Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
show more ...
|
#
777260a5 |
| 30-Oct-2019 |
Piotr Sroka <piotrs@cadence.com> |
mtd: rawnand: remove unecessary checking if dmac is NULL
Remove unecessary checking if dmac is NULL.
If Cadence nand controller driver uses DMA engine then cdns_ctrl->dmac cannot be NULL. It is ver
mtd: rawnand: remove unecessary checking if dmac is NULL
Remove unecessary checking if dmac is NULL.
If Cadence nand controller driver uses DMA engine then cdns_ctrl->dmac cannot be NULL. It is verified during driver initialization. If Cadence nand controller driver does not use DMA engine then CPU IO read/write are executed instead of slave DMA transfer. In that case cdns_ctrl->dmac is not used at all.
Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Piotr Sroka <piotrs@cadence.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
show more ...
|
#
29d9640b |
| 23-Oct-2019 |
YueHaibing <yuehaibing@huawei.com> |
mtd: rawnand: cadence: Remove dev_err() on platform_get_irq() failure
platform_get_irq() will call dev_err() itself on failure, so there is no need for the driver to also do this. This is detected b
mtd: rawnand: cadence: Remove dev_err() on platform_get_irq() failure
platform_get_irq() will call dev_err() itself on failure, so there is no need for the driver to also do this. This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
show more ...
|
#
ec4ba01e |
| 26-Sep-2019 |
Piotr Sroka <piotrs@cadence.com> |
mtd: rawnand: Add new Cadence NAND driver to MTD subsystem
Add new Cadence NAND driver to MTD subsystem
Signed-off-by: Piotr Sroka <piotrs@cadence.com> Reported-by: kbuild test robot <lkp@intel.com
mtd: rawnand: Add new Cadence NAND driver to MTD subsystem
Add new Cadence NAND driver to MTD subsystem
Signed-off-by: Piotr Sroka <piotrs@cadence.com> Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
show more ...
|