aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2006-05-24[JFFS2] Introduce ref_next() macro for finding next physical nodeDavid Woodhouse
Another part of the preparation for switching to an array... Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-24[JFFS2] Reduce visibility of raw_node_ref to upper layers of JFFS2 code.David Woodhouse
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>
2006-05-23Merge branch 'master' of /home/tglx/work/kernel/git/mtd-2.6/Thomas Gleixner
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2006-05-23[MTD] NAND modularize ECCThomas Gleixner
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>
2006-05-23[MTD] NAND cleanup nand_scanThomas Gleixner
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>
2006-05-23[MTD] NAND consolidate data typesThomas Gleixner
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>
2006-05-23[MTD] NAND whitespace and formatting cleanupThomas Gleixner
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2006-05-23[JFFS2] Simplify writebuffer handlingThomas Gleixner
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>
2006-05-23[MTD] Add support for NDFC NAND controllerThomas Gleixner
NDFC NAND Flash controller is embedded in PPC EP44x SoCs. Add platform driver based support. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2006-05-23[MTD] Add platform support for NANDThomas Gleixner
Add the data structures necessary to provide platform device support for NAND Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2006-05-23[MTD] Simplify NAND lockingThomas Gleixner
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>
2006-05-23[MTD] Improve software ECC calculationThomas Gleixner
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>
2006-05-23[JFFS2] Remove flash offset argument from various functions.David Woodhouse
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>
2006-05-22[MTD] Introduce MTD_BIT_WRITEABLEJoern Engel
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>
2006-05-22[MTD] Merge STMicro NOR_ECC code with Intel Sibley codeJoern Engel
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>
2006-05-22[MTD] Introduce writesizeJoern Engel
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>
2006-05-22[MTD] Use single flag to mark writeable devices.Joern Engel
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>
2006-05-22[JFFS2] Put list of nodes in common part of ic/x_ref/x_datum structureDavid Woodhouse
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>
2006-05-22[JFFS2] Add some preemptive BUG checks for XATTR codeDavid Woodhouse
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>
2006-05-22[JFFS2] Extend jffs2_link_node_ref() to link into per-inode list too.David Woodhouse
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>
2006-05-22[JFFS2] Initialise ref->next_in_ino when marking dirty space in wbuf flushDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-22[JFFS2] Fix accounting error in jffs2_link_node_ref()David Woodhouse
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>
2006-05-22[JFFS2] Fix dummy jffs2_sum_scan_sumnode() macro for !SUMMARY case.David Woodhouse
I added an argument to the real function... Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-21Merge git://git.infradead.org/jffs2-devel-2.6David Woodhouse
2006-05-21[MTD] Account for MODULE_SYMBOL_PREFIX when requesting NOR chip driverDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-21[MTD] Use symbol_request() in old DiskOnChip probe code to find actual driverDavid Woodhouse
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>
2006-05-21[MTD] Add Amstrad Delta NAND supportJonathan McDowell
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>
2006-05-21[JFFS2] Finally eliminate __totlen field from struct jffs2_raw_node_refDavid Woodhouse
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>
2006-05-21[JFFS2] Locking issues in summary write code.David Woodhouse
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>
2006-05-21[JFFS2] Remove stray kfree of summary info in XATTR code.David Woodhouse
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>
2006-05-21[JFFS2] File node reference for wasted space when flushing wbufDavid Woodhouse
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>
2006-05-21[JFFS2] Add length argument to jffs2_add_physical_node_ref()David Woodhouse
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>
2006-05-21[JFFS2] Mark gaps in summary list as dirty spaceDavid Woodhouse
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>
2006-05-21[JFFS2] Discard remaining free space when filing a dirty block in scan.David Woodhouse
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>
2006-05-21[JFFS2] Introduce jffs2_scan_dirty_space() function.David Woodhouse
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>
2006-05-21[JFFS2] Fix summary handling of unknown but compatible nodes.David Woodhouse
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>
2006-05-21[JFFS2] Fix memory leak in scan code; improve comments.David Woodhouse
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>
2006-05-21[JFFS2] Correct handling of JFFS2_FEATURE_RWCOMPAT_COPY nodes.David Woodhouse
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>
2006-05-20[JFFS2] Correct accounting of erroneous cleanmarkers and failed summaries.David Woodhouse
It should all be counted as dirty space, not wasted and _definitely_ not unchecked. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-20[JFFS2] Introduce jffs2_link_node_ref() function to reduce code duplicationDavid Woodhouse
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>
2006-05-20Merge git://git.infradead.org/jffs2-xattr-2.6David Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-20[JFFS2] Reduce calls to ref_totlen() in jffs2_mark_node_obsolete()David Woodhouse
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>
2006-05-20[JFFS2] Optimise reading of eraseblock summary nodesDavid Woodhouse
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>
2006-05-20[MTD] Avoid 64-bit division in mtdconcatAndrew Morton
WARNING: "__moddi3" [drivers/mtd/mtdconcat.ko] undefined! Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-20[MTD] Use __symbol_get() instead of symbol_get() in NOR chip probeDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-20git-mtd: symbol_get() fixAndrew Morton
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>
2006-05-19[JFFS2] Remove forgotten summary codeFerenc Havasi
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>
2006-05-19[JFFS2] Support new device nodesDavid Woodhouse
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>
2006-05-19Merge git://git.infradead.org/mtd-2.6KaiGai Kohei
2006-05-17[MTD] Fix printk format error in gen_probe.cDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>