11 Jan, 2012

1 commit

  • MTD pull for 3.3

    * tag 'for-linus-3.3' of git://git.infradead.org/mtd-2.6: (113 commits)
    mtd: Fix dependency for MTD_DOC200x
    mtd: do not use mtd->block_markbad directly
    logfs: do not use 'mtd->block_isbad' directly
    mtd: introduce mtd_can_have_bb helper
    mtd: do not use mtd->suspend and mtd->resume directly
    mtd: do not use mtd->lock, unlock and is_locked directly
    mtd: do not use mtd->sync directly
    mtd: harmonize mtd_writev usage
    mtd: do not use mtd->lock_user_prot_reg directly
    mtd: mtd->write_user_prot_reg directly
    mtd: do not use mtd->read_*_prot_reg directly
    mtd: do not use mtd->get_*_prot_info directly
    mtd: do not use mtd->read_oob directly
    mtd: mtdoops: do not use mtd->panic_write directly
    romfs: do not use mtd->get_unmapped_area directly
    mtd: do not use mtd->get_unmapped_area directly
    mtd: do use mtd->point directly
    mtd: introduce mtd_has_oob helper
    mtd: mtdcore: export symbols cleanup
    mtd: clean-up the default_mtd_writev function
    ...

    Fix up trivial edit/remove conflict in drivers/staging/spectra/lld_mtd.c

    Linus Torvalds
     

10 Jan, 2012

25 commits

  • Fix the following build warning:

    warning: (MTD_DOC2000 && MTD_DOC2001 && MTD_DOC2001PLUS) selects MTD_NAND_IDS
    which has unmet direct dependencies (MTD && MTD_NAND)

    Signed-off-by: Fabio Estevam
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Fabio Estevam
     
  • This patch makes the 'mtd_writev()' function more usable and logical. We first
    teach it to fall-back to the 'default_mtd_writev()' function if the MTD driver
    does not define its own '->writev()' method. Then we make block2mtd and JFFS2
    just 'mtd_writev()' instead of 'default_mtd_writev()' function. This means we
    can now stop exporting 'default_mtd_writev()' and instead, export
    'mtd_writev()'. This is much cleaner and more logical, as well as allows us to
    get read of another direct 'mtd->writev' access in JFFS2.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • Fix the following gcc warning:
    drivers/mtd/devices/sst25l.c: In function ‘sst25l_probe’:
    drivers/mtd/devices/sst25l.c:381:11: warning: unused variable ‘i’ [-Wunused-variable]

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • The 'struct mtd_info' object is allocated with 'kzalloc()', so it
    contains only zeroes - no need to initialize various fields to 0 or
    NULL.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • Instead of calling 'kmalloc()' and them 'memeset(0)', use 'kzalloc()'.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • As the MTD api has no use for the number of erase cycles
    each block has endured, remove the function which calculated
    that value.

    If one day MTD api finds it usefull for wear levelling
    algorithms to have this information, the function should be
    put back in place.

    Signed-off-by: Robert Jarzmik
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • This patch takes into account checkpatch, sparse and ECC
    comments.

    Signed-off-by: Robert Jarzmik
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • If doc_probe_device() returned an ERR_PTR, then we accidentally saved
    that to docg3_floors[floor] = mtd; which gets derefenced in the error
    handling when we call doc_release_device().

    I've reworked the error handling to take care of that and hopefully
    make it a little simpler.

    Signed-off-by: Dan Carpenter
    Acked-by: Robert Jarzmik
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Dan Carpenter
     
  • In ancient times it was necessary to manually initialize the bus field of an
    spi_driver to spi_bus_type. These days this is done in spi_driver_register(),
    so we can drop the manual assignment.

    The patch was generated using the following coccinelle semantic patch:
    //
    @@
    identifier _driver;
    @@
    struct spi_driver _driver = {
    .driver = {
    - .bus = &spi_bus_type,
    },
    };
    //

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Lars-Peter Clausen
     
  • As each docg3 chip has 2 protection areas (DPS0 and DPS1),
    and because theses areas can prevent user access to the chip
    data, add for each floor the sysfs entries which insert the
    protection key into the right DPS.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Docg3 chips can work in 3 modes : normal MLC mode, fast
    mode and reliable mode. Normally, as docg3 is a MLC chip, it
    should be configured to work in normal mode.

    In both normal mode, each page is distinct. This
    means that writing to page 12 of blocks 14,15 writes only to
    that page, and reading from page 12 of blocks 14,15 reads
    only from that page.

    In reliable and fast modes, pages are coupled by pairs, and
    are clones one of each other. This means that the available
    capacity of the chip is halved. Pages are coupled in each
    block, and page of index 2*n contains the same data as page
    2*n+1 of the same block.

    In fast mode, the reads occur a bit faster, but are a bit
    less reliable that in normal mode.

    When reading from page 2*n, the chip reads bytes from both
    page 2*n and page 2*n+1, makes a logical and for each byte,
    and returns the result. As programming a page means
    "clearing bits", even if a bit was not cleared on one page
    because the flash is worn out, the other page has the bit
    cleared, and the result of the "AND" gives a correct result.

    When writing to page 2*n, the chip writes data to both page
    2*n and page 2*n+1.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Add functions to powerdown and powerup from suspend, in
    order to save power.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Credit for discovering the BCH algorith parameters, and bit
    reversing algorithm is to be give to Mike Dunn and Ivan
    Djelic.

    The BCH correction code relied upon the BCH library, where
    all data and ECC is bit-reversed. The BCH library works
    correctly when each input byte is bit-reversed, and
    accordingly ECC output is also bit-reversed.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Map the developped write and erase functions into the mtd
    structure.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Add erase capability to the docg3 driver. The erase block is
    made of 2 physical blocks, as both share all 64 pages. That
    makes an erase block of at least 64 kBytes.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Add write capability to the docg3 driver. The writes are
    possible on a single page (512 bytes + 16 bytes), even if
    that page is split on 2 physical pages on 2 blocks (each on
    one plane).

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Add OOB buffer area to store the OOB data until the actual
    page is written, so that it can be completed by hardware ECC
    generator.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Add the required registers and commands to erase and write
    flash pages / blocks.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Add OOB layout description for docg3, so that userspace can
    use this information to setup the data for write_oob().

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Add support for multiple floors, ie. cascaded docg3
    chips. There might be 4 docg3 chips cascaded, sharing the
    same address space, and providing up to 4 times the storage
    capacity of a unique chip.

    Each floor will be seen as an independant mtd device.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Fix the docg3 reads to be able to cope with all possible
    data buffer / oob buffer / file mode combinations from
    docg3_read_oob().
    This especially ensures that raw reads do not use ECC
    corrections, and AUTOOOB and PLACEOOB do use ECC
    correction.

    The approach is to empty docg3_read() and make it a wrapper
    to docg3_read_oob(). As docg3_read_oob() handles all the
    funny cases (no data buffer but oob buffer, data buffer but
    no oob buffer, ...), docg3_read() is just a special use of
    docg3_read_oob().

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • BCH registers are contiguous, not on every byte. Fix the
    register definitions.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • The protection areas boundaries were on 16bit registers, not
    8bit. This is consistent with block numbers, which can
    extend up to 4096 on bigger chips (and is 2048 on the
    docg3).

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Writeb was incorrectly traced as a 16 bits write, instead of
    a 8 bits write. Fix it by tracing the correct width.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     
  • Change the NOP debug log verbosity to very verbose to
    unburden log analysis.

    Signed-off-by: Robert Jarzmik
    Reviewed-by: Ivan Djelic
    Reviewed-by: Mike Dunn
    Signed-off-by: David Woodhouse

    Robert Jarzmik
     

04 Jan, 2012

1 commit

  • Move invalidate_bdev, block_sync_page into fs/block_dev.c. Export
    kill_bdev as well, so brd doesn't have to open code it. Reduce
    buffer_head.h requirement accordingly.

    Removed a rather large comment from invalidate_bdev, as it looked a bit
    obsolete to bother moving. The small comment replacing it says enough.

    Signed-off-by: Nick Piggin
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Al Viro
     

30 Oct, 2011

1 commit

  • Depending on whether MTD_DOCPROBE_ADVANCED is set or not,
    MTD_DOCPROBE_ADDRESS will default to either 0x0000 or 0. That should
    lead to (basically) identical code in docprobe.c. The current two
    defaults should be merged.

    And, while we're at it, if MTD_DOCPROBE is set MTD_DOCPROBE_ADDRESS will
    always be set. (MTD_DOCPROBE_ADDRESS depends on MTD_DOCPROBE and it has
    a default value.) So the check whether CONFIG_MTD_DOCPROBE_ADDRESS is
    defined is unnecessary and should be dropped.

    Signed-off-by: Paul Bolle
    Signed-off-by: Artem Bityutskiy

    Paul Bolle
     

16 Oct, 2011

1 commit


14 Oct, 2011

2 commits


26 Sep, 2011

1 commit


11 Sep, 2011

8 commits