20 Apr, 2016

2 commits

  • ECC layout definitions are currently exposed using the nand_ecclayout
    struct which embeds oobfree and eccpos arrays with predefined size.
    This approach was acceptable when NAND chips were providing relatively
    small OOB regions, but MLC and TLC now provide OOB regions of several
    hundreds of bytes, which implies a non negligible overhead for everybody
    even those who only need to support legacy NANDs.

    Create an mtd_ooblayout_ops interface providing the same functionality
    (expose the ECC and oobfree layout) without the need for this huge
    structure.

    The mtd->ecclayout is now deprecated and should be replaced by the
    equivalent mtd_ooblayout_ops. In the meantime we provide a wrapper around
    the ->ecclayout field to ease migration to this new model.

    Signed-off-by: Boris Brezillon

    Boris Brezillon
     
  • Use the mtd_set_ecclayout() helper instead of directly assigning the
    mtd->ecclayout field.

    Signed-off-by: Boris Brezillon

    Boris Brezillon
     

19 Feb, 2015

1 commit

  • Pull MTD updates from Brian Norris:
    "NAND:

    - Add new Hisilicon NAND driver for Hip04
    - Add default reboot handler, to ensure all outstanding erase
    transactions complete in time
    - jz4740: convert to use GPIO descriptor API
    - Atmel: add support for sama5d4
    - Change default bitflip threshold to 75% of correction strength
    - Miscellaneous cleanups and bugfixes

    SPI NOR:

    - Freescale QuadSPI:
    - Fix a few probe() and remove() issues
    - Add a MAINTAINERS entry for this driver
    - Tweak transfer size to increase read performance
    - Add suspend/resume support
    - Add Micron quad I/O support
    - ST FSM SPI: miscellaneous fixes

    JFFS2:

    - gracefully handle corrupted 'offset' field found on flash

    Other:

    - bcm47xxpart: add tweaks for a few new devices
    - mtdconcat: set return lengths properly for mtd_write_oob()
    - map_ram: enable use with mtdoops
    - maps: support fallback to ROM/UBI for write-protected NOR flash"

    * tag 'for-linus-20150216' of git://git.infradead.org/linux-mtd: (46 commits)
    mtd: hisilicon: && vs & typo
    jffs2: fix handling of corrupted summary length
    mtd: hisilicon: add device tree binding documentation
    mtd: hisilicon: add a new NAND controller driver for hisilicon hip04 Soc
    mtd: avoid registering reboot notifier twice
    mtd: concat: set the return lengths properly
    mtd: kconfig: replace PPC_OF with PPC
    mtd: denali: remove unnecessary stubs
    mtd: nand: remove redundant local variable
    MAINTAINERS: add maintainer entry for FREESCALE QUAD SPI driver
    mtd: fsl-quadspi: improve read performance by increase AHB transfer size
    mtd: fsl-quadspi: Remove unnecessary 'map_failed' label
    mtd: fsl-quadspi: Remove unneeded success/error messages
    mtd: fsl-quadspi: Fix the error paths
    mtd: nand: omap: drop condition with no effect
    mtd: nand: jz4740: Convert to GPIO descriptor API
    mtd: nand: Request strength instead of bytes for soft BCH
    mtd: nand: default bitflip-reporting threshold to 75% of correction strength
    mtd: atmel_nand: introduce a new compatible string for sama5d4 chip
    mtd: atmel_nand: return max bitflips in all sectors in pmecc_correction()
    ...

    Linus Torvalds
     

06 Feb, 2015

1 commit


21 Jan, 2015

1 commit

  • Since "BDI: Provide backing device capability information [try #3]" the
    backing_dev_info structure also provides flags for the kind of mmap
    operation available in a nommu environment, which is entirely unrelated
    to it's original purpose.

    Introduce a new nommu-only file operation to provide this information to
    the nommu mmap code instead. Splitting this from the backing_dev_info
    structure allows to remove lots of backing_dev_info instance that aren't
    otherwise needed, and entirely gets rid of the concept of providing a
    backing_dev_info for a character device. It also removes the need for
    the mtd_inodefs filesystem.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Tejun Heo
    Acked-by: Brian Norris
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

27 Mar, 2012

6 commits

  • Initialization of 'erase_info->fail_addr' to MTD_FAIL_ADDR_UNKNOWN prior
    erase operation is duplicated accross several MTD drivers, and also taken
    care of by some MTD users as well.

    Harmonize it: initialize 'fail_addr' within 'mtd_erase()' interface.

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

    Shmulik Ladkani
     
  • The MTD API function now zero the 'retlen' parameter before calling
    the driver's method — do not do this again in drivers. This removes
    duplicated '*retlen = 0' assignent from the following methods:

    'mtd_point()'
    'mtd_read()'
    'mtd_write()'
    'mtd_writev()'
    'mtd_panic_write()'

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

    Artem Bityutskiy
     
  • Many drivers check whether the partition is R/O and return -EROFS if yes.
    Let's stop having duplicated checks and move them to the API functions
    instead.

    And again a bit of noise - deleted few too sparse newlines, sorry.

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

    Artem Bityutskiy
     
  • We already verify that offset and length are within the MTD device size
    in the MTD API functions. Let's remove the duplicated checks in drivers.
    This patch only affects the following API's:

    'mtd_erase()'
    'mtd_point()'
    'mtd_unpoint()'
    'mtd_get_unmapped_area()'
    'mtd_read()'
    'mtd_write()'
    'mtd_panic_write()'
    'mtd_lock()'
    'mtd_unlock()'
    'mtd_is_locked()'
    'mtd_block_isbad()'
    'mtd_block_markbad()'

    This patch adds a bit of noise by removing too sparse empty lines, but this is
    not too bad.

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

    Artem Bityutskiy
     
  • The main 'mtd_block_markbad()' function returns -EOPNOTSUPP if the
    '->block_markbad' method is undefined, and mtdconcat should do the same.
    Fix this by simply removing the 'mtd_can_have_bb()' because it is not
    really necessary. It could be treated as an optimization, but this function is
    expected to be used so rarely that it does not matter.

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

    Artem Bityutskiy
     
  • This patch renames all MTD functions by adding a "_" prefix:

    mtd->erase -> mtd->_erase
    mtd->read_oob -> mtd->_read_oob
    ...

    The reason is that we are re-working the MTD API and from now on it is
    an error to use MTD function pointers directly - we have a corresponding
    API call for every pointer. By adding a leading "_" we achieve the following:

    1. Make sure we convert every direct pointer users
    2. A leading "_" suggests that this interface is internal and it becomes
    less likely that people will use them directly
    3. Make sure all the out-of-tree modules stop compiling and the owners
    spot the big API change and amend them.

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

    Artem Bityutskiy
     

10 Jan, 2012

18 commits


21 Sep, 2011

1 commit


11 Sep, 2011

1 commit


25 May, 2011

1 commit

  • Currently mtdconcat is broken for NAND. An attemtpt to create
    JFFS2 filesystem on concatenation of several NAND devices fails
    with OOB write errors. This patch fixes that problem.

    Signed-off-by: Felix Radensky
    Signed-off-by: Artem Bityutskiy
    Cc: stable@kernel.org
    Signed-off-by: David Woodhouse

    Felix Radensky
     

11 Mar, 2011

1 commit

  • If different chips with different writebufsize are concatenated,
    the writebufsize from the concat device has to be taken from
    the device with the largest writebuffer. This writebufsize
    is used later on in the UBI layer for the min I/O size.

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

    Holger Brunck
     

06 Jan, 2011

1 commit

  • Propagate the writebufsize to the partition's MTD object so
    that UBI can set correct value for it's minimal I/O size
    using the writebufsize field of MTD object of the partition.

    By previous patches we added proper writebufsize field
    initialization. Next patch can now change UBI to use
    this field for setting the minimal I/O size.

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

    Anatolij Gustschin
     

09 Aug, 2010

1 commit


02 Aug, 2010

1 commit


16 May, 2010

1 commit

  • Use kmemdup when some other buffer is immediately copied into the
    allocated region.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    statement S;
    @@

    - to = \(kmalloc\|kzalloc\)(size,flag);
    + to = kmemdup(from,size,flag);
    if (to==NULL || ...) S
    - memcpy(to, from, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David Woodhouse

    Julia Lawall
     

20 Sep, 2009

1 commit


24 Mar, 2009

1 commit

  • Add support for direct mapping through mtdconcat, if possible, by attaching the
    samebacking_dev_info structure to the master.

    It has some restrictions:

    (1) It won't permit direct mapping of concatenated devices that have differing
    BDIs.

    (2) It doesn't support maps that span the 'gap' between devices, although it
    possibly could if the devices spanned across return compatible
    (ie. contiguous) addresses from their get_unmapped_area() ops.

    Signed-off-by: Gavin Lambert
    Signed-off-by: David Howells
    Tested-by: Bernd Schmidt
    Signed-off-by: David Woodhouse

    David Howells
     

23 Dec, 2008

1 commit