1. Jun 08, 2018
    • Boris Brezillon's avatar
      Merge tag 'nand/for-4.18' of git://git.infradead.org/linux-mtd into mtd/next · 6e89b84e
      Boris Brezillon authored
      Core changes:
      - Add Miquel as a NAND maintainer
      - Add access mode to the nand_page_io_req struct
      - Fix kernel-doc in rawnand.h
      - Support bit-wise majority to recover from corrupted ONFI parameter
        pages
      - Stop checking FAIL bit after a SET_FEATURES, as documented in the
        ONFI spec
      
      Raw NAND Driver changes:
      - Fix and cleanup the error path of many NAND controller drivers
      - GPMI:
        * Cleanup/simplification of a few aspects in the driver
        * Take ECC setup specified in the DT into account
      - sunxi: remove support for GPIO-based R/B polling
      - MTK:
        * Use of_device_get_match_data() instead of of_match_device()
        * Add an entry in MAINTAINERS for this driver
        * Fix nand-ecc-step-size and nand-ecc-strength description in the DT
          bindings doc
      - fsl_ifc: fix ->cmdfunc() to read more than one ONFI parameter page
      
      OneNAND driver changes:
      - samsung: use dev_get_drvdata() instead of platform_get_drvdata()
      6e89b84e
  2. Jun 01, 2018
  3. May 31, 2018
  4. May 23, 2018
  5. May 16, 2018
    • Boris Brezillon's avatar
      mtd: rawnand: Do not check FAIL bit when executing a SET_FEATURES op · 782d1967
      Boris Brezillon authored
      The ONFI spec clearly says that FAIL bit is only valid for PROGRAM,
      ERASE and READ-with-on-die-ECC operations, and should be ignored
      otherwise.
      
      It seems that checking it after sending a SET_FEATURES is a bad idea
      because a previous READ, PROGRAM or ERASE op may have failed, and
      depending on the implementation, the FAIL bit is not cleared until a
      new READ, PROGRAM or ERASE is started.
      
      This leads to ->set_features() returning -EIO while it actually worked,
      which can sometimes stop a batch of READ/PROGRAM ops.
      
      Note that we only fix the ->exec_op() path here, because some drivers
      are abusing the NAND_STATUS_FAIL flag in their ->waitfunc()
      implementation to propagate other kind of errors, like
      wait-ready-timeout or controller-related errors. Let's not try to fix
      those drivers since they worked fine so far.
      
      Fixes: 8878b126
      
       ("mtd: nand: add ->exec_op() implementation")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      Acked-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      782d1967
  6. May 13, 2018
  7. May 12, 2018
    • Tokunori Ikegami's avatar
      mtd: cfi_cmdset_0002: Fix coding style issues · ea092fb3
      Tokunori Ikegami authored
      
      
      This patch fixes mainly to remove unneeded spaces after '(' and before ')'.
      Also some indentation errors are fixed.
      
      Signed-off-by: default avatarTokunori Ikegami <ikegami@allied-telesis.co.jp>
      Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
      Cc: Marek Vasut <marek.vasut@gmail.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
      Cc: linux-mtd@lists.infradead.org
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      ea092fb3
    • Rafał Miłecki's avatar
      mtd: bcm47xxpart: improve handling TRX partition size · 237ea0d4
      Rafał Miłecki authored
      
      
      When bcm47xxpart finds a TRX partition (container) it's supposed to jump
      to the end of it and keep looking for more partitions. TRX and its
      subpartitions are handled by a separate parser.
      
      The problem with old code was relying on the length specified in a TRX
      header. That isn't reliable as TRX is commonly modified to have checksum
      cover only non-changing subpartitions. Otherwise modifying e.g. a rootfs
      would result in CRC32 mismatch and bootloader refusing to boot a
      firmware.
      
      Fix it by trying better to figure out a real TRX size. We can securely
      assume that TRX has to cover all subpartitions and the last one is at
      least of a block size in size. Then compare it with a length field.
      
      This makes code more optimal & reliable thanks to skipping data that
      shouldn't be parsed.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      237ea0d4
  8. May 09, 2018
    • Mauro Carvalho Chehab's avatar
      mtd: rawnand.h: use nested union kernel-doc markups · a6766880
      Mauro Carvalho Chehab authored
      
      
      Gets rid of those warnings and better document the parameters.
      
        ./include/linux/mtd/rawnand.h:752: warning: Function parameter or member 'timings.sdr' not described in 'nand_data_interface'
        ./include/linux/mtd/rawnand.h:817: warning: Function parameter or member 'buf' not described in 'nand_op_data_instr'
        ./include/linux/mtd/rawnand.h:817: warning: Function parameter or member 'buf.in' not described in 'nand_op_data_instr'
        ./include/linux/mtd/rawnand.h:817: warning: Function parameter or member 'buf.out' not described in 'nand_op_data_instr'
        ./include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx' not described in 'nand_op_instr'
        ./include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.cmd' not described in 'nand_op_instr'
        ./include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_instr'
        ./include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.data' not described in 'nand_op_instr'
        ./include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.waitrdy' not described in 'nand_op_instr'
        ./include/linux/mtd/rawnand.h:1010: warning: Function parameter or member 'ctx' not described in 'nand_op_parser_pattern_elem'
        ./include/linux/mtd/rawnand.h:1010: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_parser_pattern_elem'
        ./include/linux/mtd/rawnand.h:1010: warning: Function parameter or member 'ctx.data' not described in 'nand_op_parser_pattern_elem'
        ./include/linux/mtd/rawnand.h:1313: warning: Function parameter or member 'manufacturer.desc' not described in 'nand_chip'
        ./include/linux/mtd/rawnand.h:1313: warning: Function parameter or member 'manufacturer.priv' not described in 'nand_chip'
      
        ./include/linux/mtd/rawnand.h:848: WARNING: Unexpected indentation.
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      a6766880
    • Jane Wan's avatar
      mtd: rawnand: fsl_ifc: fix FSL NAND driver to read all ONFI parameter pages · a75bbe71
      Jane Wan authored
      
      
      Per ONFI specification (Rev. 4.0), if the CRC of the first parameter page
      read is not valid, the host should read redundant parameter page copies.
      Fix FSL NAND driver to read the two redundant copies which are mandatory
      in the specification.
      
      Signed-off-by: default avatarJane Wan <Jane.Wan@nokia.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      a75bbe71
  9. May 07, 2018
    • 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
  10. May 04, 2018
    • Aaron Sierra's avatar
      mtd: cfi: Add early fixup for S70GL02GS · 0fe3ede7
      Aaron Sierra authored
      
      
      S70GL02GS flash reports a single 256 MiB chip, but is really made up
      of two 128 MiB chips with 1024 sectors each.
      
      Without early fixups (top half of device cannot be written or erased):
        ff0000000.nor-boot: Found 1 x16 devices at 0x0 in 16-bit bank. <snip>
        Amd/Fujitsu Extended Query Table at 0x0040
          Amd/Fujitsu Extended Query version 1.5.
        number of CFI chips: 1
      
      With early fixups (entire device can be written and erased):
        Bad S70GL02GS CFI data; adjust to detect 2 chips
        ff0000000.nor-boot: Found 1 x16 devices at 0x0 in 16-bit bank. <snip>
        ff0000000.nor-boot: Found 1 x16 devices at 0x8000000 in 16-bit bank
        Amd/Fujitsu Extended Query Table at 0x0040
          Amd/Fujitsu Extended Query version 1.5.
        number of CFI chips: 2
      
      Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      0fe3ede7
    • Aaron Sierra's avatar
      mtd: cfi: Support early CFI fixups · b1c97e23
      Aaron Sierra authored
      
      
      Some CFI devices need fixups that affect the number of chips detected,
      but the current fixup infrastructure (struct cfi_fixup and cfi_fixup())
      does not cover this situation.
      
      Introduce struct cfi_early_fixup and cfi_early_fixup() to fill the void.
      
      Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      b1c97e23
  11. May 03, 2018
  12. Apr 30, 2018
  13. Apr 29, 2018