Commit Graph

1443 Commits (63e35b25d6b5c3136d22ef249dbbf96716aa08bf)

Author SHA1 Message Date
Artem Bityutskiy f429b2ea8e UBI: add ioctl compatibility
UBI ioctl's do not work when running 64-bit kernel and 32-bit
user-land. Fix this by adding the compat_ioctl method.

Also, UBI serializes all ioctls, so more than one ioctl at a time
is not a problem. Amd UBI does not seem to depend on anything else,
so use unlocked_ioctl instead of ioctl (no BKL needed).

Reported-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
2009-01-18 14:27:41 +02:00
Jan Engelhardt 4d187a88d3 UBI: constify file operations
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-01-18 14:02:08 +02:00
Artem Bityutskiy ade44ce07c UBI: allow all ioctls
Some ioctl's in UBI are enabled only when debugging is switched
on. There is not particular reason for this, just noone needed
them. However, some people need the now for their user-space
development. Thus, allow these ioctl's even if UBI debugging
is disabled.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-01-18 14:02:08 +02:00
Artem Bityutskiy 573135b5db UBI: remove unnecessry header inclusion
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-01-18 14:02:08 +02:00
Corentin Chary a27ce8f55d UBI: add ioctl for is_mapped operation
This patch adds ioctl to check if an LEB is mapped or not (as a
debugging option so far).

[Re-named ioctl to make it look the same as the other one and made
 some minor stylistic changes. Artem Bityutskiy.]

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-01-18 14:02:08 +02:00
Corentin Chary c3da23be16 UBI: add ioctl for unmap operation
This patch adds ioctl for the LEB unmap operation (as a debugging
option so far).

[Re-named ioctl to make it look the same as the other one and made
 some minor stylistic changes. Artem Bityutskiy.]

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-01-18 14:02:08 +02:00
Corentin Chary 141e6ebd1b UBI: add ioctl for map operation
This patch adds ioctl for the LEB map operation (as a debugging
option so far).

[Re-named ioctl to make it look the same as the other one and made
 some minor stylistic changes. Artem Bityutskiy.]

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-01-18 14:02:08 +02:00
Jarkko Nikula 73069e388d ARM: OMAP: Fix gpio by switching to generic gpio calls, v2
Fix compile by removing remaining omap specific gpio
calls. Based on earlier patches by Jarkko Nikula.

Also remove old GPIO key code, there is already a patch
to do this with gpio_keys.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-15 13:09:52 +02:00
Alan Cox 5f877607cd [MTD] map_rom has NULL erase pointer
Which means if inftl or similar are loaded with it (which is a dumb thing
to do admittedly) it may oops.

Closes #8108

[dwmw2: change error to -EROFS to match write-protected flash]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-11 19:56:46 +00:00
Alexey Korolev 57c1a24ee2 [MTD] [LPDDR] qinfo_probe depends on lpddr
Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-11 10:42:32 +00:00
Linus Torvalds 7c51d57e9d Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (67 commits)
  [MTD] [MAPS] Fix printk format warning in nettel.c
  [MTD] [NAND] add cmdline parsing (mtdparts=) support to cafe_nand
  [MTD] CFI: remove major/minor version check for command set 0x0002
  [MTD] [NAND] ndfc driver
  [MTD] [TESTS] Fix some size_t printk format warnings
  [MTD] LPDDR Makefile and KConfig
  [MTD] LPDDR extended physmap driver to support LPDDR flash
  [MTD] LPDDR added new pfow_base parameter
  [MTD] LPDDR Command set driver
  [MTD] LPDDR PFOW definition
  [MTD] LPDDR QINFO records definitions
  [MTD] LPDDR qinfo probing.
  [MTD] [NAND] pxa3xx: convert from ns to clock ticks more accurately
  [MTD] [NAND] pxa3xx: fix non-page-aligned reads
  [MTD] [NAND] fix nandsim sched.h references
  [MTD] [NAND] alauda: use USB API functions rather than constants
  [MTD] struct device - replace bus_id with dev_name(), dev_set_name()
  [MTD] fix m25p80 64-bit divisions
  [MTD] fix dataflash 64-bit divisions
  [MTD] [NAND] Set the fsl elbc ECCM according the settings in bootloader.
  ...

Fixed up trivial debug conflicts in drivers/mtd/devices/{m25p80.c,mtd_dataflash.c}
2009-01-09 12:37:15 -08:00
David Woodhouse 85795dac74 [MTD] [MAPS] Fix printk format warning in nettel.c
MTD size is 64-bit now...

Pointed out by Randy Dunlap <randy.dunlap@oracle.com>

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-09 14:17:50 +00:00
Philip Rakity 68874414de [MTD] [NAND] add cmdline parsing (mtdparts=) support to cafe_nand
[dwmw2: updated and made to still register whole device first]
Signed-off-by: Philip Rakity <pakity@yahoo.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-09 12:27:13 +00:00
Wolfgang Grandegger fefae48bf8 [MTD] CFI: remove major/minor version check for command set 0x0002
The NOR Flash memory K8P2815UQB from Samsung uses the major version
number '0'. Add a quirk to cope with it.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-09 12:16:28 +00:00
Linus Torvalds 85da1fb545 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (53 commits)
  serial: Add driver for the Cell Network Processor serial port NWP device
  powerpc: enable dynamic ftrace
  powerpc/cell: Fix the prototype of create_vma_map()
  powerpc/mm: Make clear_fixmap() actually work
  powerpc/kdump: Use ppc_save_regs() in crash_setup_regs()
  powerpc: Export cacheable_memzero as its now used in a driver
  powerpc: Fix missing semicolons in mmu_decl.h
  powerpc/pasemi: local_irq_save uses an unsigned long
  powerpc/cell: Fix some u64 vs. long types
  powerpc/cell: Use correct types in beat files
  powerpc: Use correct type in prom_init.c
  powerpc: Remove unnecessary casts
  mtd/ps3vram: Use _PAGE_NO_CACHE in memory ioremap
  mtd/ps3vram: Use msleep in waits
  mtd/ps3vram: Use proper kernel types
  mtd/ps3vram: Cleanup ps3vram driver messages
  mtd/ps3vram: Remove ps3vram debug routines
  mtd/ps3vram: Add modalias support to the ps3vram driver
  mtd/ps3vram: Add ps3vram driver for accessing video RAM as MTD
  powerpc: Fix iseries drivers build failure without CONFIG_VIOPATH
  ...
2009-01-08 09:10:16 -08:00
Coly Li 73ac36ea14 fix similar typos to successfull
When I review ocfs2 code, find there are 2 typos to "successfull".  After
doing grep "successfull " in kernel tree, 22 typos found totally -- great
minds always think alike :)

This patch fixes all the similar typos. Thanks for Randy's ack and comments.

Signed-off-by: Coly Li <coyli@suse.de>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Roland Dreier <rolandd@cisco.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:15 -08:00
Geoff Levand 2efd72af0f mtd/ps3vram: Use _PAGE_NO_CACHE in memory ioremap
Use _PAGE_NO_CACHE for gpu memory ioremap.  Also,
add __iomem attribute to gpu memory pointer and
change use of memset() to memset_io().

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand 60c0c5987b mtd/ps3vram: Use msleep in waits
Replace the use of udelay() with msleep() in the looping wait routines
ps3vram_notifier_wait() and ps3vram_wait_ring().

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand 993e62e674 mtd/ps3vram: Use proper kernel types
Replace the use of stdint.h types with kernel types
in the ps3vram driver.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand f259d74e03 mtd/ps3vram: Cleanup ps3vram driver messages
Cleanup the ps3vram driver messages.  Add a new struct device pointer
variable dev to struct ps3vram_priv and use dev_dbg(), pr_dbg(), etc.
where appropriate.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:15 +11:00
Geoff Levand e7dd54cf17 mtd/ps3vram: Remove ps3vram debug routines
Remove the ps3vram debug routines ps3vram_dump_ring() and
ps3vram_dump_reports().  These routines are not needed.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:14 +11:00
Geert Uytterhoeven 0a2d15b928 mtd/ps3vram: Add modalias support to the ps3vram driver
Update ps3vram driver to use the new ps3 three id modalias support.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:14 +11:00
Jim Paris cffb4add03 mtd/ps3vram: Add ps3vram driver for accessing video RAM as MTD
Add ps3vram driver, which exposes unused video RAM on the PS3 as a MTD
device suitable for storage or swap.  Fast data transfer is achieved
using a local cache in system RAM and DMA transfers via the GPU.

Signed-off-by: Vivien Chappelier <vivien.chappelier@free.fr>
Signed-off-by: Jim Paris <jim@jtan.com>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-08 16:25:14 +11:00
Linus Torvalds 57c44c5f6f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (24 commits)
  trivial: chack -> check typo fix in main Makefile
  trivial: Add a space (and a comma) to a printk in 8250 driver
  trivial: Fix misspelling of "firmware" in docs for ncr53c8xx/sym53c8xx
  trivial: Fix misspelling of "firmware" in powerpc Makefile
  trivial: Fix misspelling of "firmware" in usb.c
  trivial: Fix misspelling of "firmware" in qla1280.c
  trivial: Fix misspelling of "firmware" in a100u2w.c
  trivial: Fix misspelling of "firmware" in megaraid.c
  trivial: Fix misspelling of "firmware" in ql4_mbx.c
  trivial: Fix misspelling of "firmware" in acpi_memhotplug.c
  trivial: Fix misspelling of "firmware" in ipw2100.c
  trivial: Fix misspelling of "firmware" in atmel.c
  trivial: Fix misspelled firmware in Kconfig
  trivial: fix an -> a typos in documentation and comments
  trivial: fix then -> than typos in comments and documentation
  trivial: update Jesper Juhl CREDITS entry with new email
  trivial: fix singal -> signal typo
  trivial: Fix incorrect use of "loose" in event.c
  trivial: printk: fix indentation of new_text_line declaration
  trivial: rtc-stk17ta8: fix sparse warning
  ...
2009-01-07 11:31:52 -08:00
Kay Sievers 475b44c199 mtd: struct device - replace bus_id with dev_name(), dev_set_name()
CC: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 10:44:38 -08:00
Frederik Schwarzer 025dfdafe7 trivial: fix then -> than typos in comments and documentation
- (better, more, bigger ...) then -> (...) than

Signed-off-by: Frederik Schwarzer <schwarzerf@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-06 11:28:06 +01:00
Sean MacLennan a808ad3b0d [MTD] [NAND] ndfc driver
The current ndfc driver only compiles under arch/ppc. This arch was
removed from the kernel. I notice the event entry for the ndfc in
Kconfig has been removed in 2.6.28.

This patch converts the ndfc to a proper OF (OpenFirmware) driver. I
can give a working example of the DTS if needed.

The patch has been in production use on the PIKA Warp Appliance and is
in use by others. The Warp basically boots from NAND, so the ndfc driver
is very important to us.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
Acked-By: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 16:42:44 +00:00
David Woodhouse 647b0d3854 [MTD] [TESTS] Fix some size_t printk format warnings
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 16:31:03 +00:00
David Woodhouse 572acc4127 Merge branch 'master' of git://git.infradead.org/users/dedekind/mtd-tests-2.6
Conflicts:
	drivers/mtd/Makefile
2009-01-05 16:24:55 +00:00
Alexey Korolev 60f26520e7 [MTD] LPDDR Makefile and KConfig
We have two components to manage LPDDR flash memories in Linux.
1. It is a driver for chip probing and reading its capabilities
2. It is a device operations driver.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 13:58:47 +01:00
Alexey Korolev d81408304b [MTD] LPDDR extended physmap driver to support LPDDR flash
Physmap is a generic map driver for different platforms and flash types.
We added support of LPDDR to physmap.
All changes here are related to introduction of new pfow_base parameter.
This parameter is valid in case of LPDDR chips only.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 13:57:28 +01:00
Alexey Korolev c68264711c [MTD] LPDDR Command set driver
Driver which handles device command operation.
Details on device operations are available here:
http://www.numonyx.com/Documents/Datasheets/DS-315768_Velocity-Discrete.pdf

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 13:56:04 +01:00
Alexey Korolev 8dc004395d [MTD] LPDDR qinfo probing.
LPDDR flash chips are based on completely new kind of chips probing.
Device capabilities are available via special request.
We sent field request command which contains Major and Minor numbers - and
recieve corresponend value.
All requests are performed within PFOW window.
Detailed information about qinfo records can be found here:
http://www.numonyx.com/Documents/Datasheets/DS-315768_Velocity-Discrete.pdf

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 13:55:48 +01:00
Matt Reimer 5b0d4d7c8a [MTD] [NAND] pxa3xx: convert from ns to clock ticks more accurately
The various fields in NDTR{01} are in units of clock ticks minus one, but the
ns2cycle macro mistakenly adds one, inflating the number of clock ticks and
making it impossible to set any of these fields to zero.

Signed-off-by: Matt Reimer <mreimer@vpop.net>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 13:03:20 +01:00
Matt Reimer 7f9938d0fd [MTD] [NAND] pxa3xx: fix non-page-aligned reads
Reads from non-page-aligned addresses were broken because while the
address to read from was correctly written to NDCB*, a full page was
always read. Fix this by ignoring the column and only using the page
address.

I suspect this whole-page behavior is due to the controller's need to
read the entire page in order to generate correct ECC. In the non-ECC
case this could be optimized to use the column address, and to set the
read length to what is being requested rather than the length of an
entire page.

Signed-off-by: Matt Reimer <mreimer@vpop.net>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 13:02:42 +01:00
Randy Dunlap a5cce42f35 [MTD] [NAND] fix nandsim sched.h references
Fix sched.h references:

build-r7149.out:/local/linsrc/linux-next-20081215/drivers/mtd/nand/nandsim.c:1326: error: dereferencing pointer to incomplete type
build-r7149.out:/local/linsrc/linux-next-20081215/drivers/mtd/nand/nandsim.c:1326: error: 'PF_MEMALLOC' undeclared (first use in this function)
build-r7149.out:/local/linsrc/linux-next-20081215/drivers/mtd/nand/nandsim.c:1328: error: dereferencing pointer to incomplete type
build-r7149.out:/local/linsrc/linux-next-20081215/drivers/mtd/nand/nandsim.c:1335: error: dereferencing pointer to incomplete type
build-r7149.out:/local/linsrc/linux-next-20081215/drivers/mtd/nand/nandsim.c:1335: error: 'PF_MEMALLOC' undeclared (first use in this function)
build-r7149.out:make[4]: *** [drivers/mtd/nand/nandsim.o] Error 1

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 12:59:32 +01:00
Julia Lawall 232ed5e68a [MTD] [NAND] alauda: use USB API functions rather than constants
This set of patches introduces calls to the following set of functions:

usb_endpoint_dir_in(epd)
usb_endpoint_dir_out(epd)
usb_endpoint_is_bulk_in(epd)
usb_endpoint_is_bulk_out(epd)
usb_endpoint_is_int_in(epd)
usb_endpoint_is_int_out(epd)
usb_endpoint_num(epd)
usb_endpoint_type(epd)
usb_endpoint_xfer_bulk(epd)
usb_endpoint_xfer_control(epd)
usb_endpoint_xfer_int(epd)
usb_endpoint_xfer_isoc(epd)

In some cases, introducing one of these functions is not possible, and it
just replaces an explicit integer value by one of the following constants:

USB_ENDPOINT_XFER_BULK
USB_ENDPOINT_XFER_CONTROL
USB_ENDPOINT_XFER_INT
USB_ENDPOINT_XFER_ISOC

An extract of the semantic patch that makes these changes is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r1@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ usb_endpoint_xfer_control(epd)

@r5@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)

@inc@
@@

#include <linux/usb.h>

@depends on !inc && (r1||r5)@
@@

+ #include <linux/usb.h>
  #include <linux/usb/...>
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-01-05 12:59:02 +01:00
David Woodhouse 353816f43d Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
	arch/arm/mach-pxa/corgi.c
	arch/arm/mach-pxa/poodle.c
	arch/arm/mach-pxa/spitz.c
2009-01-05 10:50:33 +01:00
Linus Torvalds 574c3fdae3 Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6
* 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6:
  UBI: fix checkpatch.pl warnings
  UBI: simplify PEB protection code
  UBI: prepare for protection tree improvements
  UBI: return -ENOMEM upon failing vmalloc
  UBI: document UBI ioctls
  UBI: handle write errors in WL worker
  UBI: fix error path
  UBI: some code re-structuring
  UBI: fix deadlock
  UBI: fix warnings when debugging is enabled
2009-01-02 15:57:26 -08:00
Artem Bityutskiy f2863c54f3 UBI: fix checkpatch.pl warnings
Just minor indentation and "over 80 characters" fixes.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-28 12:20:51 +02:00
Kay Sievers 160bbab300 [MTD] struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-23 10:00:14 +00:00
Artem Bityutskiy d85316ac45 [MTD] fix m25p80 64-bit divisions
MTD has recently been upgraded for 64-bit support, see commit
number 69423d99fc in the
mtd-2.6.git tree (git://git.infradead.org/mtd-2.6.git)
or see this URL:
http://git.infradead.org/mtd-2.6.git?a=commit;h=69423d99fc182a81f3c5db3eb5c140acc6fc64be

Some variables in MTD data structures which were 32-bit
became 64-bit. Namely, the 'size' field in 'struct mtd_info'
and the 'addr'/'len' fields in 'struct erase_info'. This
means we have to use 'do_div' to divide them.

This patch fixes the following linking error:
ERROR: "__umoddi3" [drivers/mtd/devices/m25p80.ko] undefined!

This patch changes divisions of 64-bit variable so that they use
'do_div'. This patch also change some print placeholders to
get rid of gcc warnings.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-19 16:23:35 +00:00
Artem Bityutskiy 5b7f3a500c [MTD] fix dataflash 64-bit divisions
MTD has recently been upgraded for 64-bit support, see commit
number 69423d99fc in the
mtd-2.6.git tree (git://git.infradead.org/mtd-2.6.git)
or see this URL:
http://git.infradead.org/mtd-2.6.git?a=commit;h=69423d99fc182a81f3c5db3eb5c140acc6fc64be

Some variables in MTD data structures which were 32-bit
became 64-bit. Namely, the 'size' field in 'struct mtd_info'
and the 'addr'/'len' fields in 'struct erase_info'. This
means we have to use 'do_div' to divide them.

This patch fixes the following linking error:
ERROR: "__udivdi3" [drivers/mtd/devices/mtd_dataflash.ko] undefined!
ERROR: "__umoddi3" [drivers/mtd/devices/mtd_dataflash.ko] undefined!

This patch changes divisions of 64-bit variable so that they use
'do_div'. This patch also change some print placeholders to
get rid of gcc warnings.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Nicolas Pitre <nico@cam.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-19 16:23:18 +00:00
Sascha Hauer cb96cf1ad6 [ARM] MX3: add NAND support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-12-16 14:58:02 +01:00
Xiaochuan-Xu 7b6c32daec UBI: simplify PEB protection code
UBI has 2 RB-trees to implement PEB protection, which is too
much for simply prevent PEB from being moved for some time.
This patch implements this using lists. The benefits:

1. No need to allocate protection entry on each PEB get.
2. No need to maintain balanced trees and walk them.

Signed-off-by: Xiaochuan-Xu <xiaochuan-xu@cqu.edu.cn>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-16 10:09:58 +02:00
Russell King 7e1548a597 Merge branch 'omap3-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel 2008-12-15 22:13:26 +00:00
Xiaochuan-Xu 23553b2c08 UBI: prepare for protection tree improvements
This patch modifies @struct ubi_wl_entry and adds union which
contains only one element so far. This is just a preparation
for further changes which will kill the protection tree and
make UBI use a list instead.

Signed-off-by: Xiaochuan-Xu <xiaochuan-xu@cqu.edu.cn>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-15 19:34:50 +02:00
Russell King 72aaf09fda Merge git://git.marvell.com/orion into devel 2008-12-13 09:12:51 +00:00
Russell King 70d13e083c [ARM] netwinder: clean up GPIO naming
Netwinder was using gpio_xxx names which could clash with the GPIO
layer.  Add a 'nw_' prefix to ensure that these remain separate.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-12-13 09:12:07 +00:00
David Brownell 15f74b0335 ARM: OMAP: use gpio_to_irq
Have most uses of OMAP_GPIO_IRQ() use gpio_to_irq() instead.
Calls used for table initialization are left alone, at least
this time around.

(This patch is for code in both the OMAP tree and mainline.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:26 -08:00
David Brownell 40e3925ba1 ARM: OMAP: switch to gpio_direction_input
More switchover to the cross-platform GPIO interface:
use gpio_direction_input(), not an OMAP-specific call.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:26 -08:00
David Brownell 0b84b5ca43 ARM: OMAP: switch to standard gpio get/set calls
This patch replaces some legacy OMAP GPIO calls with the "new" (not
really, any more!) calls that work on most platforms.

The calls addressed by this patch are the simple ones to get and set
values ... for code that's in mainline, including the implementations
of those calls.

Except for the declarations and definitions of those calls, all of
these changes were performed by a simple SED script.  Plus, a few
"if() set() else set()" branches were merged by hand.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:25 -08:00
Jason Jin 03ed107805 [MTD] [NAND] Set the fsl elbc ECCM according the settings in bootloader.
The ECCM maybe set in bootloader, Get ECCM settings from the bootloader,
can avoid the image written by bootloader cannot read out by kernel.

But the limitation of doing it this way is that, it could break large page
NAND if it is written with NAND disabled in u-boot and read with NAND
enabled, or vice versa.

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 16:44:28 +00:00
Randy Dunlap d3af0f048c [MTD] [NAND] remove excess kernel-doc notation
Delete extra kernel-doc notation for struct fields and function
parameters that don't exist:

Warning(include/linux/mtd/nand.h:428): Excess struct/union/enum/typedef member 'wq' description in 'nand_chip'
Warning(include/linux/mtd/nand.h:428): Excess struct/union/enum/typedef member 'datbuf' description in 'nand_chip'
Warning(include/linux/mtd/nand.h:428): Excess struct/union/enum/typedef member 'oobbuf' description in 'nand_chip'
Warning(include/linux/mtd/nand.h:428): Excess struct/union/enum/typedef member 'oobdirty' description in 'nand_chip'
Warning(include/linux/mtd/nand.h:428): Excess struct/union/enum/typedef member 'data_poi' description in 'nand_chip'
Warning(drivers/mtd/nand/nand_base.c:2527): Excess function parameter 'maxchips' description in 'nand_scan_tail'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 16:10:40 +00:00
Atsushi Nemoto 176bf2e0f1 [MTD] physmap: fix leak of memory returned by parse_mtd_partitions
The mtd partition parser returns an allocated pointer array of
mtd_partition.  The caller must free it.  The array is used only for
add_mtd_partitions(), so free it just after the call.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 16:10:27 +00:00
Julia Lawall 002f6aab43 [MTD] drivers/mtd/maps/nettel.c: use ARRAY_SIZE
ARRAY_SIZE is more concise to use when the size of an array is divided by
the size of its type or the size of its first element.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@i@
@@

#include <linux/kernel.h>

@depends on i using "paren.iso"@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 16:10:17 +00:00
Mike Frysinger dcb3e137ce [MTD] physmap: make physmap compat explicit
The current method for always showing physmap compat address, size, and
width is a bit confusing.  If length is set to 0, then the address and
width are still shown but silently unused.  The physmap code itself
already has logic which sets compat based on length, so just pull that out
and into the Kconfig to make everything clear.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Bryan Wu <Bryan.Wu@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 16:10:05 +00:00
David Woodhouse c4956ed6fa Merge branch 'misc/mtd/sharpsl-nand' of git://git.kernel.org/pub/scm/linux/kernel/git/lumag/tosa-2.6 2008-12-10 15:49:12 +00:00
Harvey Harrison c80a7b265f [MTD] remove private wrapper of endian helpers in rfd_ftl.c
Base versions handle constant folding just fine.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 15:39:09 +00:00
Artem Bityutskiy 9faa8153be MTD: add MTD tests to compilation
Add MTD tests to Kconfig and Makefiles.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-10 17:00:44 +02:00
Artem Bityutskiy 4db451a764 MTD: tests: add mtd_torturetest
This test is designed to work for very long time and it tries to
wear few eraseblocks.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-10 17:00:40 +02:00
David Woodhouse 26cdb67c74 [MTD] Remove more strange u_intxx_t types
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 14:08:56 +00:00
David Woodhouse 3854be7712 [MTD] Remove strange u_int32_t types from FTL
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 14:06:42 +00:00
David Woodhouse 0f07a0be39 [MTD] [NAND] Remove strange u_int64_t types from nandsim
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 14:01:46 +00:00
Adrian Hunter 69423d99fc [MTD] update internal API to support 64-bit device size
MTD internal API presently uses 32-bit values to represent
device size.  This patch updates them to 64-bits but leaves
the external API unchanged.  Extending the external API
is a separate issue for several reasons.  First, no one
needs it at the moment.  Secondly, whether the implementation
is done with IOCTLs, sysfs or both is still debated.  Thirdly
external API changes require the internal API to be accepted
first.

Note that although the MTD API will be able to support 64-bit
device sizes, existing drivers do not and are not required
to do so, although NAND base has been updated.

In general, changing from 32-bit to 64-bit values cause little
or no changes to the majority of the code with the following
exceptions:
    	- printk message formats
    	- division and modulus of 64-bit values
    	- NAND base support
	- 32-bit local variables used by mtdpart and mtdconcat
	- naughtily assuming one structure maps to another
	in MEMERASE ioctl

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:37:21 +00:00
Alexey Korolev 8a4c2495b1 MTD: nandsim: use less RAM
Nandsim consumes ~2x more RAM than the density of simulated device.
It becomes critical if we need to simulate 256MB NAND and run stress tests
on it.

We investigated the reasons. nandsim allocates space for pages using kmalloc
function. The size of LP nand page is 2112 bytes.
kmalloc gets space from slab pools by chunks 2^n. So if we need to kmalloc
2112 bytes, 4096 bytes will be consumed by system.
The best way to avoid this issue would be using kmem_cache allocations. AFAIK
this mechanism specially designed to handle cases when arrays of allocations
are used.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:35:23 +00:00
Adrian Hunter a9fc899188 MTD: nandsim: add option to use a file to cache pages
Add a new module parameter 'cache_file' which causes nandsim
to use that file instead of memory to cache nand data.
Using a file allows the simulation of NAND that is bigger
than the available memory.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:35:21 +00:00
Adrian Hunter 9359ea461b MTD: nandsim: suppress unnecessary warning
nand_base sometimes reads only 2 bytes of a 4 byte id.
It is OK.  Do not print a warning in that case.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:35:19 +00:00
Dmitri Vorobiev 4f8f3af20a [MTD] Make init_impa7 static
The function init_impa7 does not need to be global, and
this patch makes it static by adding the needed keyword
to drivers/mtd/maps/impa7.c.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:32 +00:00
Dmitri Vorobiev 9a2b3974ef [MTD] Make init_redwood_flash function static
The function init_redwood_flash is needlessly defined global,
make it static by this patch.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:29 +00:00
Dmitri Vorobiev 6127cfcd3d [MTD] Make init_msp_flash function static
The function init_msp_flash, which is not used outside of
drivers/mtd/maps/pmcmsp-flash.c, can become static. This
patch adds the needed keyword.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:26 +00:00
Dmitri Vorobiev 2257594f9c [MTD] Make h720x_mtd_init function static
The function h720x_mtd_init is not used outside of the file
drivers/mtd/maps/h720x-flash.c and can therefore become static.
This patch adds the necessary keyword.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:23 +00:00
Dmitri Vorobiev 9cdd52fa97 [MTD] Make init_mbx function static
The function init_mbx can become static, because it is not used
outside the file drivers/mtd/maps/mbx860.c. This patch adds the
needed keyword.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:20 +00:00
Dmitri Vorobiev 1aed165a60 [MTD] Make the function init_vmax301 static
The function init_vmax301 is needlessly defined global in
drivers/mtd/maps/vmax301.c, and this patch makes it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:17 +00:00
Dmitri Vorobiev e63b3f94b0 [MTD] Make init_fortunet function static
The symbol init_fortunet is needlessly defined global in
drivers/mtd/maps/fortunet.c. Make it static and clean up
the kernel global namespace.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:13 +00:00
Dmitri Vorobiev b93dc2e9fc [MTD] Make alchemy_mtd_init function static
The symbol alchemy_mtd_init does not need to be global, so make it
static in drivers/mtd/maps/alchemy-flash.c.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:10 +00:00
Dmitri Vorobiev 9bd1c9dac8 [MTD] Make ipaq_mtd_init function static
The symbol ipaq_mtd_init is not used anywhere outside of
drivers/mtd/maps/ipaq-flash.c, so make it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:06 +00:00
Dmitri Vorobiev baa0f0fc5f [MTD] Make init_dbox2_flash static
The symbol init_dbox2_flash is not used outside of the file
drivers/mtd/maps/dbox2-flash.c, so make it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:02 +00:00
Dmitri Vorobiev 2e257a2d6d [MTD] Make init_flagadm function static
The module init function init_flagadm does not need to be global,
so add the needed keyword to drivers/mtd/maps/cfi_flagadm.c.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:01:00 +00:00
Dmitri Vorobiev d849257c42 [MTD] Make init_oct5066 function static
The function init_oct5066 is needlessly defined global in
drivers/mtd/maps/octagon-5066.c. Make it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:56 +00:00
Dmitri Vorobiev d8156adb7a [MTD] Make the init_edb7312nor function static
The init_edb7312nor function is needlessly defined global in
drivers/mtd/maps/edb7312.c, and this patch makes it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:51 +00:00
Dmitri Vorobiev 8d240325b3 [MTD] Make init_sbc82xx_flash function static
The function init_sbc82xx_flash is needlessly defined global in
drivers/mtd/maps/wr_sbc82xx_flash.c, and this patch makes it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:47 +00:00
Dmitri Vorobiev bc185405c8 [MTD] Make init_rpxlite function static
The function init_rpxlite, which is not used outside of
drivers/mtd/maps/rpxlite.c, can become static. Add the
needed keyword.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:43 +00:00
Dmitri Vorobiev e30bb9cf5f [MTD] Make init_tqm_mtd function static
The init_tqm_mtd function does not need to be defined globally
in drivers/mtd/maps/tqm8xxl.c. Make it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:37 +00:00
Dmitri Vorobiev 769455e224 [MTD] Make uclinux_mtd_cleanup and uclinux_mtd_init static
The functions uclinux_mtd_cleanup and uclinux_mtd_init do
not heed to be global. Add the needed keyword to the file
drivers/mtd/maps/uclinux.c to make these functions static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:33 +00:00
Dmitri Vorobiev e4582ea71c [MTD] Make lart_flash_init, lart_flash_exit static
The symbols lart_flash_init, lart_flash_exit are needlessly
defined global in drivers/mtd/devices/lart.c, so make them
static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:26 +00:00
Dmitri Vorobiev 9ee49fa5c1 [MTD] Make init_sbc8240_mtd function static
The function init_sbc8240_mtd is not called from outside the
module drivers/mtd/maps/sbc8240.c where it is defined, so it
can become static. Add the needed keyword.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:23 +00:00
Dmitri Vorobiev 26eb108570 [MTD] Make init_sharpsl symbol static
The function init_sharpsl is needlessly defined global.
Make it static by adding the needed keyword to the file
drivers/mtd/maps/sharpsl-flash.c, where the function is
defined.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-12-10 13:00:11 +00:00
Stefan Roese ad5942bad6 UBI: return -ENOMEM upon failing vmalloc
Return with correct error code (-ENOMEM) from ubi_attach_mtd_dev() upon
failing vmalloc().

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-10 14:28:48 +02:00
Linus Torvalds 4d9c6a21be Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6:
  [MTD] [NAND] fix OOPS accessing flash operations over STM flash on PXA
  [MTD] [NAND] drivers/mtd/nand/pasemi_nand.c: Add missing pci_dev_put
  [MTD] [NAND] fsl_upm: fix build problem with 2.6.28-rc2
  [MTD] physmap: fix memory leak on physmap_flash_remove by using devres
  [MTD] m25p80: chip erase != block erase != sector erase
  [MTD] m25p80: fix detection of m25p16 flashes
  [MTD] m25p80: fix detection of SPI parts
  [MTD] [NAND] OMAP: OneNAND: header file relocation (part 2)
  [MTD] [NAND] OMAP: OneNAND: header file relocation
2008-12-09 08:28:36 -08:00
Artem Bityutskiy bf60862a58 MTD: tests: add mtd_subpagetest
This tests makes sure sub-pages on NAND MTD device work fine.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-08 13:56:14 +02:00
Artem Bityutskiy 7163cea15f MTD: tests: add mtd_stresstest
This test just performs random operations on random eraseblocks.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-08 13:56:14 +02:00
Artem Bityutskiy 72069be936 MTD: tests: add mtd_speedtest
This test examines I/O speed of the flash device.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-08 13:56:14 +02:00
Artem Bityutskiy 72091b6889 MTD: tests: add mtd_readtest
A simple tests which reads whole MTD device one page at a time.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-08 13:56:14 +02:00
Artem Bityutskiy e73f217439 MTD: tests: add mtd_pagetest
This test checks that NAND pages read/write work fine.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-08 13:56:14 +02:00
Artem Bityutskiy e3644da756 MTD: tests: add mtd_oobtest
This test checks that OOB of a NAND MTD device works fine.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-08 13:56:13 +02:00
Artem Bityutskiy 6fa6f5bbc3 UBI: handle write errors in WL worker
When a PEB is moved and a write error happens, UBI switches
to R/O mode, which is wrong, because we just copy the data
and may select a different PEB and re-try this. This patch
fixes WL worker's behavior.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-05 13:46:50 +02:00
Artem Bityutskiy 3c98b0a043 UBI: fix error path
Make sure the resources had not already been freed before
freeing them in the error path of the WL worker function.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-05 13:46:50 +02:00
Artem Bityutskiy 6a8f483f33 UBI: some code re-structuring
Minor code re-structuring and commentaries fixes to improve readability.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-05 13:46:49 +02:00
Artem Bityutskiy 4df581f3dc UBI: fix deadlock
We cannot call 'ubi_wl_get_peb()' with @ubi->buf_mutex locked,
because 'ubi_wl_get_peb()' may force erasure, which, in turn,
may call 'torture_peb()' which also locks the @ubi->buf_mutex
and deadlocks.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-05 13:46:49 +02:00