- 16 3月, 2018 1 次提交
-
-
由 Boris Brezillon 提交于
None of the mtd->_erase() implementations work in an asynchronous manner, so let's simplify MTD users that call mtd_erase(). All they need to do is check the value returned by mtd_erase() and assume that != 0 means failure. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NRichard Weinberger <richard@nod.at>
-
- 16 1月, 2018 3 次提交
-
-
由 Boris Brezillon 提交于
Some of the check done in custom ->_read/write_oob() implementation are already done by the core (in mtd_check_oob_ops()). Suggested-by: NPeter Pan <peterpansjtu@gmail.com> [Remove redundant checks done in mtdpart.c] Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NLadislav Michl <ladis@linux-mips.org>
-
由 Boris Brezillon 提交于
Some MTD sublayers/drivers are implementing ->_read/write_oob() and provide dummy wrappers for their ->_read/write() implementations. Let the core handle this case instead of duplicating the logic. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr> Acked-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Tested-by: NLadislav Michl <ladis@linux-mips.org>
-
由 Boris Brezillon 提交于
part_read() and part_read_oob() were counting ECC failures and bitflips differently. Adjust part_read_oob() to mimic what is done in part_read(). This is needed to use ->_read_oob() as a fallback when when ->_read() is not implemented. Note that bitflips and ECC failure accounting on MTD partitions is broken by design, because nothing prevents concurrent accesses to the underlying master MTD device between the moment we save the stats in a local variable and the moment master->_read[_oob]() returns. It's not something that can easily be fixed, so leave it like that for now. Suggested-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NLadislav Michl <ladis@linux-mips.org>
-
- 14 11月, 2017 1 次提交
-
-
由 Nicolas Pitre 提交于
It is now unused. Signed-off-by: NNicolas Pitre <nico@linaro.org> Reviewed-by: NRichard Weinberger <richard@nod.at> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NChris Brandt <chris.brandt@renesas.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 27 9月, 2017 1 次提交
-
-
由 Boris Brezillon 提交于
Commit 1eeef2d7 ("mtd: handle partitioning on devices with 0 erasesize") introduced a regression on heterogeneous erase region devices. Alignment of the partition was tested against the master eraseblock size which can be bigger than the slave one, thus leading to some partitions being marked as read-only. Update wr_alignment to match this slave erasesize after this erasesize has been determined by picking the biggest erasesize of all the regions embedded in the MTD partition. Reported-by: NMathias Thore <Mathias.Thore@infinera.com> Fixes: 1eeef2d7 ("mtd: handle partitioning on devices with 0 erasesize") Cc: <stable@vger.kernel.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NMathias Thore <Mathias.Thore@infinera.com> Reviewed-by: NMathias Thore <Mathias.Thore@infinera.com>
-
- 24 6月, 2017 1 次提交
-
-
由 Brian Norris 提交于
Some recent patches caused churn around this area, and checkpatch noticed the existing issues. Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 23 6月, 2017 5 次提交
-
-
由 Rafał Miłecki 提交于
Some devices have partitions that are kind of containers with extra subpartitions / volumes instead of e.g. a simple filesystem data. To support such cases we need to first create normal flash device partitions and then take care of these special ones. It's very common case for home routers. Depending on the vendor there are formats like TRX, Seama, TP-Link, WRGG & more. All of them are used to embed few partitions into a single one / single firmware file. Ideally all vendors would use some well documented / standardized format like UBI (and some probably start doing so), but there are still countless devices on the market using these poor vendor specific formats. This patch extends MTD subsystem by allowing to specify list of parsers that should be tried for a given partition. Supporting such poor formats is highly unlikely to be the top priority so these changes try to minimize maintenance cost to the minimum. It reuses existing code for these new parsers and just adds a one property and one new function. This implementation requires setting partition parsers in a flash parser. A proper change of bcm47xxpart will follow and in the future we will hopefully also find a solution for doing it with ofpart ("fixed-partitions"). Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Rafał Miłecki 提交于
Some flash device partitions can be containers with extra subpartitions (volumes). All callbacks are already capable of this additional level of indirection. This patch makes sure we always display subpartitions using a tree structure and takes care of deleting subpartitions when parent gets removed. Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Rafał Miłecki 提交于
This prepares mtd subsystem for the new feature: subpartitions. In some cases flash device partition can be a container with extra subpartitions (volumes). So far there was a flat structure implemented. One master (flash device) could be partitioned into few partitions. Every partition got its master and it was enough to get things running. To support subpartitions we need to store pointer to the parent for each partition. This is required to implement more natural tree structure and handle all recursion and offsets calculation. To make code consistent this patch renamed "master" to the "parent" in places where we can be dealing with subpartitions. Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Rafał Miłecki 提交于
When support for sysfs "offset" file was added it missed to update the del_mtd_partitions function. It deletes partitions just like mtd_del_partition does so both should also take care of removing sysfs files. This change moves sysfs_remove_files call to the shared function to fix this issue. Fixes: a62c24d7 ("mtd: part: Add sysfs variable for offset of partition") Cc: Dan Ehrenberg <dehrenberg@chromium.org> Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Rafał Miłecki 提交于
There are two similar functions handling deletion. One handles single partition and another the whole MTD flash device. They share (duplicate) some code so it makes sense to add a small helper for that part. Function del_mtd_partitions has been moved a bit to keep all deleting stuff together. Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 21 6月, 2017 1 次提交
-
-
由 Brian Norris 提交于
This code is going to be reused for parsers matched using OF so let's factor it out to make this easier. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Acked-by: NBrian Norris <computersforpeace@gmail.com>
-
- 14 6月, 2017 1 次提交
-
-
由 Chris Packham 提交于
erasesize is meaningful for flash devices but for SRAM there is no concept of an erase block so erasesize is set to 0. When partitioning these devices instead of ensuring partitions fall on erasesize boundaries we ensure they fall on writesize boundaries. Helped-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 10 2月, 2017 1 次提交
-
-
由 Sascha Hauer 提交于
The user visible change here is that mtd partitions get an of_node link in sysfs. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 09 2月, 2017 1 次提交
-
-
由 Jeff Westfahl 提交于
If implemented, 'max_bad_blocks' returns the maximum number of bad blocks to reserve for a MTD. An implementation for NAND is coming soon. Signed-off-by: NJeff Westfahl <jeff.westfahl@ni.com> Signed-off-by: NZach Brown <zach.brown@ni.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electron.com> Acked-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 12 10月, 2016 1 次提交
-
-
由 Masahiro Yamada 提交于
Kernel source files need not include <linux/kconfig.h> explicitly because the top Makefile forces to include it with: -include $(srctree)/include/linux/kconfig.h This commit removes explicit includes except the following: * arch/s390/include/asm/facilities_src.h * tools/testing/radix-tree/linux/kernel.h These two are used for host programs. Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 29 9月, 2016 1 次提交
-
-
由 Richard Weinberger 提交于
If the master device has callbacks for _get/put_device() and this MTD has slaves a get_mtd_device() call on paritions will never issue the registered callbacks. Fix this by propagating _get/put_device() down. Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 15 9月, 2016 1 次提交
-
-
由 Boris Brezillon 提交于
MLC and TLC NAND devices are using NAND cells exposing more than one bit, but instead of attaching all the bits in a given cell to a single NAND page, each bit is usually attached to a different page. This concept is called 'page pairing', and has significant impacts on the flash storage usage. The main problem showed by these devices is that interrupting a page program operation may not only corrupt the page we are programming but also the page it is paired with, hence the need to expose to MTD users the pairing scheme information. The pairing APIs allows one to query pairing information attached to a given page (here called wunit), or the other way around (the wunit pointed by pairing information). It also provides several helpers to help the conversion between absolute offsets and wunits, and query the number of pairing groups. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: NBrian Norris <computersforpeace@gmail.com>
-
- 20 4月, 2016 2 次提交
-
-
由 Boris Brezillon 提交于
ECC layout definitions are currently exposed using the nand_ecclayout struct which embeds oobfree and eccpos arrays with predefined size. This approach was acceptable when NAND chips were providing relatively small OOB regions, but MLC and TLC now provide OOB regions of several hundreds of bytes, which implies a non negligible overhead for everybody even those who only need to support legacy NANDs. Create an mtd_ooblayout_ops interface providing the same functionality (expose the ECC and oobfree layout) without the need for this huge structure. The mtd->ecclayout is now deprecated and should be replaced by the equivalent mtd_ooblayout_ops. In the meantime we provide a wrapper around the ->ecclayout field to ease migration to this new model. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 08 3月, 2016 1 次提交
-
-
由 Boris BREZILLON 提交于
Currently, all MTD drivers/sublayers exposing an OOB area are doing the same kind of test to extract the available OOB size based on the mtd_info and mtd_oob_ops structures. Move this common logic into an inline function and make use of it. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Suggested-by: NPriit Laes <plaes@plaes.org> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 10 12月, 2015 4 次提交
-
-
由 Brian Norris 提交于
If partition parsers need to clean up their resources, we shouldn't assume that all memory will fit in a single kmalloc() that the caller can kfree(). We should allow the parser to provide a proper cleanup routine. Note that this means we need to keep a hold on the parser's module for a bit longer, and release it later with mtd_part_parser_put(). Alongside this, define a default callback that we'll automatically use if the parser doesn't provide one, so we can still retain the old behavior. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Brian Norris 提交于
For some of the core partitioning code, it helps to keep info about the parsed partition (and who parsed them) together in one place. Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Brian Norris 提交于
The use of kmemdup() complicates the error handling a bit. We don't actually need to allocate new memory, since this reference is treated as const, and it is copied into new memory by the partition registration code anyway. So remove it. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Brian Norris 提交于
We're going to reuse put_partition_parser(), so let's fix up the prefix naming a bit, to hopefully be more consistent. Also make convert to a true C function instead of a macro. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 05 12月, 2015 1 次提交
-
-
由 Brian Norris 提交于
We can guard against reorganization of struct mtd_part by using container_of(). We can also make sure we're using the right pointer types by making this a static inline function instead of a macro. Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 20 11月, 2015 1 次提交
-
-
由 Brian Norris 提交于
This can help eliminate some boilerplate by generating the module_init() and module_exit() functions, and by automatically assigning the module owner. Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 13 11月, 2015 1 次提交
-
-
由 Brian Norris 提交于
It's easier to guarantee we've cleared out all unused fields with memset() than by manually initializing each field. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 27 10月, 2015 1 次提交
-
-
由 Brian Norris 提交于
Due to wrong assumption in ofpart ofpart fails on Exynos on SPI chips with no partitions because the subnode containing controller data confuses the ofpart parser. Thus compiling in ofpart support automatically fails probing any SPI NOR flash without partitions on Exynos. Compiling in a partitioning scheme should not cause probe of otherwise valid device to fail. Instead, let's do the following: * try parsers until one succeeds * if no parser succeeds, report the first error we saw * even in the failure case, allow MTD to probe, with fallback partitions or no partitions at all -- the master device will still be registered Issue report and comments initially by Michal Suchanek. Reported-by: NMichal Suchanek <hramrach@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 12 10月, 2015 1 次提交
-
-
由 Michal Suchanek 提交于
The probe of a mtd device can fail when a partition parser returns error. The failure due to partition parsing can be quite mysterious when multiple partitioning schemes are compiled in and any of them can fail the probe. Add debug prints which show what parsers were tried and what they returned. Signed-off-by: NMichal Suchanek <hramrach@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 01 10月, 2015 1 次提交
-
-
由 Boris BREZILLON 提交于
If we fail to allocate a partition structure in the middle of the partition creation process, the already allocated partitions are never removed, which means they are still present in the partition list and their resources are never freed. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Cc: stable@vger.kernel.org Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 06 4月, 2015 3 次提交
-
-
由 Dan Ehrenberg 提交于
This patch makes MTD dynamic partitioning more flexible by removing overlap checks for dynamic partitions. I don't see any particular reason why overlapping dynamic partitions should be prohibited while static partitions are allowed to overlap freely. The checks previously had an off-by-one error, where 'end' should be one less than what it is currently set at, and adding partitions out of increasing order will fail. Disabling the checks resolves this issue. Signed-off-by: NDan Ehrenberg <dehrenberg@chromium.org> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Dan Ehrenberg 提交于
This patch makes a sysfs variable called 'offset' on each partition which contains the offset in bytes from the beginning of the master device that the partition starts. Signed-off-by: NDan Ehrenberg <dehrenberg@chromium.org> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Dan Ehrenberg 提交于
For many use cases, it helps to have a device node for the entire MTD device as well as device nodes for the individual partitions. For example, this allows querying the entire device's properties. A common idiom is to create an additional partition which spans over the whole device. This patch makes a config option, CONFIG_MTD_PARTITIONED_MASTER, which makes the master partition present even when the device is partitioned. This isn't turned on by default since it presents a backwards-incompatible device numbering. The patch also makes the parent of a partition device be the master, if the config flag is set, now that the master is a full device. Signed-off-by: NDan Ehrenberg <dehrenberg@chromium.org> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 21 1月, 2015 1 次提交
-
-
由 Christoph Hellwig 提交于
Since "BDI: Provide backing device capability information [try #3]" the backing_dev_info structure also provides flags for the kind of mmap operation available in a nommu environment, which is entirely unrelated to it's original purpose. Introduce a new nommu-only file operation to provide this information to the nommu mmap code instead. Splitting this from the backing_dev_info structure allows to remove lots of backing_dev_info instance that aren't otherwise needed, and entirely gets rid of the concept of providing a backing_dev_info for a character device. It also removes the need for the mtd_inodefs filesystem. Signed-off-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NTejun Heo <tj@kernel.org> Acked-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NJens Axboe <axboe@fb.com>
-
- 09 7月, 2014 2 次提交
-
-
由 Ezequiel Garcia 提交于
With the introduction of mtd_block_isreserved(), it's now possible to fix the bad and reserved block distribution exposed by ecc_stats, instead of accounting all the bad or reserved blocks as 'bad'. Signed-off-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com> Tested-by: NPekon Gupta <pekon@ti.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Ezequiel Garcia 提交于
In addition to mtd_block_isbad(), which checks if a block is bad or reserved, it's needed to check if a block is reserved only (but not bad). This commit adds an MTD interface for it, in a similar fashion to mtd_block_isbad(). While here, fix mtd_block_isbad() so the out-of-bounds checking is done before the callback check. Signed-off-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com> Tested-by: NPekon Gupta <pekon@ti.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 11 3月, 2014 1 次提交
-
-
由 Christian Riesch 提交于
Signed-off-by: NChristian Riesch <christian.riesch@omicron.at> Cc: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 04 1月, 2014 1 次提交
-
-
由 Axel Lin 提交于
register_mtd_parser never fails; hence make it return void. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-