- 20 11月, 2020 1 次提交
-
-
由 Miquel Raynal 提交于
The probe function is only supposed to initialize the controller hardware but not the ECC engine. Indeed, we don't know anything about the NAND chip(s) at this stage. Let's move the logic initializing the ECC engine, even pretty simple, to the ->attach_chip() hook which gets called during nand_scan() routine, after the NAND chip discovery. As the previously mentioned logic is supposed to parse the DT for us, it is likely that the chip->ecc.* entries be overwritten. So let's avoid this by moving these lines to ->attach_chip(). Fixes: d7157ff4 ("mtd: rawnand: Use the ECC framework user input parsing bits") Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20201113123424.32233-8-miquel.raynal@bootlin.com
-
- 28 9月, 2020 2 次提交
-
-
由 Miquel Raynal 提交于
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: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200827085208.16276-11-miquel.raynal@bootlin.com
-
由 Miquel Raynal 提交于
The use of "syndrome" placement should not be encoded in the ECC engine mode/type. Create a "placement" field in NAND chip and change all occurrences of the NAND_ECC_HW_SYNDROME enumeration to be just NAND_ECC_HW and possibly a placement entry like NAND_ECC_PLACEMENT_INTERLEAVED. Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200827085208.16276-10-miquel.raynal@bootlin.com
-
- 31 5月, 2020 2 次提交
-
-
由 Miquel Raynal 提交于
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: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-14-miquel.raynal@bootlin.com
-
由 Miquel Raynal 提交于
Not sure nand_cleanup() is the right function to call here but in any case it is not nand_release(). Indeed, even a comment says that calling nand_release() is a bit of a hack as there is no MTD device to unregister. So switch to nand_cleanup() for now and drop this comment. There is no Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f9 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if it did not intruce any bug. Fixes: d44154f9 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-13-miquel.raynal@bootlin.com
-
- 11 5月, 2020 6 次提交
-
-
由 Boris Brezillon 提交于
Now that exec_op() has been implemented we can get rid of the legacy interface implementation. Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-6-boris.brezillon@collabora.com
-
由 Boris Brezillon 提交于
Implement exec_op() so we can later get rid of the legacy implementation. It's worth noting that the new implementation assert/deassert the CE pin on each operation, which might not be necessary. We also dropped the extra reset done at chip selection time on DOC2001plus. If it's needed we really should do something smarter, because having a reset everytime we access the chip is not that great perf-wise. Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-5-boris.brezillon@collabora.com
-
由 Boris Brezillon 提交于
Stop relying on the dummy controller object embedded in nand_chip.legacy and explicitly inherit from nand_controller. Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-4-boris.brezillon@collabora.com
-
由 Boris Brezillon 提交于
The logic can easily be merged in doc2000_readbuf(). Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-3-boris.brezillon@collabora.com
-
由 Boris Brezillon 提交于
Single byte accesses normally go through read_byte() but we are about to use this function in the exec_op() implementation and thus needs to prepare for single byte reads. Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200501143917.1388957-2-boris.brezillon@collabora.com
-
由 Boris Brezillon 提交于
We have a dummy block_bad() implementation returning 0. Let's set the NAND_NO_BBM_QUIRK flag and let the core take care of that. Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200511064917.6255-3-boris.brezillon@collabora.com
-
- 30 3月, 2020 1 次提交
-
-
由 Miquel Raynal 提交于
Use Joe Perches cvt_fallthrough.pl script to convert /* fallthrough */ comments (and its derivatives) into a fallthrough; statement. This automatically drops useless ones. Do it MTD-wide. Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Acked-by: NVignesh Raghavendra <vigneshr@ti.com> Acked-by: NTudor Ambarus <tudor.ambarus@microchip.com> Acked-by: NRichard Weinberger <richard@nod.at> Link: https://lore.kernel.org/linux-mtd/20200325212115.14170-1-miquel.raynal@bootlin.com
-
- 11 3月, 2020 1 次提交
-
-
由 Colin Ian King 提交于
There is a spelling mistake (missing i) in pr_info messages. Fix these. Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200208113612.817988-1-colin.king@canonical.com
-
- 21 5月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Add SPDX license identifiers to all files which: - Have no license information of any form - Have MODULE_LICENCE("GPL*") inside which was used in the initial scan/conversion to ignore the file These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 08 4月, 2019 2 次提交
-
-
由 Boris Brezillon 提交于
The same information is provided by nanddev_ntargets(). Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
If we want to use the generic NAND layer, we need to have the memorg struct appropriately filled. Patch the detection code to fill this struct. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 21 3月, 2019 1 次提交
-
-
由 Gustavo A. R. Silva 提交于
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warning: drivers/mtd/nand/raw/diskonchip.c: In function ‘doc_probe’: ./include/linux/printk.h:303:2: warning: this statement may fall through [-Wimplicit-fallthrough=] printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/nand/raw/diskonchip.c:1479:4: note: in expansion of macro ‘pr_err’ pr_err("DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n"); ^~~~~~ drivers/mtd/nand/raw/diskonchip.c:1480:3: note: here default: ^~~~~~~ drivers/mtd/nand/raw/nandsim.c: In function ‘ns_init_module’: drivers/mtd/nand/raw/nandsim.c:2254:22: warning: this statement may fall through [-Wimplicit-fallthrough=] chip->bbt_options |= NAND_BBT_NO_OOB; drivers/mtd/nand/raw/nandsim.c:2255:2: note: here case 1: ^~~~ drivers/mtd/nand/raw/nuc900_nand.c: In function ‘nuc900_nand_command_lp’: ./arch/x86/include/asm/io.h:91:22: warning: this statement may fall through [-Wimplicit-fallthrough=] #define __raw_writel __writel drivers/mtd/nand/raw/nuc900_nand.c:52:2: note: in expansion of macro ‘__raw_writel’ __raw_writel((val), (dev)->reg + REG_SMCMD) ^~~~~~~~~~~~ drivers/mtd/nand/raw/nuc900_nand.c:196:3: note: in expansion of macro ‘write_cmd_reg’ write_cmd_reg(nand, NAND_CMD_READSTART); ^~~~~~~~~~~~~ drivers/mtd/nand/raw/nuc900_nand.c:197:2: note: here default: ^~~~~~~ drivers/mtd/nand/raw/omap_elm.c: In function ‘elm_context_restore’: drivers/mtd/nand/raw/omap_elm.c:512:4: warning: this statement may fall through [-Wimplicit-fallthrough=] elm_write_reg(info, ELM_SYNDROME_FRAGMENT_4 + offset, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ regs->elm_syndrome_fragment_4[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/nand/raw/omap_elm.c:514:3: note: here case BCH8_ECC: ^~~~ drivers/mtd/nand/raw/omap_elm.c:517:4: warning: this statement may fall through [-Wimplicit-fallthrough=] elm_write_reg(info, ELM_SYNDROME_FRAGMENT_2 + offset, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ regs->elm_syndrome_fragment_2[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/nand/raw/omap_elm.c:519:3: note: here case BCH4_ECC: ^~~~ drivers/mtd/nand/raw/omap_elm.c: In function ‘elm_context_save’: drivers/mtd/nand/raw/omap_elm.c:466:37: warning: this statement may fall through [-Wimplicit-fallthrough=] regs->elm_syndrome_fragment_4[i] = elm_read_reg(info, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ ELM_SYNDROME_FRAGMENT_4 + offset); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/nand/raw/omap_elm.c:468:3: note: here case BCH8_ECC: ^~~~ drivers/mtd/nand/raw/omap_elm.c:471:37: warning: this statement may fall through [-Wimplicit-fallthrough=] regs->elm_syndrome_fragment_2[i] = elm_read_reg(info, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ ELM_SYNDROME_FRAGMENT_2 + offset); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/nand/raw/omap_elm.c:473:3: note: here case BCH4_ECC: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 07 12月, 2018 1 次提交
-
-
由 Boris Brezillon 提交于
Now that the CS line to be selected is passed to ->exec_op() and stored in chip->cur_cs and after patching all drivers implementing ->exec_op() to stop implementing this method, we can deprecate it by moving it to the nand_legacy structure. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 03 10月, 2018 18 次提交
-
-
由 Boris Brezillon 提交于
The wait timeouts and delays are directly extracted from the NAND timings and ->chip_delay is only used in legacy path, so let's move it to the nand_legacy struct to make it clear. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Those hooks have been overloaded by some drivers for bad reasons: either the driver was not fitting in the NAND framework and should have been an MTD driver (docg4), or it was not properly implementing the OOB read/write request or had a weird layout where BBM are trashed. In any case, we should discourage people from overloading those methods and encourage them to fix their driver instead. Move the ->block_{bad,markbad}() hooks to the nand_legacy struct to make it clear. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Those hooks have been replaced by ->exec_op(). Move them to the nand_legacy struct. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Those hooks have been replaced by ->exec_op(). Move them to the nand_legacy struct. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
All those hooks have been replaced by ->exec_op(). Move them to the nand_legacy struct. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle the chip->waitfunc() hook. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle the chip->cmdfunc() hook. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle the chip->dev_ready() hook. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle the chip->cmd_ctrl() hook. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle all chip->block_xxx() hooks at once. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle the chip->select_chip() hook. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle all chip->write_xxx() hooks at once. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle all chip->read_xxx() hooks at once. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one. Now is ecc->correct()'s turn. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one. Now is ecc->calculate()'s turn. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one. Now is ecc->hwctl()'s turn. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers to take a nand_chip object instead of an mtd_info one. Now is nand_release()'s turn. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Let's make the raw NAND API consistent by patching all helpers to take a nand_chip object instead of an mtd_info one. We start with nand_scan(). Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 18 7月, 2018 1 次提交
-
-
由 Boris Brezillon 提交于
None of the existing drivers are overloading the ->scan_bbt() method, let's get rid of it and replace calls to ->scan_bbt() by nand_create_bbt() ones. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 29 4月, 2018 1 次提交
-
-
由 Jia-Ju Bai 提交于
doc_probe() is never called in atomic context. doc_probe() is only called by init_nanddoc(), which is only set as a parameter of module_init(). This function is not called in atomic context. Despite never getting called from atomic context, doc_probe() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
- 25 4月, 2018 2 次提交
-
-
由 Thomas Gleixner 提交于
The reed solomon library is moving the on stack decoder buffers into the rs control structure. That would break the DoC driver because multiple instances share the same control structure and can operate in parallel. At least in theory.... Instantiate a rs control instance per DoC device to avoid that. The per instance buffer is fine as the operation on a single DoC instance is serialized by the MTD/NAND core. Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Acked-by: NBoris Brezillon <boris.brezillon@bootlin.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Kees Cook <keescook@chromium.org> Cc: Segher Boessenkool <segher@kernel.crashing.org> Cc: Kernel Hardening <kernel-hardening@lists.openwall.com> Cc: Richard Weinberger <richard@nod.at> Cc: Mike Snitzer <snitzer@redhat.com> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Andrew Morton <akpm@linuxfoundation.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Alasdair Kergon <agk@redhat.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Thomas Gleixner 提交于
The decoder library uses variable length arrays on stack. To get rid of them it would be simple to allocate fixed length arrays on stack, but those might become rather large. The other solution is to allocate the buffers in the rs control structure, but this cannot be done as long as the structure can be shared by several users. Sharing is desired because the RS polynom tables are large and initialization is time consuming. To solve this split the codec information out of the control structure and have a pointer to a shared codec in it. Instantiate the control structure for each user, create a new codec if no shareable is avaiable yet. Adjust all affected usage sites to the new scheme. This allows to add per instance decoder buffers to the control structure later on. Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Acked-by: NBoris Brezillon <boris.brezillon@bootlin.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Kees Cook <keescook@chromium.org> Cc: Segher Boessenkool <segher@kernel.crashing.org> Cc: Kernel Hardening <kernel-hardening@lists.openwall.com> Cc: Richard Weinberger <richard@nod.at> Cc: Mike Snitzer <snitzer@redhat.com> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Andrew Morton <akpm@linuxfoundation.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Alasdair Kergon <agk@redhat.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-