summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdblock_ro.c
Commit message (Collapse)AuthorAgeFilesLines
* mtdblock: make warning messages ratelimitedColin Ian King2023-07-271-1/+1
| | | | | | | | | | When exercising various dev interfaces with stress-ng the mtdblock drivers can be (ab)used to generate a lot of warning messages. Make these rate limited to reduce the kernel log from being spammed with the same messages. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230719103354.2829366-1-colin.i.king@gmail.com
* mtdblock: tolerate corrected bit-flipsBang Li2023-03-221-1/+3
| | | | | | | | | mtd_read() may return -EUCLEAN in case of corrected bit-flips.This particular condition should not be treated like an error. Signed-off-by: Bang Li <libang.linuxer@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230314165653.252673-1-libang.linuxer@gmail.com
* mtdblock: Warn if added for a NAND deviceEzequiel Garcia2021-08-171-0/+4
| | | | | | | | | | | | | | | | There is a surprisingly large number of tutorials that suggest using mtdblock to mount SquashFS filesystems on flash devices, including NAND devices. This approach is suboptimal than using UBI. If the flash device is NAND, this is specially true, due to wear leveling, bit-flips and badblocks. In this case UBI is strongly preferred, so be nice to users and print a warning suggesting to consider UBI block, if mtdblock is added for a NAND device. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210801234509.18774-8-ezequiel@collabora.com
* mtd: mtdblock_ro: Use module_mtd_blktrans to register driverDejin Zheng2021-03-111-12/+1
| | | | | | | | | Removing some boilerplate by using module_mtd_blktrans instead of calling register and unregister in the otherwise empty init/exit functions. Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210213164600.409061-6-zhengdejin5@gmail.com
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 102Thomas Gleixner2019-05-241-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin st fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 50 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190523091649.499889647@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mtd: Move major number definitions to major.hEzequiel Garcia2013-11-061-0/+1
| | | | | | | | | This patch moves the char and block major number definitions to major.h to be with the rest of the major numbers. While doing this, include major.h in the files that need it. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* mtd: Use MTD_BLOCK_MAJOR instead of the magic numberEzequiel Garcia2013-11-061-1/+1
| | | | | Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* mtd: introduce mtd_write interfaceArtem Bityutskiy2012-01-091-1/+1
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_read interfaceArtem Bityutskiy2012-01-091-1/+1
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: Add module.h to drivers users that were implicitly using it.Paul Gortmaker2011-10-311-0/+1
| | | | | | | | We are cleaning up the implicit presence of module.h that these drivers are taking advantage of. Fix them in advance of the cleanup operation. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* mtd: Update copyright noticesDavid Woodhouse2010-08-081-2/+17
| | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mtd: mtdblock: test return value of add_mtd_blktrans_dev, because if can failMaxim Levitsky2010-02-261-1/+2
| | | | | | | This prevents a memory leak Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: blktrans: Hotplug fixesMaxim Levitsky2010-02-261-1/+0
| | | | | | | | | | | | | | | | | | | * Add locking where it was missing. * Don't do a get_mtd_device in blktrans_open because it would lead to a deadlock; instead do that in add_mtd_blktrans_dev. * Only free the mtd_blktrans_dev structure when the last user exits. * Flush request queue on device removal. * Track users, and call tr->release in del_mtd_blktrans_dev Due to that ->open and release aren't called more that once. Now it is safe to call del_mtd_blktrans_dev while the device is still in use. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* MTD/JFFS2: remove CVS keywordsAdrian Bunk2008-06-041-2/+0
| | | | | | | | | | | | Once upon a time, the MTD repository was using CVS. This patch therefore removes all usages of the no longer updated CVS keywords from the MTD code. This also includes code that printed them to the user. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] replace kmalloc+memset with kzallocBurman Yan2006-11-281-3/+1
| | | | | Signed-off-by: Yan Burman <yan_952@hotmail.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] Allow variable block sizes in mtd_blkdevsRichard Purdie2006-11-281-1/+2
| | | | | | | | | Currently, mtd_blkdevs enforces a block size of 512, even if the drivers can seemingly request a different size. This patch fixes mtd_blkdevs so block sizes other than 512 work correctly. Signed-off-by: Richard Purdie <rpurdie@openedhand.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* Make mtdblock_ro unconditionally readonlyJörn Engel2006-04-171-3/+1
| | | | | | | mtdblock_ro is by definition readonly. Remove the silly checks. Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-161-0/+87
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!