10 Jan, 2012

31 commits


08 Nov, 2011

1 commit

  • * git://git.infradead.org/mtd-2.6: (226 commits)
    mtd: tests: annotate as DANGEROUS in Kconfig
    mtd: tests: don't use mtd0 as a default
    mtd: clean up usage of MTD_DOCPROBE_ADDRESS
    jffs2: add compr=lzo and compr=zlib options
    jffs2: implement mount option parsing and compression overriding
    mtd: nand: initialize ops.mode
    mtd: provide an alias for the redboot module name
    mtd: m25p80: don't probe device which has status of 'disabled'
    mtd: nand_h1900 never worked
    mtd: Add DiskOnChip G3 support
    mtd: m25p80: add EON flash EN25Q32B into spi flash id table
    mtd: mark block device queue as non-rotational
    mtd: r852: make r852_pm_ops static
    mtd: m25p80: add support for at25df321a spi data flash
    mtd: mxc_nand: preset_v1_v2: unlock all NAND flash blocks
    mtd: nand: switch `check_pattern()' to standard `memcmp()'
    mtd: nand: invalidate cache on unaligned reads
    mtd: nand: do not scan bad blocks with NAND_BBT_NO_OOB set
    mtd: nand: wait to set BBT version
    mtd: nand: scrub BBT on ECC errors
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-at91/board-usb-a9260.c
    Merged into board-usb-a926x.c
    - drivers/mtd/maps/lantiq-flash.c
    add_mtd_partitions -> mtd_device_register vs changed to use
    mtd_device_parse_register.

    Linus Torvalds
     

02 Nov, 2011

1 commit


21 Sep, 2011

1 commit


11 Sep, 2011

6 commits

  • The ecctype and eccsize fields have been obsolete for a while. Since they
    don't have any users, we can kill them and leave padding in their place
    for now.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • Implement a new ioctl for writing both page data and OOB to flash at the
    same time. This ioctl is intended to be a generic interface that can
    replace other ioctls (MEMWRITEOOB and MEMWRITEOOB64) and cover the
    functionality of several other old ones, e.g., MEMWRITE can:

    * write autoplaced OOB instead of using ECCGETLAYOUT (deprecated) and
    working around the reserved areas
    * write raw (no ECC) OOB instead of using MTDFILEMODE to set the
    per-file-descriptor MTD_FILE_MODE_RAW
    * write raw (no ECC) data instead of using MTDFILEMODE
    (MTD_FILE_MODE_RAW) and using standard character device "write"

    This ioctl is especially useful for MLC NAND, which cannot be written
    twice (i.e., we cannot successfully write the page data and OOB in two
    separate operations). Instead, MEMWRITE can write both in a single
    operation.

    Note that this ioctl is not affected by the MTD file mode (i.e.,
    MTD_FILE_MODE_RAW vs. MTD_FILE_MODE_NORMAL), since it receives its write
    mode as an input parameter.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • These modes hold their state only for the life of their file descriptor,
    and they overlap functionality with the MTD_OPS_* modes. Particularly,
    MTD_MODE_RAW and MTD_OPS_RAW cover the same function: to provide raw
    (i.e., without ECC) access to the flash. In fact, although it may not be
    clear, MTD_MODE_RAW implied that operations should enable the
    MTD_OPS_RAW mode.

    Thus, we should be specific on what each mode means. This is a start,
    where MTD_FILE_MODE_* actually represents a "file mode," not necessarily
    a true global MTD mode.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • These modes are not necessarily for OOB only. Particularly, MTD_OOB_RAW
    affected operations on in-band page data as well. To clarify these
    options and to emphasize that their effect is applied per-operation, we
    change the primary prefix to MTD_OPS_.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • This fixes issues with `nanddump -n' and the MEMREADOOB[64] ioctls on
    hardware that performs error correction when reading only OOB data. A
    driver for such hardware needs to know when we're doing a RAW vs. a
    normal write, but mtd_do_read_oob does not pass such information to the
    lower layers (e.g., NAND). We should pass MTD_OOB_RAW or MTD_OOB_PLACE
    based on the MTD file mode.

    For now, most drivers can get away with just setting:

    chip->ecc.read_oob_raw = chip->ecc.read_oob

    This is done by default; but for systems that behave as described above,
    you must supply your own replacement function.

    This was tested with nandsim as well as on actual SLC NAND.

    Signed-off-by: Brian Norris
    Cc: Jim Quinlan
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • This fixes issues with `nandwrite -n -o' and the MEMWRITEOOB[64] ioctls
    on hardware that writes ECC when writing OOB. The problem arises as
    follows: `nandwrite -n' can write page data to flash without applying
    ECC, but when used with the `-o' option, ECC is applied (incorrectly),
    contrary to the `--noecc' option.

    I found that this is the case because my hardware computes and writes
    ECC data to flash upon either OOB write or page write. Thus, to support
    a proper "no ECC" write, my driver must know when we're performing a raw
    OOB write vs. a normal ECC OOB write. However, MTD does not pass any raw
    mode information to the write_oob functions. This patch addresses the
    problems by:

    1) Passing MTD_OOB_RAW down to lower layers, instead of just defaulting
    to MTD_OOB_PLACE
    2) Handling MTD_OOB_RAW within the NAND layer's `nand_do_write_oob'
    3) Adding a new (replaceable) function pointer in struct ecc_ctrl; this
    function should support writing OOB without ECC data. Current
    hardware often can use the same OOB write function when writing
    either with or without ECC

    This was tested with nandsim as well as on actual SLC NAND.

    Signed-off-by: Brian Norris
    Cc: Jim Quinlan
    Signed-off-by: Artem Bityutskiy

    Brian Norris