]> pilppa.com Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
18 years ago[MTD] NAND Cleanup oob functions
Thomas Gleixner [Thu, 25 May 2006 07:51:54 +0000 (09:51 +0200)]
[MTD] NAND Cleanup oob functions

Cleanup the code in the oob related functions and
make use of the new NO_READRDY flag.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND Introduce NAND_NO_READRDY option
Thomas Gleixner [Thu, 25 May 2006 07:50:16 +0000 (09:50 +0200)]
[MTD] NAND Introduce NAND_NO_READRDY option

The nand driver has a superflous read ready / command
delay in the read functions. This was added to handle
chips which have an automatic read forward. Newer
chips do not have this functionality anymore. Add this
option to avoid the delay / I/O operation. Mark all
large page chips with the new option flag.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND Initialize controller lock and wq only once
Thomas Gleixner [Thu, 25 May 2006 07:45:29 +0000 (09:45 +0200)]
[MTD] NAND Initialize controller lock and wq only once

The lock simplifying patch did not move the lock and waitqueue
initialization into the controller allocation patch.
This reinitializes waitqueue and spinlocks also for driver
supplied controller stuctures. Move it into the allocation path.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[JFFS2] Fix and improve debugging output during scan.
David Woodhouse [Thu, 25 May 2006 00:53:09 +0000 (01:53 +0100)]
[JFFS2] Fix and improve debugging output during scan.

Print wasted_size in scanned eraseblocks, print range correctly for
summary dirent and inode entries.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Add 'jeb' argument to jffs2_prealloc_raw_node_refs()
David Woodhouse [Thu, 25 May 2006 00:50:35 +0000 (01:50 +0100)]
[JFFS2] Add 'jeb' argument to jffs2_prealloc_raw_node_refs()

Preallocation of refs is shortly going to be a per-eraseblock thing,
rather than per-filesystem. Add the required argument to the function.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Correctly handle wasted space before summary node.
David Woodhouse [Thu, 25 May 2006 00:42:40 +0000 (01:42 +0100)]
[JFFS2] Correctly handle wasted space before summary node.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] jffs2_free_all_node_refs() doesn't free them all. Rename it.
David Woodhouse [Thu, 25 May 2006 00:38:27 +0000 (01:38 +0100)]
[JFFS2] jffs2_free_all_node_refs() doesn't free them all. Rename it.

... to jffs2_free_jeb_node_refs() since that's what it does.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Allocate node_ref for wasted space when skipping to page boundary
David Woodhouse [Thu, 25 May 2006 00:37:28 +0000 (01:37 +0100)]
[JFFS2] Allocate node_ref for wasted space when skipping to page boundary

One more place where we were changing the accounting info without
actually allocating a ref for the lost space...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] NAND fix cmd_ctrl breakage
Thomas Gleixner [Wed, 24 May 2006 20:57:09 +0000 (22:57 +0200)]
[MTD] NAND fix cmd_ctrl breakage

The cmd_ctrl rework lacks some state transition flags.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND coding style and namespace cleanup
Thomas Gleixner [Wed, 24 May 2006 10:07:37 +0000 (12:07 +0200)]
[MTD] NAND coding style and namespace cleanup

Cleanup the functions which are not going to change in the
next steps.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[JFFS2] Revert Artem's Bunkage in debug messages.
David Woodhouse [Wed, 24 May 2006 13:24:02 +0000 (14:24 +0100)]
[JFFS2] Revert Artem's Bunkage in debug messages.

Random unthinking 'cleanup' caused debug messages like this:
   Obsoleting node at 0x0006daf4 of len 0x3a4: <7>Dirtying

If messages are continuation of an existing line, they don't need
to be prefixed with KERN_DEBUG.

THINK. Or you will be replaced by a small shell script.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoMerge branch 'master' of git://git.infradead.org/~gleixner/mtd-nand-2.6.git
David Woodhouse [Wed, 24 May 2006 09:01:43 +0000 (10:01 +0100)]
Merge branch 'master' of git://git.infradead.org/~gleixner/mtd-nand-2.6.git

18 years ago[JFFS2] Introduce ref_next() macro for finding next physical node
David Woodhouse [Wed, 24 May 2006 08:04:17 +0000 (09:04 +0100)]
[JFFS2] Introduce ref_next() macro for finding next physical node

Another part of the preparation for switching to an array...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Reduce visibility of raw_node_ref to upper layers of JFFS2 code.
David Woodhouse [Wed, 24 May 2006 01:04:45 +0000 (02:04 +0100)]
[JFFS2] Reduce visibility of raw_node_ref to upper layers of JFFS2 code.

As the first step towards eliminating the ref->next_phys member and saving
memory by using an _array_ of struct jffs2_raw_node_ref per eraseblock,
stop the write functions from allocating their own refs; have them just
_reserve_ the appropriate number instead. Then jffs2_link_node_ref() can
just fill them in.

Use a linked list of pre-allocated refs in the superblock, for now. Once
we switch to an array, it'll just be a case of extending that array.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] NAND LED support cleanup
Thomas Gleixner [Tue, 23 May 2006 21:48:57 +0000 (23:48 +0200)]
[MTD] NAND LED support cleanup

Move the define out of the middle of the code and add an
appropriate comment.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND remove write_byte/word function from nand_chip
Thomas Gleixner [Tue, 23 May 2006 21:28:48 +0000 (23:28 +0200)]
[MTD] NAND remove write_byte/word function from nand_chip

The previous change of the command / hardware control allows to
remove the write_byte/word functions completely, as their only
user were nand_command and nand_command_lp.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Refactor NAND hwcontrol to cmd_ctrl
Thomas Gleixner [Tue, 23 May 2006 21:25:53 +0000 (23:25 +0200)]
[MTD] Refactor NAND hwcontrol to cmd_ctrl

The hwcontrol function enforced a step by step state machine
for any kind of hardware chip access. Let the hardware driver
know which control bits are set and inform it about a change
of the control lines. Let the hardware driver write out the
command and address bytes directly. This gives a peformance
advantage for address bus controlled chips and simplifies the
quirks in the hardware drivers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Export nand_write_raw
Thomas Gleixner [Tue, 23 May 2006 20:33:52 +0000 (22:33 +0200)]
[MTD] Export nand_write_raw

The previous _ecc removal / cleanup broke (i)nftl module usage.
Export the missing symbol.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Mark NAND drivers TOTO and PPChameleon broken
Thomas Gleixner [Tue, 23 May 2006 20:03:39 +0000 (22:03 +0200)]
[MTD] Mark NAND drivers TOTO and PPChameleon broken

Both drivers can not be fixed and compiled due to missing header files.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Remove read/write _ecc variants
Thomas Gleixner [Tue, 23 May 2006 15:21:03 +0000 (17:21 +0200)]
[MTD] Remove read/write _ecc variants

MTD clients are agnostic of FLASH which needs ECC suppport.
Remove the functions and fixup the callers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Remove readv/readv_ecc
Thomas Gleixner [Tue, 23 May 2006 14:10:00 +0000 (16:10 +0200)]
[MTD] Remove readv/readv_ecc

These functions were never implemented and added only bloat to
partition and concat code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Remove nand writev support
Thomas Gleixner [Tue, 23 May 2006 14:06:03 +0000 (16:06 +0200)]
[MTD] Remove nand writev support

NAND writev(_ecc) support is not longer necessary. Remove it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] ECC rework broke diskonchip
Thomas Gleixner [Tue, 23 May 2006 13:59:58 +0000 (15:59 +0200)]
[MTD] ECC rework broke diskonchip

Fix the diskonchip ecc setup.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND ECC hwctl function has no return value
Thomas Gleixner [Tue, 23 May 2006 13:58:23 +0000 (15:58 +0200)]
[MTD] NAND ECC hwctl function has no return value

Fix the broken prototype

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years agoMerge branch 'master' of /home/tglx/work/kernel/git/mtd-2.6/
Thomas Gleixner [Tue, 23 May 2006 10:37:31 +0000 (12:37 +0200)]
Merge branch 'master' of /home/tglx/work/kernel/git/mtd-2.6/

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND modularize ECC
Thomas Gleixner [Tue, 23 May 2006 10:00:46 +0000 (12:00 +0200)]
[MTD] NAND modularize ECC

First step of modularizing ECC support.
- Move ECC related functionality into a seperate embedded data structure
- Get rid of the hardware dependend constants to simplify new ECC models

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND cleanup nand_scan
Thomas Gleixner [Tue, 23 May 2006 09:54:38 +0000 (11:54 +0200)]
[MTD] NAND cleanup nand_scan

Seperate functionality out of nand_scan so the code is more
readable. No functional change. First step of simplifying
the nand driver.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND consolidate data types
Thomas Gleixner [Tue, 23 May 2006 09:52:35 +0000 (11:52 +0200)]
[MTD] NAND consolidate data types

The NAND driver used a mix of unsigned char, u_char amd uint8_t
data types. Consolidate to uint8_t usage

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] NAND whitespace and formatting cleanup
Thomas Gleixner [Tue, 23 May 2006 09:50:56 +0000 (11:50 +0200)]
[MTD] NAND whitespace and formatting cleanup

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[JFFS2] Simplify writebuffer handling
Thomas Gleixner [Tue, 23 May 2006 09:49:14 +0000 (11:49 +0200)]
[JFFS2] Simplify writebuffer handling

The writev based write buffer implementation was far to complex as
in most use cases the write buffer had to be handled anyway.
Simplify the write buffer handling and use mtd->write instead.

From extensive testing no performance impact has been noted.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Add support for NDFC NAND controller
Thomas Gleixner [Tue, 23 May 2006 09:43:28 +0000 (11:43 +0200)]
[MTD] Add support for NDFC NAND controller

NDFC NAND Flash controller is embedded in PPC EP44x SoCs.
Add platform driver based support.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Add platform support for NAND
Thomas Gleixner [Tue, 23 May 2006 09:38:59 +0000 (11:38 +0200)]
[MTD] Add platform support for NAND

Add the data structures necessary to provide platform device support
for NAND

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Simplify NAND locking
Thomas Gleixner [Tue, 23 May 2006 09:37:03 +0000 (11:37 +0200)]
[MTD] Simplify NAND locking

Replace the chip lock by a the controller lock. For simple drivers a
dummy controller structure is created by the scan code.
This simplifies the locking algorithm in nand_get/release_chip().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[MTD] Improve software ECC calculation
Thomas Gleixner [Tue, 23 May 2006 09:32:45 +0000 (11:32 +0200)]
[MTD] Improve software ECC calculation

Unrolling the loops produces denser and much faster code.
Add a config switch which allows to select the byte order of the
resulting ecc code. The current Linux implementation has a byte
swap versus the SmartMedia specification

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 years ago[JFFS2] Remove flash offset argument from various functions.
David Woodhouse [Mon, 22 May 2006 23:38:06 +0000 (00:38 +0100)]
[JFFS2] Remove flash offset argument from various functions.

We don't need the upper layers to deal with the physical offset. It's
_always_ c->nextblock->offset + c->sector_size - c->nextblock->free_size
so we might as well just let the actual write functions deal with that.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Introduce MTD_BIT_WRITEABLE
Joern Engel [Mon, 22 May 2006 21:18:29 +0000 (23:18 +0200)]
[MTD] Introduce MTD_BIT_WRITEABLE

o Add a flag MTD_BIT_WRITEABLE for devices that allow single bits to be
  cleared.
o Replace MTD_PROGRAM_REGIONS with a cleared MTD_BIT_WRITEABLE flag for
  STMicro and Intel Sibley flashes with internal ECC.  Those flashes
  disallow clearing of single bits, unlike regular NOR flashes, so the
  new flag models their behaviour better.
o Remove MTD_ECC.  After the STMicro/Sibley merge, this flag is only set
  and never checked.

Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
18 years ago[MTD] Merge STMicro NOR_ECC code with Intel Sibley code
Joern Engel [Mon, 22 May 2006 21:18:12 +0000 (23:18 +0200)]
[MTD] Merge STMicro NOR_ECC code with Intel Sibley code

In 2002, STMicro started producing NOR flashes with internal ECC protection
for small blocks (8 or 16 bytes).  Support for those flashes was added by me.
In 2005, Intel Sibley flashes copied this strategy and Nico added support for
those.  Merge the code for both.

Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
18 years ago[MTD] Introduce writesize
Joern Engel [Mon, 22 May 2006 21:18:05 +0000 (23:18 +0200)]
[MTD] Introduce writesize

At least two flashes exists that have the concept of a minimum write unit,
similar to NAND pages, but no other NAND characteristics.  Therefore, rename
the minimum write unit to "writesize" for all flashes, including NAND.

Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
18 years ago[MTD] Use single flag to mark writeable devices.
Joern Engel [Mon, 22 May 2006 21:17:23 +0000 (23:17 +0200)]
[MTD] Use single flag to mark writeable devices.

Two flags exist to decide whether a device is writeable or not.  None of
those two flags is checked for independently, so they are clearly redundant,
if not an invitation to bugs.  This patch removed both of them, replacing
them with a single new flag.

Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
18 years ago[JFFS2] Put list of nodes in common part of ic/x_ref/x_datum structure
David Woodhouse [Mon, 22 May 2006 15:32:05 +0000 (16:32 +0100)]
[JFFS2] Put list of nodes in common part of ic/x_ref/x_datum structure

We'll be using a proper list of nodes in the jffs2_xattr_datum and
jffs2_xattr_ref structures, because the existing code to overwrite
them is just broken. Put it in the common part at the front of the
structure which is shared with the jffs2_inode_cache, so that the
jffs2_link_node_ref() function can do the right thing.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Add some preemptive BUG checks for XATTR code
David Woodhouse [Mon, 22 May 2006 15:29:23 +0000 (16:29 +0100)]
[JFFS2] Add some preemptive BUG checks for XATTR code

In a couple of places, we assume that what's at the end of the
->next_in_ino list is a struct jffs2_inode_cache. Let's check
for that, since we expect it to change soon.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Extend jffs2_link_node_ref() to link into per-inode list too.
David Woodhouse [Mon, 22 May 2006 14:23:10 +0000 (15:23 +0100)]
[JFFS2] Extend jffs2_link_node_ref() to link into per-inode list too.

Let's avoid the potential for forgetting to set ref->next_in_ino, by doing
it within jffs2_link_node_ref() instead.

This highlights the ugliness of what we're currently doing with
xattr_datum and xattr_ref structures -- we should find a nicer way of
dealing with that.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Initialise ref->next_in_ino when marking dirty space in wbuf flush
David Woodhouse [Mon, 22 May 2006 12:55:46 +0000 (13:55 +0100)]
[JFFS2] Initialise ref->next_in_ino when marking dirty space in wbuf flush

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Fix accounting error in jffs2_link_node_ref()
David Woodhouse [Mon, 22 May 2006 11:15:47 +0000 (12:15 +0100)]
[JFFS2] Fix accounting error in jffs2_link_node_ref()

When filing REF_OBSOLETE nodes, we'd add their size to the global
'dirty_size' count, but then to the eraseblock's 'used_size' count.
That's not clever.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Fix dummy jffs2_sum_scan_sumnode() macro for !SUMMARY case.
David Woodhouse [Mon, 22 May 2006 10:27:14 +0000 (11:27 +0100)]
[JFFS2] Fix dummy jffs2_sum_scan_sumnode() macro for !SUMMARY case.

I added an argument to the real function...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoMerge git://git.infradead.org/jffs2-devel-2.6
David Woodhouse [Sun, 21 May 2006 18:05:55 +0000 (19:05 +0100)]
Merge git://git.infradead.org/jffs2-devel-2.6

18 years ago[MTD] Account for MODULE_SYMBOL_PREFIX when requesting NOR chip driver
David Woodhouse [Sun, 21 May 2006 18:03:21 +0000 (19:03 +0100)]
[MTD] Account for MODULE_SYMBOL_PREFIX when requesting NOR chip driver

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Use symbol_request() in old DiskOnChip probe code to find actual driver
David Woodhouse [Sun, 21 May 2006 17:38:51 +0000 (18:38 +0100)]
[MTD] Use symbol_request() in old DiskOnChip probe code to find actual driver

The previous code wouldn't work correctly on architectures which have a
non-empty MODULE_SYMBOL_PREFIX, and this version is neater if slightly
less optimal in the built-in case.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Add Amstrad Delta NAND support
Jonathan McDowell [Sun, 21 May 2006 17:11:55 +0000 (18:11 +0100)]
[MTD] Add Amstrad Delta NAND support

The patch below adds support for the NAND device on the Amstrad Delta.
This is a 32MiB 8bit Toshiba device, with the data bus connected to the
OMAP MPUIO pins and ALE, CLE, NCE, NRE, NWE and NWP all connected to the
Delta's latch2 16bit latch.

Signed-Off-By: Jonathan McDowell <noodles@earth.li>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Finally eliminate __totlen field from struct jffs2_raw_node_ref
David Woodhouse [Sun, 21 May 2006 12:29:11 +0000 (13:29 +0100)]
[JFFS2] Finally eliminate __totlen field from struct jffs2_raw_node_ref

Well, almost. We'll actually keep a 'TEST_TOTLEN' macro set for now, and keep
doing some paranoia checks to make sure it's all working correctly. But if
TEST_TOTLEN is unset, the size of struct jffs2_raw_node_ref drops from 16
bytes to 12 on 32-bit machines. That's a saving of about half a megabyte of
memory on the OLPC prototype board, with 125K or so nodes in its 512MiB of
flash.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Locking issues in summary write code.
David Woodhouse [Sun, 21 May 2006 12:15:59 +0000 (13:15 +0100)]
[JFFS2] Locking issues in summary write code.

We can't use jffs2_scan_dirty_space() because it doesn't do any locking; it's
only for use at scan time -- hence the 'scan' in the name.

Also, don't allocate refs while we have c->erase_completion_lock held.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Remove stray kfree of summary info in XATTR code.
David Woodhouse [Sun, 21 May 2006 12:13:45 +0000 (13:13 +0100)]
[JFFS2] Remove stray kfree of summary info in XATTR code.

We don't allocate this locally any more -- it's given to us and owner by
our caller. Also improve the debug messages a little.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] File node reference for wasted space when flushing wbuf
David Woodhouse [Sun, 21 May 2006 12:00:54 +0000 (13:00 +0100)]
[JFFS2] File node reference for wasted space when flushing wbuf

Next step in ongoing campaign to file a struct jffs2_raw_node_ref for every
piece of dirty space in the system, so that __totlen can be killed off....

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Add length argument to jffs2_add_physical_node_ref()
David Woodhouse [Sun, 21 May 2006 03:36:45 +0000 (04:36 +0100)]
[JFFS2] Add length argument to jffs2_add_physical_node_ref()

If __totlen is going away, we need to pass the length in separately.
Also stop callers from needlessly setting ref->next_phys to NULL,
since that's done for them... and since that'll also be going away soon.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Mark gaps in summary list as dirty space
David Woodhouse [Sun, 21 May 2006 03:00:01 +0000 (04:00 +0100)]
[JFFS2] Mark gaps in summary list as dirty space

Make sure we allocate a ref for any dirty space which exists between nodes
which we find in an eraseblock summary.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Discard remaining free space when filing a dirty block in scan.
David Woodhouse [Sun, 21 May 2006 02:57:56 +0000 (03:57 +0100)]
[JFFS2] Discard remaining free space when filing a dirty block in scan.

The incoming ref_totlen() calculation is going to rely on the existence
of nodes which cover all dirty space. We can't just tweak the accounting
data any more; we have to call jffs2_scan_dirty_space() to do it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Introduce jffs2_scan_dirty_space() function.
David Woodhouse [Sun, 21 May 2006 02:46:05 +0000 (03:46 +0100)]
[JFFS2] Introduce jffs2_scan_dirty_space() function.

To eliminate the __totlen field from struct jffs2_raw_node_ref, we need
to allocate nodes for dirty space instead of just tweaking the accounting
data. Introduce jffs2_scan_dirty_space() in preparation for that.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Fix summary handling of unknown but compatible nodes.
David Woodhouse [Sun, 21 May 2006 02:45:27 +0000 (03:45 +0100)]
[JFFS2] Fix summary handling of unknown but compatible nodes.

For RWCOMPAT and ROCOMPAT nodes, we should still allow the mount to
succeed. Just abandon the summary and fall through to the full scan.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Fix memory leak in scan code; improve comments.
David Woodhouse [Sun, 21 May 2006 00:28:05 +0000 (01:28 +0100)]
[JFFS2] Fix memory leak in scan code; improve comments.

If we had to allocate extra space for the summary node, we weren't
correctly freeing it when jffs2_sum_scan_sumnode() returned nonzero --
which is both the success and the failure case. Only when it returned
zero, which means fall through to the full scan, were we correctly freeing
the buffer.

Document the meaning of those return codes while we're at it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Correct handling of JFFS2_FEATURE_RWCOMPAT_COPY nodes.
David Woodhouse [Sat, 20 May 2006 23:02:06 +0000 (00:02 +0100)]
[JFFS2] Correct handling of JFFS2_FEATURE_RWCOMPAT_COPY nodes.

We should preserve these when we come to garbage collect them, not let
them get erased. Use jffs2_garbage_collect_pristine() for this, and make
sure the summary code copes -- just refrain from writing a summary for any
block which contains a node we don't understand.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Correct accounting of erroneous cleanmarkers and failed summaries.
David Woodhouse [Sat, 20 May 2006 19:08:42 +0000 (20:08 +0100)]
[JFFS2] Correct accounting of erroneous cleanmarkers and failed summaries.

It should all be counted as dirty space, not wasted and _definitely_ not
unchecked.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Introduce jffs2_link_node_ref() function to reduce code duplication
David Woodhouse [Sat, 20 May 2006 18:45:26 +0000 (19:45 +0100)]
[JFFS2] Introduce jffs2_link_node_ref() function to reduce code duplication

The same sequence of code was repeated in many places, to add a new
struct jffs2_raw_node_ref to an eraseblock and adjust the space accounting
accordingly. Move it out-of-line.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoMerge git://git.infradead.org/jffs2-xattr-2.6
David Woodhouse [Sat, 20 May 2006 16:27:32 +0000 (17:27 +0100)]
Merge git://git.infradead.org/jffs2-xattr-2.6

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Reduce calls to ref_totlen() in jffs2_mark_node_obsolete()
David Woodhouse [Sat, 20 May 2006 15:20:19 +0000 (16:20 +0100)]
[JFFS2] Reduce calls to ref_totlen() in jffs2_mark_node_obsolete()

We were calling ref_totlen() 18 times. Even before that becomes a real
function rather than just a dereference, apparently some compilers still
suck anyway. It'll _certainly_ suck after ref_totlen() becomes more
complicated, so calculate it once and don't rely on CSE.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Optimise reading of eraseblock summary nodes
David Woodhouse [Sat, 20 May 2006 15:13:34 +0000 (16:13 +0100)]
[JFFS2] Optimise reading of eraseblock summary nodes

This improves the time to mount 512MiB of NAND flash on my OLPC prototype
by about 4%. We used to read the last page of the eraseblock twice -- once
to find the offset of the summary node, and again to actually _read_ the
summary node. Now we read the last page only once, and read more only if
we need to.

We also don't allocate a new buffer just for the summary code -- we use
the buffer which was already allocated for the scan. Better still, if the
'buffer' for the scan is actually just a pointer directly into NOR flash,
we use that too, avoiding the memcpy() which we used to do.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Avoid 64-bit division in mtdconcat
Andrew Morton [Sat, 20 May 2006 09:17:21 +0000 (10:17 +0100)]
[MTD] Avoid 64-bit division in mtdconcat

WARNING: "__moddi3" [drivers/mtd/mtdconcat.ko] undefined!

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Use __symbol_get() instead of symbol_get() in NOR chip probe
David Woodhouse [Sat, 20 May 2006 01:41:34 +0000 (02:41 +0100)]
[MTD] Use __symbol_get() instead of symbol_get() in NOR chip probe

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agogit-mtd: symbol_get() fix
Andrew Morton [Sat, 20 May 2006 01:06:34 +0000 (18:06 -0700)]
git-mtd: symbol_get() fix

drivers/mtd/devices/docprobe.c: In function `DoC_Probe':
drivers/mtd/devices/docprobe.c:338: warning: assignment from incompatible pointer type
drivers/mtd/devices/docprobe.c:341: warning: assignment from incompatible pointer type

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Remove forgotten summary code
Ferenc Havasi [Fri, 19 May 2006 20:00:36 +0000 (21:00 +0100)]
[JFFS2] Remove forgotten summary code

Remove forgotten lines from jffs2_scan_eraseblock() which
were unnecessary and may cause problem in some environments.

Thanks to Alexander Belyakov <alexander.belyakov@intel.com>.

Signed-off-by: Ferenc Havasi <havasi@inf.u-szeged.hu>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Support new device nodes
David Woodhouse [Thu, 18 May 2006 23:28:49 +0000 (00:28 +0100)]
[JFFS2] Support new device nodes

Device node major/minor numbers are just stored in the payload of a single
data node. Just extend that to 4 bytes and use new_encode_dev() for it.

We only use the 4-byte format if we _need_ to, if !old_valid_dev(foo).
This preserves backwards compatibility with older code as much as
possible. If we do make devices with major or minor numbers above 255, and
then mount the file system with the old code, it'll just read the first
two bytes and get the numbers wrong. If it comes to garbage-collect it,
it'll then write back those wrong numbers. But that's about the best we
can expect.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoMerge git://git.infradead.org/mtd-2.6
KaiGai Kohei [Thu, 18 May 2006 15:43:53 +0000 (00:43 +0900)]
Merge git://git.infradead.org/mtd-2.6

18 years ago[MTD] Fix printk format error in gen_probe.c
David Woodhouse [Wed, 17 May 2006 21:03:10 +0000 (22:03 +0100)]
[MTD] Fix printk format error in gen_probe.c

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Fix mtdconcat build. We didn't introduce mtd->writesize yet.
David Woodhouse [Wed, 17 May 2006 20:53:58 +0000 (21:53 +0100)]
[MTD] Fix mtdconcat build. We didn't introduce mtd->writesize yet.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoMTD: mtdconcat NAND/Sibley support (rev.2)
Alexander Belyakov [Wed, 17 May 2006 15:11:16 +0000 (19:11 +0400)]
MTD: mtdconcat NAND/Sibley support (rev.2)

There is a second revision of "mtdconcat NAND/Sibley" patch. I hope
the patch will not get damaged as I'm posting it from gmail account,
thanks to Jorn.

The patch adds previously missing concat_writev(),
concat_writev_ecc(), concat_block_isbad(), concat_block_markbad()
functions to make concatenation layer compatible with Sibley and NAND
chips.

Patch has been cleared from whitespaces, fixed some lines of code as
requested. Also I have added code for alignment check that should
support Jorn's "writesize" patch.

Signed-off-by: Alexander Belyakov <alexander.belyakov@intel.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoLASAT depends on MTD_CFI
Martin Michlmayr [Mon, 20 Mar 2006 04:40:46 +0000 (04:40 +0000)]
LASAT depends on MTD_CFI

The following difference was found between the mainline and linux-mips
kernel.  LASAT depends on MTD_CFI.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoRe-add module description for ms02-nv to Kconfig
Martin Michlmayr [Mon, 20 Mar 2006 04:40:26 +0000 (04:40 +0000)]
Re-add module description for ms02-nv to Kconfig

In an unrelated MTD commit, a description about the ms02-nv module
got removed from Kconfig.  While I personally agree with this
removal, the module maintainer (Maciej W. Rozycki) would like to
see it added back.  In the absense of any consistency regarding
Kconfig descriptions his wish should be followed.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] RFD FTL: Be noisier, and don't assume block without RFD magic are erased
Sean Young [Wed, 17 May 2006 11:45:34 +0000 (12:45 +0100)]
[MTD] RFD FTL: Be noisier, and don't assume block without RFD magic are erased

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] generic: propagate oobavail to MTD partitions
Vitaly Wool [Wed, 17 May 2006 11:34:27 +0000 (12:34 +0100)]
[MTD] generic: propagate oobavail to MTD partitions

'oobavail' parameter of mtd_info structure is now propagated to the MTD
partitions

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[PCMCIA MTD] Fix leak and crash on reboot
Sean Young [Wed, 17 May 2006 10:47:48 +0000 (11:47 +0100)]
[PCMCIA MTD] Fix leak and crash on reboot

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agocfi_cmdset_0001: factorize code to wait for flash status
Nicolas Pitre [Thu, 30 Mar 2006 14:52:41 +0000 (15:52 +0100)]
cfi_cmdset_0001: factorize code to wait for flash status

This allows for much better abstraction and separation of the XIP and
non-XIP cases with their own specific implementations.  This fixes the
case where a timeout was tripped on in the XIP case by the code that
was meant for the non-XIP case only.

This also makes for a nice code reduction.

Signed-off-by: Nicolas Pitre <nico@cam.org>
CC: "Alexey, Korolev" <alexey.korolev@intel.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agocfi-cmdset-0001: always update the chip status
Nicolas Pitre [Wed, 29 Mar 2006 22:31:42 +0000 (23:31 +0100)]
cfi-cmdset-0001: always update the chip status

... otherwise xip_enable() won't do the right thing.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoCHIPS: Fix potential starvation in cfi_cmdset_0001
Josh Boyer [Tue, 6 Dec 2005 17:28:19 +0000 (17:28 +0000)]
CHIPS: Fix potential starvation in cfi_cmdset_0001

The patch below fixes a potential starvation issue that can arise when
there is contention on a chip during a period when a process is
currently writing to it.  The starvation is avoided by conditionally
rescheduling when the chip is left in a state usable by other processes.

Signed-off-by: Josh Boyer <jdub@us.ibm.com>
Signed-off-by: Tom Gall <tom_gall@vnet.ibm.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Repack some on-medium structures. ARM is weirder than I thought.
David Woodhouse [Tue, 16 May 2006 22:03:08 +0000 (23:03 +0100)]
[JFFS2] Repack some on-medium structures. ARM is weirder than I thought.

We have to pack at least the jint16_t structure, because otherwise it'll
be four bytes in size. Thankfully, we can do that and _not_ pack the
actual node structures, and the compiler still doesn't emit stupid code.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoNAND: Fix NAND ECC errors on AMD Au1550
Sergei Shtylyov [Tue, 16 May 2006 16:52:06 +0000 (20:52 +0400)]
NAND: Fix NAND ECC errors on AMD Au1550

    On AMD Au1550 the static bus controller fails to keep -CE asserted during
chip ready delay on read commands and the NAND chip being used requires this.
So, the current driver allows nand_base.c to drive -CE manually during the
entire sector read. When the PCMCIA driver is enabled however, occasionally
the ECC errors occur on NAND reads. This happens because the PCMCIA driver
polls sockets periodically and reads one of the board's control/status regs
(BCSRs) which are on the same static bus as the NAND flash, and just use
another chip select (and the NOR flash also resides on that bus), so as the
NAND driver forces NAND chip select asserted and the -RE signal is shared, a
contention occurs on the static bus when BCSR or NOR flash is read while we're
reading from NAND.
    So, we either can't keep interrupts enabled during the whole NAND sector
read (which is hardly acceptable), or have to implement some interlocking
scheme between multiple drivers (which is painful, and makes me shudder :-).
    There's a third way which has proven to work: to force -CE asserted only
while we're waiting for a NAND chip to become ready after a read command,
disabling interrupts for a maximum of 25 microseconds (according to Toshiba
TC58DVM92A1FT00 datasheet -- this chip is mentioned in the board schematics);
for Samsung NAND chip which seems to be actually used this delay is even less,
12 us.

Signed-off-by: Konstantin Baydarov <kbaidarov@ru.mvista.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Fix build warnings in RedBoot MTD partition parser.
Ben Dooks [Tue, 16 May 2006 16:31:15 +0000 (17:31 +0100)]
[MTD] Fix build warnings in RedBoot MTD partition parser.

Fix build warnings from drivers/mtd/redboot.c due to
use of `unsigned long` in `struct fis_image_desc` for
fields being passed to swab32s() which expects __u32 *

Change the entries to uint32_t to make them compatible
with the swab32s() function

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoNAND: AMD Au1550 driver reads write-only register
Sergei Shtylyov [Tue, 16 May 2006 16:16:41 +0000 (20:16 +0400)]
NAND: AMD Au1550 driver reads write-only register

     During the last cleanup of the AMD Au1550 NAND driver the old buglet was
reintroduced: as the MEM_STNDCTL register is write-only and seem to always
read as 0x31, read-modify-write to it done in au1xxx_nand_init() will have the
side effect of enabling -RCS0/1 pin override (via bits 4/5 of this reg.), thus
possibly causing a contention on the static bus when the NOR flash (using
-RCS0) or board control status registers (using -RCS2) are read. Luckily, this
goes away with a first NAND access, since au1550_hwcontrol() doesn't try to
read this register before writing anymore.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Fix printk format in jffs2_sum_write_data() error message.
David Woodhouse [Tue, 16 May 2006 16:05:33 +0000 (17:05 +0100)]
[JFFS2] Fix printk format in jffs2_sum_write_data() error message.

fs/jffs2/summary.c: In function ‘jffs2_sum_write_data’:
fs/jffs2/summary.c:658: warning: format ‘%zd’ expects type ‘signed size_t’, but argument 4 has type ‘uint32_t’

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[JFFS2] Fix section mismatch warnings in JFFS2.
David Brownell [Tue, 16 May 2006 15:08:10 +0000 (16:08 +0100)]
[JFFS2] Fix section mismatch warnings in JFFS2.

Mark certain functions with __init and __exit appropriately.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD NAND] Make various initfuncs static, remove #ifdef MODULE from exitfuncs
David Woodhouse [Tue, 16 May 2006 12:54:50 +0000 (13:54 +0100)]
[MTD NAND] Make various initfuncs static, remove #ifdef MODULE from exitfuncs

We all inherited the same error from the original NAND board driver which
got copied and changed. Fix them all at once...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agodrivers/mtd/devices/docprobe.c: correct #if's
Adrian Bunk [Tue, 16 May 2006 11:46:44 +0000 (13:46 +0200)]
drivers/mtd/devices/docprobe.c: correct #if's

On Mon, May 15, 2006 at 12:56:37AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.17-rc3-mm1:
>...
>  git-mtd.patch
>...
>  git trees
>...

If we correct the names of the config options, the code might actually
work as intended...

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[MTD] Add help text for MTD_NAND_CS553X option.
David Woodhouse [Tue, 16 May 2006 12:11:47 +0000 (13:11 +0100)]
[MTD] Add help text for MTD_NAND_CS553X option.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
David Woodhouse [Tue, 16 May 2006 00:19:52 +0000 (01:19 +0100)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[PATCH] jffs2: memory leak in jffs2_scan_medium()
Florin Malita [Mon, 15 May 2006 22:42:31 +0000 (23:42 +0100)]
[PATCH] jffs2: memory leak in jffs2_scan_medium()

If jffs2_scan_eraseblock() fails and the exit path is taken, 's' is not
being deallocated.

Reported by Coverity, CID: 1258.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
18 years ago[PATCH] dl2k needs dma-mapping.h
Andrew Morton [Mon, 15 May 2006 16:44:43 +0000 (09:44 -0700)]
[PATCH] dl2k needs dma-mapping.h

On alpha:

drivers/net/dl2k.c: In function `rio_free_tx':
drivers/net/dl2k.c:768: error: `DMA_48BIT_MASK' undeclared (first use in this function)
drivers/net/dl2k.c:768: error: (Each undeclared identifier is reported only once
drivers/net/dl2k.c:768: error: for each function it appears in.)
drivers/net/dl2k.c: In function `receive_packet':
drivers/net/dl2k.c:896: error: `DMA_48BIT_MASK' undeclared (first use in this function)
drivers/net/dl2k.c: In function `rio_close':
drivers/net/dl2k.c:1803: error: `DMA_48BIT_MASK' undeclared (first use in this function)

Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] jffs2 warning fixes
Andrew Morton [Mon, 15 May 2006 16:44:42 +0000 (09:44 -0700)]
[PATCH] jffs2 warning fixes

fs/jffs2/nodelist.c: In function `check_node_data':
fs/jffs2/nodelist.c:441: warning: unsigned int format, different type arg (arg 4)
fs/jffs2/nodelist.c:464: warning: int format, different type arg (arg 5)

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] devices.txt: remove pktcdvd entry
Peter Osterlund [Mon, 15 May 2006 16:44:40 +0000 (09:44 -0700)]
[PATCH] devices.txt: remove pktcdvd entry

Changing the driver to use dynamic device numbers was one of the many
changes that were made in order to have the driver accepted into the
mainline kernel.  Therefore I would say that the entry in devices.txt is
obsolete.  This patch removes it.

Signed-off-by: Peter Osterlund <petero2@telia.com>
Cc: Torben Mathiasen <device@lanana.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] ide_cs: Add IBM microdrive to known IDs
Thomas Kleffel [Mon, 15 May 2006 16:44:37 +0000 (09:44 -0700)]
[PATCH] ide_cs: Add IBM microdrive to known IDs

Add the IBM microdrive to the known PCMCIA IDs for ide_cs.

Signed-off-by: Thomas Kleffel <tk@maintech.de>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Fix typos in Documentation/memory-barriers.txt
Aneesh Kumar [Mon, 15 May 2006 16:44:36 +0000 (09:44 -0700)]
[PATCH] Fix typos in Documentation/memory-barriers.txt

Fix some typos in Documentation/memory-barriers.txt

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] gigaset: endian fix
Alexey Dobriyan [Mon, 15 May 2006 16:44:35 +0000 (09:44 -0700)]
[PATCH] gigaset: endian fix

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Hansjoerg Lipp <hjlipp@web.de>
Cc: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] fix hotplug kconfig help
Pavel Machek [Mon, 15 May 2006 16:44:34 +0000 (09:44 -0700)]
[PATCH] fix hotplug kconfig help

HOTPLUG_CPU entry says "Say Y..." then "Say N.".  Slightly ugly, so I fixed
it up, and added remark about suspend on SMP as a bonus.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>