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
     

01 Nov, 2011

1 commit

  • The pretty much brings in the kitchen sink along
    with it, so it should be avoided wherever reasonably possible in
    terms of being included from other commonly used
    files, as it results in a measureable increase on compile times.

    The worst culprit was probably device.h since it is used everywhere.
    This file also had an implicit dependency/usage of mutex.h which was
    masked by module.h, and is also fixed here at the same time.

    There are over a dozen other headers that simply declare the
    struct instead of pulling in the whole file, so follow their lead
    and simply make it a few more.

    Most of the implicit dependencies on module.h being present by
    these headers pulling it in have been now weeded out, so we can
    finally make this change with hopefully minimal breakage.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

21 Sep, 2011

1 commit


11 Sep, 2011

32 commits

  • The nand_chip.ops field is a struct that is passed around globally with
    no particular reason. Every time it is used, it could just as easily be
    replaced with a local struct that is updated on each operation. So make
    it local.

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

    Brian Norris
     
  • We're missing a lot of important documentation in include/mtd/mtd-abi.h:

    * add a simple description of each ioctl (feel free to expand!)
    * give full explanations of recently added and modified operations
    * explain the usage of "RAW" that appear in different modes and types of
    operations
    * fix some comment style along the way

    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
     
  • We will want to use the MTD_OOB_{PLACE,AUTO,RAW} modes in user-space
    applications through the introduction of new ioctls, so we should make
    this enum a shared type.

    This enum is now anonymous.

    Artem: tweaked the patch.

    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
     
  • Signed-off-by: Brian Norris
    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
     
  • Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

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

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

    Brian Norris
     
  • The set_parts and priv members of struct platform_nand_chip where
    removed in commit c36a6ef3845262ade529afb9f458738b1f196f83 but the
    kerneldoc wasn't updated.

    Signed-off-by: Tobias Klauser
    Signed-off-by: Artem Bityutskiy

    Tobias Klauser
     
  • Therefor -> Therefore
    [Intern], [Internal] -> [INTERN]
    [REPLACABLE] -> [REPLACEABLE]
    syndrom, syndom -> syndrome
    ecc -> ECC
    buswith -> buswidth
    endianess -> endianness
    dont -> don't
    occures -> occurs
    independend -> independent
    wihin -> within
    erease -> erase
    blockes -> blocks
    ...

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

    Brian Norris
     
  • mtd_device_register() is a limited version of mtd_device_parse_register.
    Replace it with macro calling mtd_device_parse_register().

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • There is no need to pollute public header with a definition private
    to mtdpart.c. Move it from mtd/partitions.h to mtdpart.c

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • There is no need to export parse_mtd_partitions() now , as it's fully handled
    by registration functions. So move the definition to private header and
    remove respective EXPORT_SYMBOL_GPL.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • There are two different 4KiB pagesize chips
    KFM4G16Q4M series have NOP 4 with version ID 0x0131
    But KFM4G16Q5M has NOP 1 with versoin ID 0x013e

    Note that Q5M means that it has NOP 1.

    Signed-off-by: Kyungmin Park
    Signed-off-by: Artem Bityutskiy

    Kyungmin Park
     
  • All users have been converted to call of_mtd_parse_partitions through
    parse_mtd_partitions() multiplexer. Drop obsolete API.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • Prepare to convert of_mtd_parse_partitions() to usual partitions parser:
    1) Register ofpart parser
    2) Internally don't use passed device for error printing
    3) Add device_node to mtd_part_parser_data struct
    4) Move of_mtd_parse_partitions from __devinit to common text section
    5) add ofpart to the default list of partition parsers

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • Encapsulate last MTD partition parser argument into a separate
    structure. Currently it holds only 'origin' field for RedBoot parser,
    but will be extended in future to contain at least device_node for OF
    devices.

    Amended commentary to make kerneldoc happy

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • Lots (nearly all) mtd drivers contain nearly the similar code that
    calls parse_mtd_partitions, provides some platform-default values, if
    parsing fails, and registers mtd device.

    This is an aim to provide single implementation of this scenario:
    mtd_device_parse_register() which will handle all this parsing and
    defaults.

    Artem: amended comments

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • Drop now unused set_parts from struct platform_nand_data. Also, while we are
    at it, drop long unused priv field from platform_nand_data.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • Add support for MTDPART_OFS_RETAIN: such partitions start at the current
    offset, take as much space as possible, but rain part->size bytes after
    the end of the partitions for other parts. Primarily this is intended
    for ts72xx arm platforms cleanup.

    Artem: tweaked the patch a bit

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • This function is unused now. Drop it.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • physmap_configure() and physmap_set_partitions() have no users in kernel.
    Out of kernel users should have been converted to regular platform device
    long ago. Drop support for this obsolete API.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • In an attempt to improve the documentation of the BBT code, I am expanding
    the comments I left in commit:
    58373ff0afff4cc8ac40608872995f4d87eb72ec
    mtd: nand: more BB Detection refactoring and dynamic scan options

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

    Brian Norris
     
  • After several steps of rearrangement and consolidation, it is probably
    worth re-sequencing the numbers on some of our affected flags in nand.h
    and bbm.h.

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

    Brian Norris
     
  • According to our new prefix rules, we should rename NAND_CREATE_EMPTY_BBT
    with a NAND_BBT prefix, i.e., NAND_BBT_CREATE_EMPTY.

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

    Brian Norris
     
  • The NAND_CREATE_EMPTY_BBT flag was added by commit:
    453281a973c10bce941b240d1c654d536623b16b
    mtd: nand: introduce NAND_CREATE_EMPTY_BBT
    This flag is not used within the kernel and not explained well, so I
    took the liberty to edit its comments.

    Also, this is a BBT-related flag (and closely tied with NAND_BBT_CREATE)
    so I'm moving it to bbm.h next to NAND_BBT_CREATE, thus requiring that
    we use the flag in nand_chip.bbt_options, *not* in nand_chip.options.

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

    Brian Norris
     
  • Recall the recently added prefix requirements:
    * "NAND_" for flags in nand.h, used in nand_chip.options
    * "NAND_BBT_" for flags in bbm.h, used in nand_chip.bbt_options
    or in nand_bbt_descr.options

    Thus, I am changing NAND_USE_FLASH_BBT to NAND_BBT_USE_FLASH.

    Again, this flag is found in bbm.h and so should NOT be used in the
    "nand_chip.options" field.

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

    Brian Norris
     
  • This patch works with the following three flags from two headers (nand.h
    and bbm.h):
    (1) NAND_USE_FLASH_BBT (nand.h)
    (2) NAND_USE_FLASH_BBT_NO_OOB (nand.h)
    (3) NAND_BBT_NO_OOB (bbm.h)

    These flags are all related and interdependent, yet they were in
    different headers. Flag (2) is simply the combination of (1) and (3) and
    can be eliminated.

    This patch accomplishes the following:
    * eliminate NAND_USE_FLASH_BBT_NO_OOB (i.e., flag (2))
    * move NAND_USE_FLASH_BBT (i.e., flag (1)) to bbm.h

    It's important to note that because (1) and (3) are now both found in
    bbm.h, they should NOT be used in the "nand_chip.options" field.

    I removed a small section from the mtdnand DocBook because it referes to
    NAND_USE_FLASH_BBT in nand.h, which has been moved to bbm.h.

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

    Brian Norris
     
  • This patch handles the problems we've been having with using conflicting
    flags from nand.h and bbm.h in the same nand_chip.options field. We
    should try to separate these two spaces a little more clearly, and so I
    have added a bbt_options field to nand_chip.

    Important notes about nand_chip fields:
    * bbt_options field should contain ONLY flags from bbm.h. They should be
    able to pass safely to a nand_bbt_descr data structure.
    - BBT option flags start with the "NAND_BBT_" prefix.
    * options field should contian ONLY flags from nand.h. Ideally, they
    should not be involved in any BBT related options.
    - NAND chip option flags start with the "NAND_" prefix.
    * Every flag should have a nice comment explaining what the flag is. While
    this is not yet the case on all existing flags, please be sure to write
    one for new flags. Even better, you can help document the code better
    yourself!

    Please try to follow these conventions to make everyone's lives easier.

    Among the flags that are being moved to the new bbt_options field
    throughout various drivers, etc. are:
    * NAND_BBT_SCANLASTPAGE
    * NAND_BBT_SCAN2NDPAGE
    and there will be more to come.

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

    Brian Norris
     
  • This patch reverts most of:
    commit 58373ff0afff4cc8ac40608872995f4d87eb72ec
    mtd: nand: more BB Detection refactoring and dynamic scan options

    According to the discussion at:
    http://lists.infradead.org/pipermail/linux-mtd/2011-May/035696.html
    the NAND_BBT_SCANBYTE1AND6 flag, although technically valid, can break
    some existing ECC layouts that use the 6th byte in the OOB for ECC data.
    Furthermore, we apparently do not need to scan both bytes 1 and 6 in
    the OOB region of the devices under consideration; instead, we only need
    to scan one or the other.

    Thus, the NAND_BBT_SCANBYTE1AND6 flag is at best unnecessary and at
    worst a regression.

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

    Brian Norris
     

23 Jul, 2011

1 commit

  • * 'linux-next' of git://git.infradead.org/ubi-2.6:
    UBI: clarify the volume notification types' doc
    UBI: remove dead code
    UBI: dump stack when switching to R/O mode
    UBI: fix oops in error path
    UBI: switch debugging tests knobs to debugfs
    UBI: make it possible to use struct ubi_device in debug.h
    UBI: prepare debugging stuff to further debugfs conversion
    UBI: use debugfs for the extra checks knobs
    UBI: change the interface of a debugging check function

    Linus Torvalds
     

23 Jun, 2011

1 commit


01 Jun, 2011

1 commit

  • Fix build warnings in physmap.h:

    include/linux/mtd/physmap.h:25: warning: 'struct platform_device' declared inside parameter list
    include/linux/mtd/physmap.h:25: warning: its scope is only this definition or declaration, which is probably not what you want
    include/linux/mtd/physmap.h:26: warning: 'struct platform_device' declared inside parameter list
    include/linux/mtd/physmap.h:27: warning: 'struct platform_device' declared inside parameter list

    Signed-off-by: Randy Dunlap
    Signed-off-by: David Woodhouse

    Randy Dunlap
     

28 May, 2011

1 commit

  • * git://git.infradead.org/mtd-2.6: (97 commits)
    mtd: kill CONFIG_MTD_PARTITIONS
    mtd: remove add_mtd_partitions, add_mtd_device and friends
    mtd: convert remaining users to mtd_device_register()
    mtd: samsung onenand: convert to mtd_device_register()
    mtd: omap2 onenand: convert to mtd_device_register()
    mtd: txx9ndfmc: convert to mtd_device_register()
    mtd: tmio_nand: convert to mtd_device_register()
    mtd: socrates_nand: convert to mtd_device_register()
    mtd: sharpsl: convert to mtd_device_register()
    mtd: s3c2410 nand: convert to mtd_device_register()
    mtd: ppchameleonevb: convert to mtd_device_register()
    mtd: orion_nand: convert to mtd_device_register()
    mtd: omap2: convert to mtd_device_register()
    mtd: nomadik_nand: convert to mtd_device_register()
    mtd: ndfc: convert to mtd_device_register()
    mtd: mxc_nand: convert to mtd_device_register()
    mtd: mpc5121_nfc: convert to mtd_device_register()
    mtd: jz4740_nand: convert to mtd_device_register()
    mtd: h1910: convert to mtd_device_register()
    mtd: fsmc_nand: convert to mtd_device_register()
    ...

    Fixed up trivial conflicts in
    - drivers/mtd/maps/integrator-flash.c: removed in ARM tree
    - drivers/mtd/maps/physmap.c: addition of afs partition probe type
    clashing with removal of CONFIG_MTD_PARTITIONS

    Linus Torvalds
     

25 May, 2011

1 commit

  • Now that none of the drivers use CONFIG_MTD_PARTITIONS we can remove
    it from Kconfig and the last remaining uses.

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

    Jamie Iles