Commit graph

190879 commits

Author SHA1 Message Date
Kevin Cernekee
b60b08b02c mtd: nand: support alternate BB marker locations on MLC
This is a slightly modified version of a patch submitted last year by
Reuben Dowle <reuben.dowle@navico.com>.  His original comments follow:

This patch adds support for some MLC NAND flashes that place the BB
marker in the LAST page of the bad block rather than the FIRST page used
for SLC NAND and other types of MLC nand.

Lifted from Samsung datasheet for K9LG8G08U0A (1Gbyte MLC NAND):
"
Identifying Initial Invalid Block(s)
All device locations are erased(FFh) except locations where the initial
invalid block(s) information is written prior to shipping. The initial
invalid block(s) status is defined by the 1st byte in the spare area.
Samsung makes sure that the last page of every initial invalid block has
non-FFh data at the column address of 2,048.
...
"

As far as I can tell, this is the same for all Samsung MLC nand, and in
fact the samsung bsp for the processor used in our project (s3c6410)
actually contained a hack similar to this patch but less portable to
enable use of their NAND parts. I discovered this problem when trying to
use a Micron NAND which does not used this layout - I wish samsung would
put their stuff in main-line to avoid this type of problem.

Currently this patch causes all MLC nand with manufacturer codes from
Samsung and ST(Numonyx) to use this alternative location, since these
are the manufactures that I know of that use this layout.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:56:12 +01:00
Kevin Cernekee
426c457a32 mtd: nand: extend NAND flash detection to new MLC chips
Some of the newer MLC devices have a 6-byte ID sequence in which
several field definitions differ from older chips in a manner that is
not backward compatible.  For instance:

Samsung K9GAG08U0M (5-byte sequence): ec d5 14 b6 74
4th byte, bits 1:0 encode the page size: 0=1KiB, 1=2KiB, 2=4KiB, 3=8KiB
4th byte, bits 5:4 encode the block size: 0=64KiB, 1=128KiB, ...
4th byte, bit 6 encodes the OOB size: 0=8B/512B, 1=16B/512B

Samsung K9GAG08U0D (6-byte sequence): ec d5 94 29 34 41
4th byte, bits 1:0 encode the page size: 0=2KiB, 1=4KiB, 3=8KiB, 4=rsvd
4th byte, bits 7;5:4 encode the block size: 0=128KiB, 1=256KiB, ...
4th byte, bits 6;3:2 encode the OOB size: 1=128B/page, 2=218B/page

This patch uses the new 6-byte scheme if the following conditions are
all true:

1) The ID code wraps around after exactly 6 bytes

2) Manufacturer is Samsung

3) 6th byte is zero

The patch also extends the maximum OOB size from 128B to 256B.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:54:44 +01:00
Kevin Cernekee
9ea5973883 mtd: suppress warnings in inline_map_read()
With gcc 4.4.3 -O2 on MIPS32:

drivers/mtd/chips/cfi_util.c: In function 'cfi_qry_present':
include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
include/linux/mtd/map.h:375: note: 'r' was declared here
include/linux/mtd/map.h:390: warning: 'r' may be used uninitialized in this function
include/linux/mtd/map.h:375: note: 'r' was declared here

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:52:55 +01:00
Kevin Cernekee
709c4efb68 mtd: map.h: add missing bug.h include
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:52:32 +01:00
H Hartley Sweeten
0ffe0ce36e mtd: sst25l: fix multi-part messages with broken spi masters
Some SPI masters (ep93xx) have limitations when using the SFRMOUT
signal for the spi device chip select.  The SFRMOUT signal is
only asserted as long as the spi transmit fifo contains data.  As
soon as the last bit is clocked into the receive fifo it gets
deasserted.

The functions sst25l_status and sst25l_match_device use the API
function spi_write_then_read to write a command to the flash then
read the response back.  This API function creates a two part spi
message for the write then read.  When this message is transferred
the SFRMOUT signal ends up getting deasserted after the command
phase.  This causes the command to get aborted by the device so
the read phase returns invalid data.

By changing sst25l_status and sst25l_match_device to use a single
transfer synchronous message, the SFRMOUT signal stays asserted
during the entire message so the correct data always gets returned.

This change will have no effect on SPI masters which use a chip
select mechanism (GPIO's, etc.) which does stay asserted correctly.
As a bonus, the single transfer synchronous messages complete faster
than multi-part messages.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:52:24 +01:00
Kyungmin Park
46f3e88bd9 mtd: add Samsung SoC OneNAND driver
This patch adds a driver for OneNAND controller on Samsung SoCs.
Following SoCs are supported: S3C6400, S3C6410, S5PC100 and S5PC110.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:51:20 +01:00
Kyungmin Park
c37cb56fb1 mtd: onenand: add workaround for SYNC_WRITE mode
Some chips fails to identify properly when SYNC_WRITE mode is enabled
(the example is OneNAND on S5PC110 SoC). This patch adds a workaround
for such chips.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:50:21 +01:00
Kyungmin Park
3328dc3159 mtd: onenand: add new callback for bufferram read
This patch adds a new callback for the underlying drivers, which is
called instead of accessing the buffer ram directly. This callback will
be used by Samsung OneNAND driver to implement DMA transfers on S5PC110
SoC.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:50:04 +01:00
Kyungmin Park
4a8ce0b030 mtd: onenand: allocate verify buffer in the core
This patch extends OneNAND core code with support for OneNAND verify
write check. This is done by allocating the buffer for verify read
directly from the core code.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:49:48 +01:00
Kyungmin Park
6a88c47bd5 mtd: onenand: add support for chips with 4KiB page size
This patch adds support for OneNAND chips that have 4KiB page size.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:49:21 +01:00
Artem Bityutskiy
7d84b6273c mtd: jedec_probe: remove spaces before tabs
Nothing very important, this just makes git am stop producing warnings.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:49:03 +01:00
Wolfram Sang
ae73182229 mtd: chips: use common manufacturer codes in jedec_probe()
Factor out old manufacturers and use the generic ones from cfi.h

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:48:58 +01:00
Guillaume LECERF
087444da61 mtd: cfi_util: do not printk if no extended query table
Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:39:55 +01:00
Guillaume LECERF
5a0563f0ad mtd: cfi_cmdset_0002: add CFI detection for SST 39VF{32, 64}xxB chips
This patch adds support for detecting SST 39VF32xxB and 39VF64xxB
chips in CFI mode.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:39:43 +01:00
Guillaume LECERF
83dcd3bb11 mtd: cfi_cmdset_0002: add CFI detection for SST 39VF{16, 32}xx chips
SST 39VF{16,32}xx chips use the 0x0701 command set, fully compatible
with the AMD one. This patch adds support for detecting them in CFI
mode.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:39:23 +01:00
David Woodhouse
412da2f6e0 mtd: cfi_cmdset_0002: Tone down warning messages about TopBottom CFI field
Accept values of 2-5 for TopBottom, where the newly-added 4 and 5 values
mean a uniform layout. It does indicate WP layout but we don't handle that.

Also don't say "broken" when swapping erase regions in a top-boot chip.
That got retrospectively documented in the spec.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:39:20 +01:00
Guillaume LECERF
564b84978d mtd: cfi_cmdset_0002: do not fail on no extended query table as they are both optional
After looking at AMD's CFI specification [1], both of the extended query
tables are optional. Thus, it looks like relying that at least one of
those tables exist is a bug in cfi_cmdset_0002.

This patch inverts the logic and checks for unlock function pointers before
exiting on error. This approach leaves place to add a call to a fixup
function to try to handle chips compatible with the early AMD specification
from 1995 [2].

[1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf
[2] http://noel.feld.cvut.cz/hw/amd/20158a.pdf

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:33:27 +01:00
Guillaume LECERF
5859886122 mtd: cfi_probe: use P_ID_* definitions instead of hardcoded values
Use P_ID_* definitions already in include/linux/mtd/cfi.h instead of the
hardcoded values. Make the code more readable.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:08:19 +01:00
Guillaume LECERF
54b93a49d8 mtd: cfi_probe: add support for SST 0x0701 vendorname
SST 39VF160x and 39VF320x chips use vendorname id 0x0701 and alternative
unlock addresses. Add support for them in cfi_probe.c.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:08:11 +01:00
Guillaume LECERF
ad7026fef6 mtd: cfi_probe: make the addresses used to enter Auto Select Mode variable
Make the addresses used to enter Auto Select Mode variable to leave place
for handling chips using non-standard addresses.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:07:49 +01:00
Guillaume LECERF
8473044d64 mtd: cfi_probe: enter Auto Select Mode after filling cfi->cfiq members
Move the code to enter Auto Select Mode down to be able to use cfi->cfiq
members to add support for chips using alternative sequence / unlock
addresses.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:07:42 +01:00
Ben Dooks
010937ec9a mtd: kirkwood: allow machines to register RnB callback
Add a kirkwood_nand_init_rnb() call to allow boards which
have RnB line detection to register this instead of a
static delay.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:04:34 +01:00
Ben Dooks
eedfea2526 mtd: orion/kirkwood: add RnB line support to orion mtd driver
Add support for a board to register a callback to get the state of the
RnB line if it has it attached.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:04:19 +01:00
Maxim Levitsky
c3611570dd mtd: sm_common: split smartmedia and xD table
2GB xD card, and 4MB SmartMedia ROM card share same ID, so to make both work
split xD and smartmedia ID tables.

Hardware driver must be able to know which type it handles (and probably just one).

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:03:46 +01:00
Ivo Clarysse
a47bfd2eb6 mtd: mxc_nand: support i.MX21
On i.MX21 SoCs, if the NFC_CONFIG1:NFC_INT_MASK bit is set,
NFC_CONFIG2:NFC_INT always reads out zero, even if an
operation is completed.  This patch uses enable_irq and
disable_irq_nosync instead of NFC_CONFIG1:NFC_INT_MASK to
mask NFC interrupts.  This allows NFC_CONFIG2:NFC_INT to also
be used to detect operation completion on i.MX21.

The i.MX21 NFC does not signal reset completion using
NFC_CONFIG1:NFC_INT_MASK, so instead reset completion is
tested by checking if NFC_CONFIG2 becomes 0.

Signed-off-by: Ivo Clarysse <ivo.clarysse@gmail.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:02:53 +01:00
Ivo Clarysse
d484018056 mtd: mxc_nand: set NFC registers after reset
This patch allows the mxc_nand driver to reset the NAND
flash controller.  NFC registers are (re-)set after
completion of the reset, as a reset will have reverted
the NFC registers to their default values.

Signed-off-by: Ivo Clarysse <ivo.clarysse@gmail.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 01:02:32 +01:00
Jason Gunthorpe
9d5da3a9b8 mtd: extend physmap_of to let the device tree specify the parition probe
This is to support custom partitioning schemes for embedded PPC. To use
define your own mtd_part_parser and then add something like:
   linux,part-probe = "my_probe", "cmdlinepart";
To the board's dts file.

If linux,part-probe is not specified then this behaves the same as before.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14 00:32:30 +01:00
Julia Lawall
2bfefa4c96 drivers/mtd: Use kzalloc
Use kzalloc rather than the combination of kmalloc and memset.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
 if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-13 21:23:06 +01:00
Julia Lawall
ecce2a6f9b drivers/mtd/nand: Use kzalloc
Use kzalloc rather than the combination of kmalloc and memset.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
 if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-13 21:21:38 +01:00
David Woodhouse
aadff49c56 mtd/nand: Fix denali build on ppc64
drivers/mtd/nand/denali.c:1427: error: conflicting types for ‘enable_dma’
arch/powerpc/include/asm/dma.h:189: note: previous definition of ‘enable_dma’ was here

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-13 16:12:45 +01:00
Jason Roberts
ce082596ae mtd/nand: Add Intel Moorestown/Denali NAND support
There is more work to be done on this but it is basically working now.

Signed-off-by: Jason Roberts <jason.e.roberts@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-13 16:12:16 +01:00
Peter Huewe
1cd2620ca9 mtd/nand/sh_flctl: Move function mtd_to_flctl to fix build failure
This patch fixes a build failure[1] by simply moving the function mtd_to_flctl
beneath the definition of sh_flctl which it uses.

BF introduced by patch
'mtd/nand/sh_flctl: Replace the dangerous mtd_to_flctl macro' (67026418)

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-12 23:24:23 +01:00
David Woodhouse
0ae28a35bc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
	drivers/mtd/mtdcore.c

Pull in the bdi fixes and ARM platform changes that other outstanding
patches depend on.
2010-05-10 14:32:46 +01:00
Steve Deiters
6f1f3d0ab5 mtd: mpc5121_nfc: Changed SVR check to allow MPC5123.
The revision in SVR for MPC5123 is 3.  The NFC is the same as MPC5121
revision 2.

Signed-off-by: Steve Deiters <SteveDeiters@basler.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:27:16 +01:00
H Hartley Sweeten
29da3380de mtd: sst25l: remove unnecessary MTD_DEBUG_LEVEL2 messages
All the SST25L series flash parts have uniform erase sectors.  Remove
the extra MTD_DEBUG_LEVEL2 messages showing the eraseregions info
since they could never be shown.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:27:08 +01:00
Kevin Cernekee
eafe1311aa mtd: cfi_cmdset_0002: Add reboot notifier for AMD flashes
Ensure that the flash device is in a quiescent state before rebooting.
The implementation is closely modeled after the cfi_cmdset_0001 reboot
notifier, commit 963a6fb0a0 .

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:25:12 +01:00
Marc Kleine-Budde
bff3c10d36 mtd: pxa32xx_nand: add support for partition table parsing
The pxa32xx_nand driver doesn't support partition tables from the
command line. This patch adds support for it.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:23:43 +01:00
Huang Weiyi
1dd2a092af mtd/nand/bcm_umi: remove unused #include <linux/version.h>
Remove unused #include <linux/version.h>('s) in
  drivers/mtd/nand/bcm_umi_nand.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Acked-by: Leo Chen <leochen@broadcom.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:23:13 +01:00
Julia Lawall
258006d1ab mtd: maps: Eliminate use after free
Moved the debugging message before the call to map_destroy, which frees its
argument.  The message is also slightly changed to reflect its new
position.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E,E2;
@@

del_mtd_device(E)
...
(
  E = E2
|
* E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:22:55 +01:00
Stefani Seibold
c4e773764c mtd: fix a huge latency problem in the MTD CFI and LPDDR flash drivers.
The use of a memcpy() during a spinlock operation will cause very long
thread context switch delays if the flash chip bandwidth is low and the
data to be copied large, because a spinlock will disable preemption.

For example: A flash with 6,5 MB/s bandwidth will cause under ubifs,
which request sometimes 128 KiB (the flash erase size), a preemption delay of
20 milliseconds. High priority threads will not be served during this
time, regardless whether this threads access the flash or not. This behavior
breaks real time.

The patch changes all the use of spin_lock operations for xxxx->mutex
into mutex operations, which is exact what the name says and means.

I have checked the code of the drivers and there is no use of atomic
pathes like interrupt or timers. The mtdoops facility will also not be used
by this drivers. So it is dave to replace the spin_lock against mutex.

There is no performance regression since the mutex is normally not
acquired.

Changelog:
 06.03.2010 First release
 26.03.2010 Fix mutex[1] issue and tested it for compile failure

Signed-off-by: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:22:30 +01:00
Ferenc Wagner
67026418f5 mtd/nand/sh_flctl: Replace the dangerous mtd_to_flctl macro
The original macro worked only when applied to variables named 'mtd'.
While this could have been fixed by simply renaming the macro argument,
a more type-safe replacement is preferred.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:22:19 +01:00
Ferenc Wagner
b92b5c41a0 mtd/nand/fsl_upm: Replace the dangerous to_fsl_upm_nand macro
The original macro worked only when applied to variables named 'mtd'.
While this could have been fixed by simply renaming the macro argument,
a more type-safe replacement is preferred.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:18:28 +01:00
Mika Westerberg
4a70b7d395 mtd: OneNAND: OMAP2/3: unmap correct DMA buffer
Functions omap2_onenand_write_bufferram() and omap3_onenand_write_bufferram()
map the write buffer and store the returned handle in variable dma_src. However,
when DMA unmap is done, variable dma_dst is used instead of the correct dma_src.

This patch fixes them to use the correct DMA buffer.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Tested-by: Arnaud Ebalard <arno@natisbad.org>
Acked-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>
2010-05-10 14:17:05 +01:00
Mike Frysinger
ac39ee304a mtd: Blackfin NFC: localize MMR bit masks
Convert all magic numbers into appropriate defines, and move the defines
out of the global namespace and into this one driver.  No other driver
needs to care about the MMR layout anyways.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:16:43 +01:00
Ferenc Wagner
dad9431890 mtd: kconfig: remove stray endchoice from help text
Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:12:17 +01:00
Artem Bityutskiy
0bfa4df2b6 mtd: nandsim: make some structures anonymous
We do not need these names. Moreover, there are spelling typos
there: "nansin" instead of "nandsim".

This patch is just a clean up, no functional changes.

Reported-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:12:06 +01:00
Andrea Gelmini
0a382a74b6 mtd: mtdram.h: checkpatch cleanup
include/linux/mtd/mtdram.h:6: ERROR: code indent should use tabs where possible

Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-10 14:11:30 +01:00
Linus Torvalds
b57f95a382 Linux 2.6.34-rc7 2010-05-09 18:36:28 -07:00
Linus Torvalds
93cb463141 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 I/O error
  [SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error
  [SCSI] scsi_debug: virtual_gb ignores sector_size
  [SCSI] libiscsi: regression: fix header digest errors
  [SCSI] fix locking around blk_abort_request()
  [SCSI] advansys: fix narrow board error path
2010-05-09 18:35:53 -07:00
Arjan van de Ven
1c6fe0364f cpuidle: Fix incorrect optimization
commit 672917dcc7 ("cpuidle: menu governor: reduce latency on exit")
added an optimization, where the analysis on the past idle period moved
from the end of idle, to the beginning of the new idle.

Unfortunately, this optimization had a bug where it zeroed one key
variable for new use, that is needed for the analysis.  The fix is
simple, zero the variable after doing the work from the previous idle.

During the audit of the code that found this issue, another issue was
also found; the ->measured_us data structure member is never set, a
local variable is always used instead.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Corrado Zoccolo <czoccolo@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-09 18:35:36 -07:00