projects/linux·commit be967b7e

Merge git://git.infradead.org/mtd-2.6

be967b7e · Linus Torvalds <[email protected]> · 2006-06-20 14:50:31 -07:00

* git://git.infradead.org/mtd-2.6: (199 commits)
  [MTD] NAND: Fix breakage all over the place
  [PATCH] NAND: fix remaining OOB length calculation
  [MTD] NAND Fixup NDFC merge brokeness
  [MTD NAND] S3C2410 driver cleanup
  [MTD NAND] s3c24x0 board: Fix clock handling, ensure proper initialisation.
  [JFFS2] Check CRC32 on dirent and data nodes each time they're read
  [JFFS2] When retiring nextblock, allocate a node_ref for the wasted space
  [JFFS2] Mark XATTR support as experimental, for now
  [JFFS2] Don't trust node headers before the CRC is checked.
  [MTD] Restore MTD_ROM and MTD_RAM types
  [MTD] assume mtd->writesize is 1 for NOR flashes
  [MTD NAND] Fix s3c2410 NAND driver so it at least _looks_ like it compiles
  [MTD] Prepare physmap for 64-bit-resources
  [JFFS2] Fix more breakage caused by janitorial meddling.
  [JFFS2] Remove stray __exit from jffs2_compressors_exit()
  [MTD] Allow alternate JFFS2 mount variant for root filesystem.
  [MTD] Disconnect struct mtd_info from ABI
  [MTD] replace MTD_RAM with MTD_GENERIC_TYPE
  [MTD] replace MTD_ROM with MTD_GENERIC_TYPE
  [MTD] remove a forgotten MTD_XIP
  ...
Commit
be967b7e2f7747a5ebf2a07ee627d9338491e784
Parents
eef11427 · 7bc3312b

Merge commit. Changes below are compared with the first parent: eef11427.

Changes

124 files changed · +11084 −6720

FileStatusAddDelContent
MAINTAINERSmodified+2−2View file
drivers/mtd/Kconfigmodified+2−2View file
drivers/mtd/chips/Kconfigmodified+0−1View file
drivers/mtd/chips/Makefilemodified+0−7View file
drivers/mtd/chips/amd_flash.cmodified+1−7View file
drivers/mtd/chips/cfi_cmdset_0001.cmodified+176−298View file
drivers/mtd/chips/cfi_cmdset_0002.cmodified+2−20View file
drivers/mtd/chips/cfi_cmdset_0020.cmodified+3−19View file
drivers/mtd/chips/cfi_probe.cmodified+4−4View file
drivers/mtd/chips/gen_probe.cmodified+28−17View file
drivers/mtd/chips/map_ram.cmodified+1−1View file
drivers/mtd/chips/map_rom.cmodified+1−3View file
drivers/mtd/chips/sharp.cmodified+1−0View file
drivers/mtd/devices/Kconfigmodified+5−1View file
drivers/mtd/devices/Makefilemodified+0−7View file
drivers/mtd/devices/block2mtd.cmodified+20−7View file
drivers/mtd/devices/doc2000.cmodified+29−100View file
drivers/mtd/devices/doc2001.cmodified+28−32View file
drivers/mtd/devices/doc2001plus.cmodified+28−32View file
drivers/mtd/devices/docprobe.cmodified+10−16View file
drivers/mtd/devices/lart.cmodified+1−0View file
drivers/mtd/devices/m25p80.cmodified+1−0View file
drivers/mtd/devices/ms02-nv.cmodified+1−1View file
drivers/mtd/devices/mtdram.cmodified+1−0View file
drivers/mtd/devices/phram.cmodified+10−6View file
drivers/mtd/devices/slram.cmodified+1−2View file
drivers/mtd/inftlcore.cmodified+132−60View file
drivers/mtd/inftlmount.cmodified+35−25View file
drivers/mtd/maps/Kconfigmodified+5−6View file
drivers/mtd/maps/cfi_flagadm.cmodified+2−2View file
drivers/mtd/maps/dbox2-flash.cmodified+1−1View file
drivers/mtd/maps/mtx-1_flash.cmodified+1−1View file
drivers/mtd/maps/nettel.cmodified+3−1View file
drivers/mtd/maps/pcmciamtd.cmodified+1−0View file
drivers/mtd/maps/physmap.cmodified+186−69View file
drivers/mtd/mtdblock.cmodified+8−8View file
drivers/mtd/mtdblock_ro.cmodified+1−3View file
drivers/mtd/mtdchar.cmodified+233−94View file
drivers/mtd/mtdconcat.cmodified+188−147View file
drivers/mtd/mtdcore.cmodified+1−32View file
drivers/mtd/mtdpart.cmodified+55−116View file
drivers/mtd/nand/Kconfigmodified+53−4View file
drivers/mtd/nand/Makefilemodified+4−0View file
drivers/mtd/nand/ams-delta.cadded+237−0View file
drivers/mtd/nand/au1550nd.cmodified+228−93View file
drivers/mtd/nand/autcpu12.cmodified+71−54View file
drivers/mtd/nand/cs553x_nand.cadded+353−0View file
drivers/mtd/nand/diskonchip.cmodified+261−269View file
drivers/mtd/nand/edb7312.cmodified+44−53View file
drivers/mtd/nand/h1910.cmodified+39−59View file
drivers/mtd/nand/nand_base.cmodified+1529−1740View file
drivers/mtd/nand/nand_bbt.cmodified+307−195View file
drivers/mtd/nand/nand_ecc.cmodified+88−139View file
drivers/mtd/nand/nand_ids.cmodified+94−83View file
drivers/mtd/nand/nandsim.cmodified+17−78View file
drivers/mtd/nand/ndfc.cadded+311−0View file
drivers/mtd/nand/ppchameleonevb.cmodified+134−122View file
drivers/mtd/nand/rtc_from4.cmodified+163−188View file
drivers/mtd/nand/s3c2410.cmodified+135−117View file
drivers/mtd/nand/sharpsl.cmodified+66−80View file
drivers/mtd/nand/spia.cmodified+53−48View file
drivers/mtd/nand/toto.cmodified+62−59View file
drivers/mtd/nand/ts7250.cadded+206−0View file
drivers/mtd/nftlcore.cmodified+144−77View file
drivers/mtd/nftlmount.cmodified+57−34View file
drivers/mtd/onenand/Kconfigmodified+14−0View file
drivers/mtd/onenand/onenand_base.cmodified+479−239View file
drivers/mtd/onenand/onenand_bbt.cmodified+6−3View file
drivers/mtd/redboot.cmodified+9−9View file
drivers/mtd/rfd_ftl.cmodified+25−23View file
fs/Kconfigmodified+38−0View file
fs/jffs/intrep.cmodified+8−7View file
fs/jffs2/Makefilemodified+3−0View file
fs/jffs2/README.Lockingmodified+21−0View file
fs/jffs2/acl.cadded+485−0View file
fs/jffs2/acl.hadded+45−0View file
fs/jffs2/build.cmodified+2−0View file
fs/jffs2/compr.cmodified+1−1View file
fs/jffs2/compr.hmodified+2−2View file
fs/jffs2/debug.cmodified+7−7View file
fs/jffs2/debug.hmodified+6−0View file
fs/jffs2/dir.cmodified+86−35View file
fs/jffs2/erase.cmodified+22−34View file
fs/jffs2/file.cmodified+24−11View file
fs/jffs2/fs.cmodified+38−25View file
fs/jffs2/gc.cmodified+67−64View file
fs/jffs2/histo.hdeleted+0−3View before deletion
include/linux/jffs2_fs_i.h → fs/jffs2/jffs2_fs_i.hrenamed+5−0View file
include/linux/jffs2_fs_sb.h → fs/jffs2/jffs2_fs_sb.hrenamed+12−1View file
fs/jffs2/malloc.cmodified+120−7View file
fs/jffs2/nodelist.cmodified+176−7View file
fs/jffs2/nodelist.hmodified+115−74View file
fs/jffs2/nodemgmt.cmodified+84−112View file
fs/jffs2/os-linux.hmodified+8−15View file
fs/jffs2/readinode.cmodified+74−45View file
fs/jffs2/scan.cmodified+302−140View file
fs/jffs2/security.cadded+82−0View file
fs/jffs2/summary.cmodified+303−181View file
fs/jffs2/summary.hmodified+45−19View file
fs/jffs2/super.cmodified+18−2View file
fs/jffs2/symlink.cmodified+6−1View file
fs/jffs2/wbuf.cmodified+485−483View file
fs/jffs2/write.cmodified+53−94View file
fs/jffs2/xattr.cadded+1238−0View file
fs/jffs2/xattr.hadded+116−0View file
fs/jffs2/xattr_trusted.cadded+52−0View file
fs/jffs2/xattr_user.cadded+52−0View file
include/linux/jffs2.hmodified+51−5View file
include/linux/module.hmodified+0−9View file
include/linux/mtd/inftl.hmodified+1−1View file
include/linux/mtd/mtd.hmodified+64−33View file
include/linux/mtd/nand.hmodified+206−148View file
include/linux/mtd/ndfc.hadded+67−0View file
include/linux/mtd/nftl.hmodified+1−1View file
include/linux/mtd/onenand.hmodified+8−3View file
include/linux/mtd/onenand_regs.hmodified+8−0View file
include/linux/mtd/partitions.hmodified+1−1View file
include/linux/mtd/physmap.hmodified+10−19View file
include/mtd/mtd-abi.hmodified+64−26View file
include/mtd/mtd-user.hmodified+1−0View file
init/Kconfigmodified+0−3View file
init/do_mounts.cmodified+4−0View file
kernel/Makefilemodified+0−1View file
kernel/intermodule.cdeleted+0−184View before deletion

Only the first 600 diff lines are shown. Download the complete patch.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 854a152..ce37c4b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1843,12 +1843,12 @@ S: [email protected]
W: http://megaraid.lsilogic.com
S: Maintained
-MEMORY TECHNOLOGY DEVICES
+MEMORY TECHNOLOGY DEVICES (MTD)
P: David Woodhouse
W: http://www.linux-mtd.infradead.org/
-T: git kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6.git
+T: git git://git.infradead.org/mtd-2.6.git
S: Maintained
MICROTEK X6 SCANNER

drivers/mtd/Kconfig

View file
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index f6b775e..5ac265d 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -78,7 +78,7 @@ config MTD_REDBOOT_DIRECTORY_BLOCK
option.
The option specifies which Flash sectors holds the RedBoot
- partition table. A zero or positive value gives an absolete
+ partition table. A zero or positive value gives an absolute
erase block number. A negative value specifies a number of
sectors before the end of the device.
@@ -103,7 +103,7 @@ config MTD_CMDLINE_PARTS
bool "Command line partition table parsing"
depends on MTD_PARTITIONS = "y"
---help---
- Allow generic configuration of the MTD paritition tables via the kernel
+ Allow generic configuration of the MTD partition tables via the kernel
command line. Multiple flash resources are supported for hardware where
different kinds of flash memory are available.

drivers/mtd/chips/Kconfig

View file
diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
index a7ec595..6d8f30d 100644
--- a/drivers/mtd/chips/Kconfig
+++ b/drivers/mtd/chips/Kconfig
@@ -30,7 +30,6 @@ config MTD_JEDECPROBE
config MTD_GEN_PROBE
tristate
- select OBSOLETE_INTERMODULE
config MTD_CFI_ADV_OPTIONS
bool "Flash chip driver advanced configuration options"

drivers/mtd/chips/Makefile

View file
diff --git a/drivers/mtd/chips/Makefile b/drivers/mtd/chips/Makefile
index 8afe309..75bc1c2 100644
--- a/drivers/mtd/chips/Makefile
+++ b/drivers/mtd/chips/Makefile
@@ -3,13 +3,6 @@
#
# $Id: Makefile.common,v 1.5 2005/11/07 11:14:22 gleixner Exp $
-# *** BIG UGLY NOTE ***
-#
-# The removal of get_module_symbol() and replacement with
-# inter_module_register() et al has introduced a link order dependency
-# here where previously there was none. We now have to ensure that
-# the CFI command set drivers are linked before gen_probe.o
-
obj-$(CONFIG_MTD) += chipreg.o
obj-$(CONFIG_MTD_AMDSTD) += amd_flash.o
obj-$(CONFIG_MTD_CFI) += cfi_probe.o

drivers/mtd/chips/amd_flash.c

View file
diff --git a/drivers/mtd/chips/amd_flash.c b/drivers/mtd/chips/amd_flash.c
index 5711561..16eaca6 100644
--- a/drivers/mtd/chips/amd_flash.c
+++ b/drivers/mtd/chips/amd_flash.c
@@ -97,7 +97,6 @@ struct amd_flash_private {
int interleave;
int numchips;
unsigned long chipshift;
-// const char *im_name;
struct flchip chips[0];
};
@@ -131,12 +130,6 @@ static struct mtd_chip_driver amd_flash_chipdrv = {
.module = THIS_MODULE
};
-
-
-static const char im_name[] = "amd_flash";
-
-
-
static inline __u32 wide_read(struct map_info *map, __u32 addr)
{
if (map->buswidth == 1) {
@@ -737,6 +730,7 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
offset += dev_size;
}
mtd->type = MTD_NORFLASH;
+ mtd->writesize = 1;
mtd->flags = MTD_CAP_NORFLASH;
mtd->name = map->name;
mtd->erase = amd_flash_erase;

drivers/mtd/chips/cfi_cmdset_0001.c

View file
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 1c074d6..0d43581 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -331,13 +331,6 @@ read_pri_intelext(struct map_info *map, __u16 adr)
return extp;
}
-/* This routine is made available to other mtd code via
- * inter_module_register. It must only be accessed through
- * inter_module_get which will bump the use count of this module. The
- * addresses passed back in cfi are valid as long as the use count of
- * this module is non-zero, i.e. between inter_module_get and
- * inter_module_put. Keith Owens <[email protected]> 29 Oct 2000.
- */
struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
{
struct cfi_private *cfi = map->fldrv_priv;
@@ -406,7 +399,7 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
for (i=0; i< cfi->numchips; i++) {
cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp;
cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp;
- cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp;
+ cfi->chips[i].erase_time = 1000<<cfi->cfiq->BlockEraseTimeoutTyp;
cfi->chips[i].ref_point_counter = 0;
init_waitqueue_head(&(cfi->chips[i].wq));
}
@@ -415,6 +408,11 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
return cfi_intelext_setup(mtd);
}
+struct mtd_info *cfi_cmdset_0003(struct map_info *map, int primary) __attribute__((alias("cfi_cmdset_0001")));
+struct mtd_info *cfi_cmdset_0200(struct map_info *map, int primary) __attribute__((alias("cfi_cmdset_0001")));
+EXPORT_SYMBOL_GPL(cfi_cmdset_0001);
+EXPORT_SYMBOL_GPL(cfi_cmdset_0003);
+EXPORT_SYMBOL_GPL(cfi_cmdset_0200);
static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd)
{
@@ -547,12 +545,12 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
if (extp->MinorVersion >= '4') {
struct cfi_intelext_programming_regioninfo *prinfo;
prinfo = (struct cfi_intelext_programming_regioninfo *)&extp->extra[offs];
- MTD_PROGREGION_SIZE(mtd) = cfi->interleave << prinfo->ProgRegShift;
+ mtd->writesize = cfi->interleave << prinfo->ProgRegShift;
MTD_PROGREGION_CTRLMODE_VALID(mtd) = cfi->interleave * prinfo->ControlValid;
MTD_PROGREGION_CTRLMODE_INVALID(mtd) = cfi->interleave * prinfo->ControlInvalid;
- mtd->flags |= MTD_PROGRAM_REGIONS;
+ mtd->flags &= ~MTD_BIT_WRITEABLE;
printk(KERN_DEBUG "%s: program region size/ctrl_valid/ctrl_inval = %d/%d/%d\n",
- map->name, MTD_PROGREGION_SIZE(mtd),
+ map->name, mtd->writesize,
MTD_PROGREGION_CTRLMODE_VALID(mtd),
MTD_PROGREGION_CTRLMODE_INVALID(mtd));
}
@@ -896,26 +894,33 @@ static void __xipram xip_enable(struct map_info *map, struct flchip *chip,
/*
* When a delay is required for the flash operation to complete, the
- * xip_udelay() function is polling for both the given timeout and pending
- * (but still masked) hardware interrupts. Whenever there is an interrupt
- * pending then the flash erase or write operation is suspended, array mode
- * restored and interrupts unmasked. Task scheduling might also happen at that
- * point. The CPU eventually returns from the interrupt or the call to
- * schedule() and the suspended flash operation is resumed for the remaining
- * of the delay period.
+ * xip_wait_for_operation() function is polling for both the given timeout
+ * and pending (but still masked) hardware interrupts. Whenever there is an
+ * interrupt pending then the flash erase or write operation is suspended,
+ * array mode restored and interrupts unmasked. Task scheduling might also
+ * happen at that point. The CPU eventually returns from the interrupt or
+ * the call to schedule() and the suspended flash operation is resumed for
+ * the remaining of the delay period.
*
* Warning: this function _will_ fool interrupt latency tracing tools.
*/
-static void __xipram xip_udelay(struct map_info *map, struct flchip *chip,
- unsigned long adr, int usec)
+static int __xipram xip_wait_for_operation(
+ struct map_info *map, struct flchip *chip,
+ unsigned long adr, int *chip_op_time )
{
struct cfi_private *cfi = map->fldrv_priv;
struct cfi_pri_intelext *cfip = cfi->cmdset_priv;
map_word status, OK = CMD(0x80);
- unsigned long suspended, start = xip_currtime();
+ unsigned long usec, suspended, start, done;
flstate_t oldstate, newstate;
+ start = xip_currtime();
+ usec = *chip_op_time * 8;
+ if (usec == 0)
+ usec = 500000;
+ done = 0;
+
do {
cpu_relax();
if (xip_irqpending() && cfip &&
@@ -932,9 +937,9 @@ static void __xipram xip_udelay(struct map_info *map, struct flchip *chip,
* we resume the whole thing at once). Yes, it
* can happen!
*/
+ usec -= done;
map_write(map, CMD(0xb0), adr);
map_write(map, CMD(0x70), adr);
- usec -= xip_elapsed_since(start);
suspended = xip_currtime();
do {
if (xip_elapsed_since(suspended) > 100000) {
@@ -944,7 +949,7 @@ static void __xipram xip_udelay(struct map_info *map, struct flchip *chip,
* This is a critical error but there
* is not much we can do here.
*/
- return;
+ return -EIO;
}
status = map_read(map, adr);
} while (!map_word_andequal(map, status, OK, OK));
@@ -1004,65 +1009,107 @@ static void __xipram xip_udelay(struct map_info *map, struct flchip *chip,
xip_cpu_idle();
}
status = map_read(map, adr);
+ done = xip_elapsed_since(start);
} while (!map_word_andequal(map, status, OK, OK)
- && xip_elapsed_since(start) < usec);
-}
+ && done < usec);
-#define UDELAY(map, chip, adr, usec) xip_udelay(map, chip, adr, usec)
+ return (done >= usec) ? -ETIME : 0;
+}
/*
* The INVALIDATE_CACHED_RANGE() macro is normally used in parallel while
* the flash is actively programming or erasing since we have to poll for
* the operation to complete anyway. We can't do that in a generic way with
* a XIP setup so do it before the actual flash operation in this case
- * and stub it out from INVALIDATE_CACHE_UDELAY.
+ * and stub it out from INVAL_CACHE_AND_WAIT.
*/
#define XIP_INVAL_CACHED_RANGE(map, from, size) \
INVALIDATE_CACHED_RANGE(map, from, size)
-#define INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr, adr, len, usec) \
- UDELAY(map, chip, cmd_adr, usec)
-
-/*
- * Extra notes:
- *
- * Activating this XIP support changes the way the code works a bit. For
- * example the code to suspend the current process when concurrent access
- * happens is never executed because xip_udelay() will always return with the
- * same chip state as it was entered with. This is why there is no care for
- * the presence of add_wait_queue() or schedule() calls from within a couple
- * xip_disable()'d areas of code, like in do_erase_oneblock for example.
- * The queueing and scheduling are always happening within xip_udelay().
- *
- * Similarly, get_chip() and put_chip() just happen to always be executed
- * with chip->state set to FL_READY (or FL_XIP_WHILE_*) where flash state
- * is in array mode, therefore never executing many cases therein and not
- * causing any problem with XIP.
- */
+#define INVAL_CACHE_AND_WAIT(map, chip, cmd_adr, inval_adr, inval_len, p_usec) \
+ xip_wait_for_operation(map, chip, cmd_adr, p_usec)
#else
#define xip_disable(map, chip, adr)
#define xip_enable(map, chip, adr)
#define XIP_INVAL_CACHED_RANGE(x...)
+#define INVAL_CACHE_AND_WAIT inval_cache_and_wait_for_operation
+
+static int inval_cache_and_wait_for_operation(
+ struct map_info *map, struct flchip *chip,
+ unsigned long cmd_adr, unsigned long inval_adr, int inval_len,
+ int *chip_op_time )
+{
+ struct cfi_private *cfi = map->fldrv_priv;
+ map_word status, status_OK = CMD(0x80);
+ int z, chip_state = chip->state;
+ unsigned long timeo;
+
+ spin_unlock(chip->mutex);
+ if (inval_len)
+ INVALIDATE_CACHED_RANGE(map, inval_adr, inval_len);
+ if (*chip_op_time)
+ cfi_udelay(*chip_op_time);
+ spin_lock(chip->mutex);
+
+ timeo = *chip_op_time * 8 * HZ / 1000000;
+ if (timeo < HZ/2)
+ timeo = HZ/2;
+ timeo += jiffies;
+
+ z = 0;
+ for (;;) {
+ if (chip->state != chip_state) {
+ /* Someone's suspended the operation: sleep */
+ DECLARE_WAITQUEUE(wait, current);
+
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ add_wait_queue(&chip->wq, &wait);
+ spin_unlock(chip->mutex);
+ schedule();
+ remove_wait_queue(&chip->wq, &wait);
+ timeo = jiffies + (HZ / 2); /* FIXME */
+ spin_lock(chip->mutex);
+ continue;
+ }
-#define UDELAY(map, chip, adr, usec) \
-do { \
- spin_unlock(chip->mutex); \
- cfi_udelay(usec); \
- spin_lock(chip->mutex); \
-} while (0)
-
-#define INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr, adr, len, usec) \
-do { \
- spin_unlock(chip->mutex); \
- INVALIDATE_CACHED_RANGE(map, adr, len); \
- cfi_udelay(usec); \
- spin_lock(chip->mutex); \
-} while (0)
+ status = map_read(map, cmd_adr);
+ if (map_word_andequal(map, status, status_OK, status_OK))
+ break;
+
+ /* OK Still waiting */
+ if (time_after(jiffies, timeo)) {
+ map_write(map, CMD(0x70), cmd_adr);
+ chip->state = FL_STATUS;
+ return -ETIME;
+ }
+
+ /* Latency issues. Drop the lock, wait a while and retry */
+ z++;
+ spin_unlock(chip->mutex);
+ cfi_udelay(1);
+ spin_lock(chip->mutex);
+ }
+
+ if (!z) {
+ if (!--(*chip_op_time))
+ *chip_op_time = 1;
+ } else if (z > 1)
+ ++(*chip_op_time);
+
+ /* Done and happy. */
+ chip->state = FL_STATUS;
+ return 0;
+}
#endif
+#define WAIT_TIMEOUT(map, chip, adr, udelay) \
+ ({ int __udelay = (udelay); \
+ INVAL_CACHE_AND_WAIT(map, chip, adr, 0, 0, &__udelay); })
+
+
static int do_point_onechip (struct map_info *map, struct flchip *chip, loff_t adr, size_t len)
{
unsigned long cmd_addr;
@@ -1252,14 +1299,11 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
unsigned long adr, map_word datum, int mode)
{
struct cfi_private *cfi = map->fldrv_priv;
- map_word status, status_OK, write_cmd;
- unsigned long timeo;
- int z, ret=0;
+ map_word status, write_cmd;
+ int ret=0;
adr += chip->start;
- /* Let's determine those according to the interleave only once */
- status_OK = CMD(0x80);
switch (mode) {
case FL_WRITING:
write_cmd = (cfi->cfiq->P_ID != 0x0200) ? CMD(0x40) : CMD(0x41);
@@ -1285,57 +1329,17 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
map_write(map, datum, adr);
chip->state = mode;
- INVALIDATE_CACHE_UDELAY(map, chip, adr,
- adr, map_bankwidth(map),
- chip->word_write_time);
-
- timeo = jiffies + (HZ/2);
- z = 0;
- for (;;) {
- if (chip->state != mode) {
- /* Someone's suspended the write. Sleep */
- DECLARE_WAITQUEUE(wait, current);
-
- set_current_state(TASK_UNINTERRUPTIBLE);
- add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
- schedule();
- remove_wait_queue(&chip->wq, &wait);
- timeo = jiffies + (HZ / 2); /* FIXME */
- spin_lock(chip->mutex);
- continue;
- }
-
- status = map_read(map, adr);
- if (map_word_andequal(map, status, status_OK, status_OK))
- break;
-
- /* OK Still waiting */
- if (time_after(jiffies, timeo)) {
- map_write(map, CMD(0x70), adr);
- chip->state = FL_STATUS;
- xip_enable(map, chip, adr);
- printk(KERN_ERR "%s: word write error (status timeout)\n", map->name);
- ret = -EIO;
- goto out;
- }
-
- /* Latency issues. Drop the lock, wait a while and retry */
- z++;
- UDELAY(map, chip, adr, 1);
- }
- if (!z) {
- chip->word_write_time--;
- if (!chip->word_write_time)
- chip->word_write_time = 1;
+ ret = INVAL_CACHE_AND_WAIT(map, chip, adr,
+ adr, map_bankwidth(map),
+ &chip->word_write_time);
+ if (ret) {
+ xip_enable(map, chip, adr);
+ printk(KERN_ERR "%s: word write error (status timeout)\n", map->name);
+ goto out;
}
- if (z > 1)
- chip->word_write_time++;
-
- /* Done and happy. */
- chip->state = FL_STATUS;
/* check for errors */
+ status = map_read(map, adr);
if (map_word_bitsset(map, status, CMD(0x1a))) {
unsigned long chipstatus = MERGESTATUS(status);
@@ -1452,9 +1456,9 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long *pvec_seek, int len)
{
struct cfi_private *cfi = map->fldrv_priv;
- map_word status, status_OK, write_cmd, datum;
- unsigned long cmd_adr, timeo;
- int wbufsize, z, ret=0, word_gap, words;
+ map_word status, write_cmd, datum;
+ unsigned long cmd_adr;
+ int ret, wbufsize, word_gap, words;
const struct kvec *vec;
unsigned long vec_seek;
@@ -1463,7 +1467,6 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
cmd_adr = adr & ~(wbufsize-1);
/* Let's determine this according to the interleave only once */
- status_OK = CMD(0x80);
write_cmd = (cfi->cfiq->P_ID != 0x0200) ? CMD(0xe8) : CMD(0xe9);
spin_lock(chip->mutex);
@@ -1477,12 +1480,14 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
ENABLE_VPP(map);
xip_disable(map, chip, cmd_adr);
- /* �4.8 of the 28FxxxJ3A datasheet says "Any time SR.4 and/or SR.5 is set
+ /* §4.8 of the 28FxxxJ3A datasheet says "Any time SR.4 and/or SR.5 is set
[...], the device will not accept any more Write to Buffer commands".
So we must check here and reset those bits if they're set. Otherwise
we're just pissing in the wind */
- if (chip->state != FL_STATUS)
+ if (chip->state != FL_STATUS) {
map_write(map, CMD(0x70), cmd_adr);
+ chip->state = FL_STATUS;
+ }
status = map_read(map, cmd_adr);
if (map_word_bitsset(map, status, CMD(0x30))) {
xip_enable(map, chip, cmd_adr);
@@ -1493,32 +1498,20 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
}
chip->state = FL_WRITING_TO_BUFFER;
-
- z = 0;
- for (;;) {
- map_write(map, write_cmd, cmd_adr);
-
+ map_write(map, write_cmd, cmd_adr);
+ ret = WAIT_TIMEOUT(map, chip, cmd_adr, 0);
+ if (ret) {
+ /* Argh. Not ready for write to buffer */
+ map_word Xstatus = map_read(map, cmd_adr);
+ map_write(map, CMD(0x70), cmd_adr);
+ chip->state = FL_STATUS;
status = map_read(map, cmd_adr);
- if (map_word_andequal(map, status, status_OK, status_OK))
- break;
-
- UDELAY(map, chip, cmd_adr, 1);
-
- if (++z > 20) {
- /* Argh. Not ready for write to buffer */
- map_word Xstatus;
- map_write(map, CMD(0x70), cmd_adr);
- chip->state = FL_STATUS;
- Xstatus = map_read(map, cmd_adr);
- /* Odd. Clear status bits */
- map_write(map, CMD(0x50), cmd_adr);
- map_write(map, CMD(0x70), cmd_adr);
- xip_enable(map, chip, cmd_adr);
- printk(KERN_ERR "%s: Chip not ready for buffer write. status = %lx, Xstatus = %lx\n",
- map->name, status.x[0], Xstatus.x[0]);
- ret = -EIO;
- goto out;
- }
+ map_write(map, CMD(0x50), cmd_adr);
+ map_write(map, CMD(0x70), cmd_adr);
+ xip_enable(map, chip, cmd_adr);
+ printk(KERN_ERR "%s: Chip not ready for buffer write. Xstatus = %lx, status = %lx\n",
+ map->name, Xstatus.x[0], status.x[0]);
+ goto out;
}
/* Figure out the number of words to write */
@@ -1573,56 +1566,19 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
map_write(map, CMD(0xd0), cmd_adr);
chip->state = FL_WRITING;
- INVALIDATE_CACHE_UDELAY(map, chip, cmd_adr,
- adr, len,
- chip->buffer_write_time);
-
- timeo = jiffies + (HZ/2);
- z = 0;
- for (;;) {
- if (chip->state != FL_WRITING) {
- /* Someone's suspended the write. Sleep */
- DECLARE_WAITQUEUE(wait, current);
- set_current_state(TASK_UNINTERRUPTIBLE);
- add_wait_queue(&chip->wq, &wait);
- spin_unlock(chip->mutex);
- schedule();
- remove_wait_queue(&chip->wq, &wait);
- timeo = jiffies + (HZ / 2); /* FIXME */
- spin_lock(chip->mutex);
- continue;
- }
-
- status = map_read(map, cmd_adr);
- if (map_word_andequal(map, status, status_OK, status_OK))
- break;
-
- /* OK Still waiting */
- if (time_after(jiffies, timeo)) {
- map_write(map, CMD(0x70), cmd_adr);
- chip->state = FL_STATUS;
- xip_enable(map, chip, cmd_adr);
- printk(KERN_ERR "%s: buffer write error (status timeout)\n", map->name);
- ret = -EIO;
- goto out;
- }
-
- /* Latency issues. Drop the lock, wait a while and retry */
- z++;
- UDELAY(map, chip, cmd_adr, 1);
- }
- if (!z) {
- chip->buffer_write_time--;
- if (!chip->buffer_write_time)
- chip->buffer_write_time = 1;
+ ret = INVAL_CACHE_AND_WAIT(map, chip, cmd_adr,
+ adr, len,
+ &chip->buffer_write_time);
+ if (ret) {
+ map_write(map, CMD(0x70), cmd_adr);
+ chip->state = FL_STATUS;
+ xip_enable(map, chip, cmd_adr);
+ printk(KERN_ERR "%s: buffer write error (status timeout)\n", map->name);
+ goto out;
}
- if (z > 1)
- chip->buffer_write_time++;
-
- /* Done and happy. */
- chip->state = FL_STATUS;
/* check for errors */
+ status = map_read(map, cmd_adr);
if (map_word_bitsset(map, status, CMD(0x1a))) {

This diff is incomplete. Download the complete patch.

drivers/mtd/chips/cfi_cmdset_0002.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/chips/cfi_cmdset_0020.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/chips/cfi_probe.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/chips/gen_probe.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/chips/map_ram.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/chips/map_rom.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/chips/sharp.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/block2mtd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/doc2000.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/doc2001.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/doc2001plus.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/docprobe.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/lart.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/m25p80.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/ms02-nv.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/mtdram.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/phram.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/devices/slram.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/inftlcore.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/inftlmount.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/cfi_flagadm.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/dbox2-flash.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/mtx-1_flash.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/nettel.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/pcmciamtd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/physmap.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdblock.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdblock_ro.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdchar.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdconcat.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdcore.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdpart.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/ams-delta.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/au1550nd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/autcpu12.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/cs553x_nand.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/diskonchip.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/edb7312.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/h1910.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nand_base.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nand_bbt.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nand_ecc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nand_ids.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nandsim.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/ndfc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/ppchameleonevb.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/rtc_from4.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/s3c2410.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/sharpsl.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/spia.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/toto.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/ts7250.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nftlcore.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nftlmount.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/onenand/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/onenand/onenand_base.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/onenand/onenand_bbt.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/redboot.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/rfd_ftl.c

View file

This diff is incomplete. Download the complete patch.

fs/Kconfig

View file

This diff is incomplete. Download the complete patch.

fs/jffs/intrep.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/Makefile

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/README.Locking

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/acl.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/acl.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/build.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/compr.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/compr.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/debug.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/debug.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/erase.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/file.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/fs.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/gc.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/histo.h

View before deletion

This diff is incomplete. Download the complete patch.

fs/jffs2/jffs2_fs_i.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/jffs2_fs_sb.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/malloc.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/nodelist.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/nodelist.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/nodemgmt.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/os-linux.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/readinode.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/scan.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/security.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/summary.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/summary.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/super.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/symlink.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/wbuf.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/write.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/xattr.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/xattr.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/xattr_trusted.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/xattr_user.c

View file

This diff is incomplete. Download the complete patch.

include/linux/jffs2.h

View file

This diff is incomplete. Download the complete patch.

include/linux/module.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/inftl.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/mtd.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/nand.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/ndfc.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/nftl.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/onenand.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/onenand_regs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/partitions.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/physmap.h

View file

This diff is incomplete. Download the complete patch.

include/mtd/mtd-abi.h

View file

This diff is incomplete. Download the complete patch.

include/mtd/mtd-user.h

View file

This diff is incomplete. Download the complete patch.

init/Kconfig

View file

This diff is incomplete. Download the complete patch.

init/do_mounts.c

View file

This diff is incomplete. Download the complete patch.

kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

kernel/intermodule.c

View before deletion

This diff is incomplete. Download the complete patch.