1. 11 5月, 2020 8 次提交
  2. 30 3月, 2020 1 次提交
  3. 25 3月, 2020 1 次提交
  4. 11 3月, 2020 1 次提交
  5. 09 3月, 2020 2 次提交
  6. 05 10月, 2019 1 次提交
    • P
      mtd: rawnand: Change calculating of position page containing BBM · a3c4c233
      Piotr Sroka 提交于
      Change calculating of position page containing BBM
      
      If none of BBM flags are set then function nand_bbm_get_next_page
      reports EINVAL. It causes that BBM is not read at all during scanning
      factory bad blocks. The result is that the BBT table is build without
      checking factory BBM at all. For Micron flash memories none of these
      flags are set if page size is different than 2048 bytes.
      
      Address this regression by:
      - adding NAND_BBM_FIRSTPAGE chip flag without any condition. It solves
        issue only for Micron devices.
      - changing the nand_bbm_get_next_page_function. It will return 0
        if no of BBM flag is set and page parameter is 0. After that modification
        way of discovering factory bad blocks will work similar as in kernel
        version 5.1.
      
      Cc: stable@vger.kernel.org
      Fixes: f90da781 (mtd: rawnand: Support bad block markers in first, second or last page)
      Signed-off-by: NPiotr Sroka <piotrs@cadence.com>
      Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      a3c4c233
  7. 08 8月, 2019 1 次提交
  8. 28 6月, 2019 2 次提交
  9. 19 6月, 2019 1 次提交
  10. 21 5月, 2019 1 次提交
  11. 18 4月, 2019 5 次提交
  12. 08 4月, 2019 9 次提交
  13. 05 2月, 2019 4 次提交
    • M
      mtd: rawnand: check return code of nand_reset() and nand_readid_op() · f9ffb406
      Masahiro Yamada 提交于
      nand_scan_ident() iterates over maxchips to find as many homogeneous
      chips as possible.
      
      Since commit 2d472aba ("mtd: nand: document the NAND
      controller/NAND chip DT representation"), new drivers should pass in
      the exact number of CS lines instead of possible max, but old
      platforms may still rely on nand_scan_ident() to detect the actual
      number of connected CS lines.
      
      In that case, this loop bails out when manufacturer or device ID
      unmatches. The reason of unmatch is most likely no chip is connected
      to that CS line. If so, nand_reset() should already have failed,
      and the following nand_readid_op() is pointless.
      
      Before ->exec_op hook was introduced, drivers had no way to tell
      the failure of NAND_CMD_RESET to the framework because the legacy
      ->cmdfunc() has void return type. Now drivers implementing ->exec_op
      hook can return the error code. You can save nand_readid_op() by
      checking the return value of nand_reset(). The return value of
      nand_readid_op() should be checked as well. If it fails, probably
      id[0] and id[1] are undefined values.
      
      Just for consistency, it should be sensible to check the return
      code in nand_do_write_oob() as well.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      f9ffb406
    • M
      mtd: rawnand: remove ->legacy.erase and single_erase() · 2d73f3d6
      Masahiro Yamada 提交于
      Now that the last user of this hook, denali.c, stopped using it,
      we can remove the erase hook from nand_legacy.
      
      I squashed single_erase() because only the difference between
      single_erase() and nand_erase_op() is the number of bit shifts.
      
      The status/ret conversion in nand_erase_nand() is unneeded since
      commit eb94555e ("mtd: nand: use usual return values for the
      ->erase() hook"). Cleaned it up now.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      2d73f3d6
    • M
      mtd: rawnand: Annotate implicit fall through in nand_scan_tail · 3175e121
      Mathieu Malaterre 提交于
      There is a plan to build the kernel with -Wimplicit-fallthrough and
      these places in the code produced warnings (W=1).
      
      This commit removes the following warnings:
      
        drivers/mtd/nand/raw/nand_base.c:5556:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
        drivers/mtd/nand/raw/nand_base.c:5575:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
        drivers/mtd/nand/raw/nand_base.c:5613:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
      Signed-off-by: NMathieu Malaterre <malat@debian.org>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      3175e121
    • B
      mtd: rawnand: Simplify the locking · 013e6292
      Boris Brezillon 提交于
      nand_get_device() was complex for apparently no good reason. Let's
      replace this locking scheme with 2 mutexes: one attached to the
      controller and another one attached to the chip.
      
      Every time the core calls nand_get_device(), it will first lock the
      chip and if the chip is not suspended, will then lock the controller.
      nand_release_device() will release both lock in the reverse order.
      
      nand_get_device() can sleep, just like the previous implementation,
      which means you should never call that from an atomic context.
      
      We also get rid of
      
      - the chip->state field, since all it was used for was flagging the
        chip as suspended. We replace it by a field called chip->suspended
        and directly set it from nand_suspend/resume()
      - the controller->wq and controller->active fields which are no longer
        needed since the new controller->lock (now a mutex) guarantees that
        all operations are serialized at the controller level
      - panic_nand_get_device() which would anyway be a no-op. Talking about
        panic write, I keep thinking the rawnand implementation is unsafe
        because there's not negotiation with the controller to know when it's
        actually done with it's previous operation. I don't intend to fix
        that here, but that's probably something we should look at, or maybe
        we should consider dropping the ->_panic_write() implementation
      
      Last important change to mention: we now return -EBUSY when someone
      tries to access a device that as been suspended, and propagate this
      error to the upper layer.
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      013e6292
  14. 31 1月, 2019 1 次提交
    • R
      mtd: rawnand: fix kernel-doc warnings · 455e7b38
      Randy Dunlap 提交于
      Fix kernel-doc warnings in drivers/mtd/nand/raw:
      
      ../drivers/mtd/nand/raw/nand_base.c:420: warning: Function parameter or member 'chip' not described in 'nand_fill_oob'
      ../drivers/mtd/nand/raw/nand_bbt.c:173: warning: Function parameter or member 'this' not described in 'read_bbt'
      ../drivers/mtd/nand/raw/nand_bbt.c:173: warning: Excess function parameter 'chip' description in 'read_bbt'
      
      Fixes: 0813621b ("mtd: rawnand: Stop passing mtd_info objects to internal functions")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Boris Brezillon <boris.brezillon@bootlin.com>
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: linux-mtd@lists.infradead.org
      Acked-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org>
      455e7b38
  15. 07 12月, 2018 2 次提交