An error occurred fetching the project authors.
  1. 16 Jan, 2019 1 commit
  2. 06 Dec, 2018 1 commit
  3. 02 Dec, 2018 2 commits
    • Rafał Miłecki's avatar
      mtd: keep original flags for every struct mtd_info · 1186af45
      Rafał Miłecki authored
      When allocating a new partition mtd subsystem runs internal tests in the
      allocate_partition(). They may result in modifying specified flags (e.g.
      dropping some /features/ like write access).
      
      Those constraints don't have to be necessary true for subpartitions. It
      may happen parent partition isn't block aligned (effectively disabling
      write access) while subpartition may fit blocks nicely. In such case all
      checks should be run again (starting with original flags value).
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      1186af45
    • Miquel Raynal's avatar
      mtd: fix Coverity integer handling issue · 89f706db
      Miquel Raynal authored
      A Coverity robot reported an integer handling issue
      (OVERFLOW_BEFORE_WIDEN) in the potentially overflowing expression:
      
          (mtd_div_by_ws(mtd->size, mtd) - mtd_div_by_ws(offs, mtd)) *
          mtd_oobavail(mtd, ops)
      
      While such overflow will certainly never happen due to the numbers
      handled, it is cleaner to fix this operation anyway.
      
      The problem is that all the maths include 32-bit quantities, while the
      result is stored in an explicit 64-bit value.
      
      As maxooblen will just be compared with a size_t, let's change the
      type of the variable to a size_t. This will not fix anything but will
      clarify a bit the situation. Then, do an explicit cast to fix Coverity
      warning.
      Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      89f706db
  4. 18 Jul, 2018 1 commit
    • Miquel Raynal's avatar
      mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing · 89fd23ef
      Miquel Raynal authored
      Some MTD sublayers/drivers are implementing ->_read/write() and
      not ->_read/write_oob().
      
      While for NAND devices both are usually valid, for NOR devices, using
      the _oob variant has no real meaning. But, as the MTD layer is supposed
      to hide as much as possible the flash complexity to the user, there is
      no reason to error out while it is just a matter of rewritting things
      internally.
      
      Add a fallback on mtd->_read() (resp. mtd->_write()) when the user calls
      mtd_read_oob() (resp. mtd_write_oob()) while mtd->_read_oob() (resp.
      mtd->_write_oob) is not implemented. There is already a fallback on the
      _oob variant if the former is used.
      Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      89fd23ef
  5. 16 May, 2018 1 commit
  6. 07 May, 2018 1 commit
    • Rafał Miłecki's avatar
      mtd: move code adding (registering) partitions to the parse_mtd_partitions() · 5ac67ce3
      Rafał Miłecki authored
      This commit slightly simplifies the code. Every parse_mtd_partitions()
      caller (out of two existing ones) had to add partitions & cleanup parser
      on its own. This moves that responsibility into the function.
      
      That change also allows dropping struct mtd_partitions argument.
      
      There is one minor behavior change caused by this cleanup. If
      parse_mtd_partitions() fails to add partitions (add_mtd_partitions()
      return an error) then mtd_device_parse_register() will still try to
      add (register) fallback partitions. It's a real corner case affecting
      one of uncommon error paths and shouldn't cause any harm.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      5ac67ce3
  7. 22 Apr, 2018 1 commit
  8. 29 Mar, 2018 2 commits
  9. 21 Mar, 2018 1 commit
  10. 15 Mar, 2018 2 commits
  11. 12 Feb, 2018 3 commits
  12. 16 Jan, 2018 1 commit
  13. 06 Jan, 2018 1 commit
  14. 18 Dec, 2017 1 commit
  15. 13 Nov, 2017 2 commits
  16. 21 Aug, 2017 1 commit
  17. 21 Jul, 2017 1 commit
  18. 08 Jul, 2017 1 commit
  19. 20 Apr, 2017 2 commits
  20. 08 Feb, 2017 1 commit
  21. 01 Dec, 2016 1 commit
  22. 19 Nov, 2016 3 commits
  23. 11 Oct, 2016 1 commit
  24. 15 Sep, 2016 1 commit
    • Boris Brezillon's avatar
      mtd: introduce the mtd_pairing_scheme concept · 477b0229
      Boris Brezillon authored
      MLC and TLC NAND devices are using NAND cells exposing more than one bit,
      but instead of attaching all the bits in a given cell to a single NAND
      page, each bit is usually attached to a different page. This concept is
      called 'page pairing', and has significant impacts on the flash storage
      usage.
      The main problem showed by these devices is that interrupting a page
      program operation may not only corrupt the page we are programming
      but also the page it is paired with, hence the need to expose to MTD
      users the pairing scheme information.
      
      The pairing APIs allows one to query pairing information attached to a
      given page (here called wunit), or the other way around (the wunit
      pointed by pairing information).
      It also provides several helpers to help the conversion between absolute
      offsets and wunits, and query the number of pairing groups.
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Reviewed-by: default avatarBrian Norris <computersforpeace@gmail.com>
      477b0229
  25. 05 May, 2016 1 commit
  26. 19 Apr, 2016 2 commits
    • Boris Brezillon's avatar
      mtd: create an mtd_ooblayout_ops struct to ease ECC layout definition · adbbc3bc
      Boris Brezillon authored
      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: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      adbbc3bc
    • Boris Brezillon's avatar
      mtd: add mtd_ooblayout_xxx() helper functions · 75eb2cec
      Boris Brezillon authored
      In order to make the ecclayout definition completely dynamic we need to
      rework the way the OOB layout are defined and iterated.
      
      Create a few mtd_ooblayout_xxx() helpers to ease OOB bytes manipulation
      and hide ecclayout internals to their users.
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      75eb2cec
  27. 13 Apr, 2016 2 commits
  28. 04 Jan, 2016 1 commit
    • Brian Norris's avatar
      mtd: fix cmdlinepart parser, early naming for auto-filled MTD · 472b444e
      Brian Norris authored
      Commit 807f16d4 ("mtd: core: set some defaults when dev.parent is
      set") attempted to provide some default settings for MTDs that
       (a) assign the parent device and
       (b) don't provide their own name or owner
      
      However, this isn't a perfect drop-in replacement for the boilerplate
      found in some drivers, because the MTD name is used by partition
      parsers like cmdlinepart, but the name isn't set until add_mtd_device(),
      after the parsing is completed. This means cmdlinepart sees a NULL name
      and therefore will not work properly.
      
      Fix this by moving the default name and owner assignment to be first in
      the MTD registration process.
      
      [Note: this does not fix all reported issues, particularly with NAND
      drivers. Will require an additional fix for drivers/mtd/nand/]
      
      Fixes: 807f16d4 ("mtd: core: set some defaults when dev.parent is set")
      Reported-by: default avatarHeiko Schocher <hs@denx.de>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Cc: Heiko Schocher <hs@denx.de>
      Cc: Frans Klaver <fransklaver@gmail.com>
      472b444e
  29. 09 Dec, 2015 1 commit