summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
...
| * | mtd: uclinux: mark local stuff staticMike Frysinger2009-06-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The uclinux_ram_mtdinfo, uclinux_romfs, and uclinux_point symbols do not need to be visible outside of this module, so mark them static. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Greg Ungerer <gerg@uclinux.org> CC: uclinux-dev@uclinux.org CC: linux-mtd@lists.infradead.org Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: uclinux: do not allow to be built as a moduleMike Frysinger2009-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There isn't any benefit to building the uClinux MTD map as a module as the rootfs it requires in order to actually be usable is appended to the kernel image, not the module. No known system builds it this way either, so change the option to "bool". Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Paul Mundt <lethal@linux-sh.org> CC: Greg Ungerer <gerg@uclinux.org> CC: uclinux-dev@uclinux.org CC: linux-mtd@lists.infradead.org Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: uclinux: allow systems to override map addr/sizeMike Frysinger2009-06-051-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a processor anomaly (05000263 to be exact), most Blackfin parts cannot keep the embedded filesystem image directly after the kernel in RAM. Instead, the filesystem needs to be relocated to the end of memory. As such, we need to tweak the map addr/size during boot for Blackfin systems. This can be done in any early arch/board init code. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Paul Mundt <lethal@linux-sh.org> CC: Greg Ungerer <gerg@uclinux.org> CC: uclinux-dev@uclinux.org CC: linux-mtd@lists.infradead.org Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: blackfin NFC: fix hang when using NAND on BF527-EZKITsCliff Cai2009-06-051-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DMAs have different bit sizes on BF52x and BF54x. From the PHRM: "The 16-bit DMA Access Bus (DAB) connects the DMA controller to the on-chip peripherals, PPI, SPI, Ethernet MAC, the SPORTs, NFC, HOSTDP and the UARTs." 32-bit DMA won't work for BF52x. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: blackfin NFC: remove pointless return value in bf5xx_nand_dma_rwMike Frysinger2009-06-051-3/+1
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: add on-flash BBT support for Atmel NAND driverSimon Polette2009-06-051-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | Just add a new on-flash-bbt module parameter. Signed-off-by: Simon Polette <spolette@adetelgroup.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: MXC NAND support for 2KiB page size flashesVladimir Barinov2009-06-051-9/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add support for 2KiB page size flashes - Fix page address access for large pages - Detect oob layout at runtime - handle pagesize_2k variable - Fix oob16 layout: reserve location 5 of oob area since it's used for bbt Signed-off-by: Vladimir Barinov <vova.barinov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: plat_nand: allow platform to set partitionsH Hartley Sweeten2009-06-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add optional callback to allow platform to initialize partitions. Static partitions on a nand device could vary depending on the size of the device. This patch allows an optional platform callback to be used to setup this partition information at runtime. Scan order is: 1) chip.part_probe_types 2) chip.set_parts 3) chip.partitions 4) full mtd device (fallback for no partitions) Some of the existing nand drivers could possibly be replaced by the plat_nand driver by using this patch. These include autcpu12.c and ts7250.c drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: plat_nand: add platform probe/remove callbacksH Hartley Sweeten2009-06-051-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add optional probe and remove callbacks to the plat_nand driver. Some platforms may require additional setup, such as configuring the memory controller, before the nand device can be accessed. This patch provides an optional callback to handle this setup as well as a callback to teardown the setup. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Tested-by: Alexander Clouter <alex@digriz.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: remove pmcmsp-ramroot.cShane McDonald2009-06-053-114/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RAMROOT function was a successful but non-portable attempt to append the root filesystem to the end of the kernel image. The preferred and portable solution is to use an initramfs instead. The only user of this function was the msp71xx configuration in the MIPS architecture; as the use of the RAMROOT has been removed from that configuration, there are no more users, so this code can be removed. Signed-off-by: Shane McDonald <mcdonald.shane@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: OneNAND: add missing __devexit_pMika Korhonen2009-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing __devexit_p wrapper and no more mark shutdown with __devexit. Fixes build in configurations where devexit functions get discarded. Signed-off-by: Mika Korhonen <mika.j.korhonen@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: m25p80: add support for Macronix MX25L12805DLennert Buytenhek2009-06-051-0/+3
| | | | | | | | | | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: CFI 1.0 and CFI 1.1Daniel Ribeiro2009-06-051-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows otpinfo for CFI >= 1.0 and burst read for CFI >= 1.1. references: 1.0: http://www.datasheetcatalog.org/datasheets2/81/816884_1.pdf 1.1: http://milkymist.org/doc/MT28F640J3.pdf http://www.delorie.com/agenda/specs/29066709.pdf Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: CFI: quirk for PF38F4476.Daniel Ribeiro2009-06-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk to pass probe on this chip. This patch depends on "MTD: CFI 1.0 and CFI 1.1" Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: extend plat_nand for (read|write)_bufAlexander Clouter2009-06-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds (write|read)_buf callbacks to plat_nand. The NAND on the TS-7800 provisioned by the FPGA allows readw() and readl() to be used which gives a 2.5x speed up. To be able to use this from the plat_nand driver a hook for read_buf (and also write_buf whilst we are in there) need to be made available. This patch adds the hook. Signed-off-by: Alexander Clouter <alex@digriz.org.uk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: add SST39SF040 chip to jedec_probeMichał Mirosław2009-06-051-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | Add SST39SF040 chip (like SST39SF020A but bigger - 4Mbit). Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: davinci_nand: cmdlinepart uses MTD IDsDavid Brownell2009-06-051-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some legacy code from the davinci_nand driver, which made cmdlinepart ignore the the MTD ID passed to it. Boards can have multiple NAND chips, and some do (like the DM357 EVM), so this dated hack is undesirable. Correct labels are like "davinci_nand.0" (for chipselect 0). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: OneNAND: add support for OneNAND manufactured by NumonyxAdrian Hunter2009-06-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to adding the Numonyx manufacturer code, this patch also ensures 'sync. write' is disabled when reading identification data - something that the Numonyx chip objects to, but the Samsung chip seems to ignore. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: m25p80 nand: add m45pe10 idsMatthieu CASTET2009-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch add m45pe10 [1] chip support to the m25p80 driver. [1] http://www.numonyx.com/Documents/Datasheets/M45PE10.pdf Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: mxc_nand: add correct dev_id parameter to free_irq() callsMagnus Lilja2009-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure to pass the same dev_id data to free_irq() that was used when calling request_irq(), otherwise we get a warning about freeing an already free IRQ. Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: nand: fix 512 byte software ecc supportVimal Singh2009-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Type of 'byte_addr' needes to be 'unsigned int' for 512 byte ECC support. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: nand: davinci_nand, 4-bit ECC for smallpageDavid Brownell2009-06-051-13/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minimal support for the 4-bit ECC engine found on DM355, DM365, DA830/OMAP-L137, and similar recent DaVinci-family chips. This is limited to small-page flash for now; there are some page layout issues for large page chips. Note that most boards using this engine (like the DM355 EVM) include 2GiB large page chips. Sanity tested on DM355 EVM after swapping the socketed NAND for a small-page one. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: nand: minor davinci_nand cleanupDavid Brownell2009-06-051-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the DaVinci NAND driver require platform_data with board-specific configuration. We can't actually do any kind of sane job of configuring it otherwise. Also fix the comment about picking the "best" ECC mode. We can't do those any more; that relied on knowing what kind of CPU we're using (they don't all support 4-bit ECC), and current policy is that drivers not have cpu_is_*() checks. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: nand: don't walk past end of oobfree[]David Brownell2009-06-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve issue noted by Sneha: when computing oobavail from the list of free areas in the OOB, don't assume there will always be an unused slot at the end. With ECC_HW_SYNDROME and 4KiB page chips, it's fairly likely there *won't* be one. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Narnakaje, Snehaprabha" <nsnehaprabha@ti.com>" Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: plat_nand: fix section errorThomas Chou2009-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With CONFIG_HOTPLUG=n, the following eror occurred during link: local symbol 0: discarded in section `.devexit.text' from drivers/built-in.o It was caused by improper section reference. The __devexit_p() should be added to the .remove function. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: Fix pointer handling in compat ioctls to use compat_ptr()David Woodhouse2009-05-291-2/+2
| | | | | | | | | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: Handle compat ioctls directly; remove all trace from compat_ioctl.cKevin Cernekee2009-05-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all references to MTD ioctls from fs/compat_ioctl.c and let them all be handled by mtd_compat_ioctl(). Signed-off-by: Kevin Cernekee <kpc.mtd@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: add OOB ioctls for >4GiB devicesKevin Cernekee2009-05-291-0/+28
| | | | | | | | | | | | | | | | | | Signed-off-by: Kevin Cernekee <kpc.mtd@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: compat_ioctl cleanupKevin Cernekee2009-05-291-84/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Move the MEMREADOOB/MEMWRITEOOB compat_ioctl wrappers from fs/compat_ioctl.c into mtdchar.c . Original request was here: http://lkml.org/lkml/2009/4/1/295 2) Add missing COMPATIBLE_IOCTL lines, so that mtd-utils does not error out when running in 64/32 compatibility mode. LKML-Reference: <200904011650.22928.arnd@arndb.de> Signed-off-by: Kevin Cernekee <kpc.mtd@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: add MEMERASE64 ioctl for >4GiB devicesKevin Cernekee2009-05-291-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | New MEMERASE/MEMREADOOB/MEMWRITEOOB ioctls are needed in order to support 64-bit offsets into large NAND flash devices. Signed-off-by: Kevin Cernekee <kpc.mtd@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: Fix handling of mtdname in txx9ndfmc.cDavid Woodhouse2009-05-291-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out by Kay Sievers, the name size limit is gone from the driver-core, and BUS_ID_SIZE is obsolescent. Rather than just papering over the problem by replacing the mtdname array size with an arbitrary '20 + 2', fix the problem properly and handle arbitrary name sizes. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: Add armflash support for multiple blocks of flashCatalin Marinas2009-05-291-62/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds MTD concatenation support to integrator-flash.c for platforms with more than one block of flash memory (e.g. RealView PB11MPCore). The implementation is based on the sa1100-flash.c one. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: DIL/NetPC broken for nowDavid Woodhouse2009-05-291-1/+1
| | | | | | | | | | | | | | | | | | We'll fix it up again, but for now I don't think anyone really cares. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | [MTD] Remove option for add_mtd_partitions() to not register partitions.David Woodhouse2009-05-261-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This breaks the dilnetpc map driver, but it could be fixed not to use that option. We want to simplify the partition handling, and this is a step towards that. Remove superfluous 'index' field from private struct mtd_part too, while we're at it. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | [MTD] Only set partition suspend/resume method if parent not registeredDavid Woodhouse2009-05-261-1/+1
| | | | | | | | | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | [MTD] Remove mtd->{suspend,resume} calls from board driversDavid Woodhouse2009-05-265-113/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now the MTD core will do this for us, we don't need to hook it up from the board drivers. Shame we can't do shutdown from the class too... Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | [MTD] Restore suspend/resume support for mtd devicesDavid Woodhouse2009-05-261-10/+37
| | | | | | | | | | | | | | | | | | | | | This is intended to suspend/resume the _chip_, while we leave board drivers to handle their own suspend/resume for the controller. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | [MTD] set blkdev parent to the mtd device, not its parentDavid Woodhouse2009-05-261-1/+1
| | | | | | | | | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | | Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6Linus Torvalds2009-06-1712-335/+885
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'linux-next' of git://git.infradead.org/ubi-2.6: (21 commits) UBI: add reboot notifier UBI: handle more error codes UBI: fix multiple spelling typos UBI: fix kmem_cache_free on error patch UBI: print amount of reserved PEBs UBI: improve messages in the WL worker UBI: make gluebi a separate module UBI: remove built-in gluebi UBI: add notification API UBI: do not switch to R/O mode on read errors UBI: fix and clean-up error paths in WL worker UBI: introduce new constants UBI: fix race condition UBI: minor serialization fix UBI: do not panic if volume check fails UBI: add dump_stack in checking code UBI: fix races in I/O debugging checks UBI: small debugging code optimization UBI: improve debugging messages UBI: re-name volumes_mutex to device_mutex ...
| * | | UBI: add reboot notifierKevin Cernekee2009-06-102-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Terminate the UBI background thread prior to restarting the system. [Artem: amended comments a little] Signed-off-by: Kevin Cernekee <kpc.mtd@gmail.com> Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: handle more error codesArtem Bityutskiy2009-06-101-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UBIFS WL worker may encounter read errors and there is logic which makes a decision whether we should do one of: 1. cancel the operation and move the PEB with the read errors to the 'erroneous' list; 2. switch to R/O mode. ATM, only -EIO errors trigger 1., other errors trigger 2. The idea is that if we know we encountered an I/O error, do 1. Otherwise, we do not know how to react, and do 2., just in case. E.g., if the underlying driver became crazy because of a bug, we do not want to harm any data, and switch to R/O mode. This patch does 2 things: 1. Makes sure reads from the source PEB always cause 1. This is more consistent with other reads which come from the upper layers and never cause R/O. 2. Teaches UBI to do 1. also on -EBADMSG, UBI_IO_BAD_VID_HDR, -ENOMEM, and -ETIMEOUT. But this is only when reading the target PEB. This preblems were hunted by Adrian Hunter. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: fix multiple spelling typosArtem Bityutskiy2009-06-104-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the typos were indicated by Adrian Hunter, some by 'aspell'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: fix kmem_cache_free on error patchArtem Bityutskiy2009-06-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'kmem_cache_free()' oopeses if NULL is passed, and there is one error-path place where UBI may call it with NULL object. This problem was pointed to by Adrian Hunter. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: print amount of reserved PEBsArtem Bityutskiy2009-06-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When marking a PEB as bad, print how many PEBs are left reserved. This is very useful information. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: improve messages in the WL workerArtem Bityutskiy2009-06-081-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Print not only the PEB number, but also the LEB number and volume id, which is very useful for bug hunting. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: make gluebi a separate moduleDmitry Pervushin2009-06-033-98/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Artem: re-worked the patch: made it release resources when the module is unloaded, made it do module referencing, made it really independent on UBI, tested it with the UBI test-suite which can be found in ubi-2.6.git/tests/ubi-tests, re-named most of the funcs/variables to get rid of the "ubi" word and make names consistent.] Signed-off-by: Dmitry Pervushin <dpervushin@embeddedalley.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: remove built-in gluebiDmitry Pervushin2009-06-023-51/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove built-in gluebi support. This is a preparation for a standalone glubi module support Signed-off-by: Dmitry Pervushin <dpervushin@embeddedalley.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: add notification APIDmitry Pervushin2009-06-025-21/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UBI volume notifications are intended to create the API to get clients notified about volume creation/deletion, renaming and re-sizing. A client can subscribe to these notifications using 'ubi_volume_register()' and cancel the subscription using 'ubi_volume_unregister()'. When UBI volumes change, a blocking notifier is called. Clients also can request "added" events on all volumes that existed before client subscribed to the notifications. If we use notifications instead of calling functions like 'ubi_gluebi_xxx()', we can make the MTD emulation layer to be more flexible: build it as a separate module and load/unload it on demand. [Artem: many cleanups, rework locking, add "updated" event, provide device/volume info in notifiers] Signed-off-by: Dmitry Pervushin <dpervushin@embeddedalley.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: do not switch to R/O mode on read errorsArtem Bityutskiy2009-06-024-15/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves UBI errors handling. ATM UBI switches to R/O mode when the WL worker fails to read the source PEB. This means that the upper layers (e.g., UBIFS) has no chances to unmap the erroneous PEB and fix the error. This patch changes this behaviour and makes UBI put PEBs like this into a separate RB-tree, thus preventing the WL worker from hitting the same read errors again and again. But there is a 10% limit on a maximum amount of PEBs like this. If there are too much of them, UBI switches to R/O mode. Additionally, this patch teaches UBI not to panic and switch to R/O mode if after a PEB has been copied, the target LEB cannot be read back. Instead, now UBI cancels the operation and schedules the target PEB for torturing. The error paths has been tested by ingecting errors into 'ubi_eba_copy_leb()'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | | UBI: fix and clean-up error paths in WL workerArtem Bityutskiy2009-06-022-61/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the error path in the WL worker - in same cases UBI oopses when 'goto out_error' happens and e1 or e2 are NULL. This patch also cleans up the error paths a little. And I have tested nearly all error paths in the WL worker. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
OpenPOWER on IntegriCloud