1. 28 10月, 2016 1 次提交
  2. 04 10月, 2016 1 次提交
  3. 23 9月, 2016 28 次提交
  4. 19 9月, 2016 3 次提交
    • L
      mtd: nand: mxc: fix obiwan error in mxc_nand_v[12]_ooblayout_free() functions · 38178e7b
      Lothar Waßmann 提交于
      commit a894cf6c ("mtd: nand: mxc: switch to mtd_ooblayout_ops")
      introduced a regression accessing the OOB area from the mxc_nand
      driver due to an Obiwan error in the mxc_nand_v[12]_ooblayout_free()
      functions. They report a bogus oobregion { 64, 7 } which leads to
      errors accessing bogus data when reading the oob area.
      
      Prior to the commit the mtd-oobtest module could be run without any
      errors. With the offending commit, this test fails with results like:
      |Running mtd-oobtest
      |
      |=================================================
      |mtd_oobtest: MTD device: 5
      |mtd_oobtest: MTD device size 524288, eraseblock size 131072, page size 2048, count of eraseblocks 4, pages per eraseblock 64, OOB size 64
      |mtd_test: scanning for bad eraseblocks
      |mtd_test: scanned 4 eraseblocks, 0 are bad
      |mtd_oobtest: test 1 of 5
      |mtd_oobtest: writing OOBs of whole device
      |mtd_oobtest: written up to eraseblock 0
      |mtd_oobtest: written 4 eraseblocks
      |mtd_oobtest: verifying all eraseblocks
      |mtd_oobtest: error @addr[0x0:0x19] 0x9a -> 0x78 diff 0xe2
      |mtd_oobtest: error @addr[0x0:0x1a] 0xcc -> 0x0 diff 0xcc
      |mtd_oobtest: error @addr[0x0:0x1b] 0xe0 -> 0x85 diff 0x65
      |mtd_oobtest: error @addr[0x0:0x1c] 0x60 -> 0x62 diff 0x2
      |mtd_oobtest: error @addr[0x0:0x1d] 0x69 -> 0x45 diff 0x2c
      |mtd_oobtest: error @addr[0x0:0x1e] 0xcd -> 0xa0 diff 0x6d
      |mtd_oobtest: error @addr[0x0:0x1f] 0xf2 -> 0x60 diff 0x92
      |mtd_oobtest: error: verify failed at 0x0
      [...]
      Signed-off-by: NLothar Waßmann <LW@KARO-electronics.de>
      Fixes: a894cf6c ("mtd: nand: mxc: switch to mtd_ooblayout_ops")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      38178e7b
    • R
      mtd: nand: fix chances to create incomplete ECC data when writing · 559e58e7
      RogerCC Lin 提交于
      When mtk_nfc_do_write_page() comparing the sector number,because the
      sector number field is at the 12th-bit position of NFI_BYTELEN
      register,the masked register should be shifted 12 bits before being
      compared.The result of this bug may cause the second subpage has
      incomplete ECC parity bytes.
      Signed-off-by: NRogerCC Lin <rogercc.lin@mediatek.com>
      Fixes: 1d6b1e46 ("mtd: mediatek: driver for MTK Smart Device")
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      559e58e7
    • R
      mtd: nand: fix generating over-boundary ECC data when writing · 7a353289
      RogerCC Lin 提交于
      When mtk_ecc_encode() is writing the ECC parity data to the OOB
      region,because each register is 4 bytes in length,but the len's unit is
      in bytes,the operation in the for loop will cross the ECC's boundary.
      Signed-off-by: NRogerCC Lin <rogercc.lin@mediatek.com>
      Fixes: 1d6b1e46 ("mtd: mediatek: driver for MTK Smart Device")
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      7a353289
  5. 10 9月, 2016 1 次提交
    • K
      mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl · f6d7c1b5
      Karl Beldan 提交于
      This fixes subpage writes when using 4-bit HW ECC.
      
      There has been numerous reports about ECC errors with devices using this
      driver for a while.  Also the 4-bit ECC has been reported as broken with
      subpages in [1] and with 16 bits NANDs in the driver and in mach* board
      files both in mainline and in the vendor BSPs.
      
      What I saw with 4-bit ECC on a 16bits NAND (on an LCDK) which got me to
      try reinitializing the ECC engine:
      - R/W on whole pages properly generates/checks RS code
      - try writing the 1st subpage only of a blank page, the subpage is well
        written and the RS code properly generated, re-reading the same page
        the HW detects some ECC error, reading the same page again no ECC
        error is detected
      
      Note that the ECC engine is already reinitialized in the 1-bit case.
      
      Tested on my LCDK with UBI+UBIFS using subpages.
      This could potentially get rid of the issue workarounded in [1].
      
      [1] 28c015a9 ("mtd: davinci-nand: disable subpage write for keystone-nand")
      
      Fixes: 6a4123e5 ("mtd: nand: davinci_nand, 4-bit ECC for smallpage")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NKarl Beldan <kbeldan@baylibre.com>
      Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      f6d7c1b5
  6. 30 8月, 2016 1 次提交
  7. 20 7月, 2016 1 次提交
    • H
      mtd: nand: fix bug writing 1 byte less than page size · 144f4c98
      Hector Palacios 提交于
      nand_do_write_ops() determines if it is writing a partial page with the
      formula:
      	part_pagewr = (column || writelen < (mtd->writesize - 1))
      
      When 'writelen' is exactly 1 byte less than the NAND page size the formula
      equates to zero, so the code doesn't process it as a partial write,
      although it should.
      As a consequence the function remains in the while(1) loop with 'writelen'
      becoming 0xffffffff and iterating endlessly.
      
      The bug may not be easy to reproduce in Linux since user space tools
      usually force the padding or round-up the write size to a page-size
      multiple.
      This was discovered in U-Boot where the issue can be reproduced by
      writing any size that is 1 byte less than a page-size multiple.
      For example, on a NAND with 2K page (0x800):
      	=> nand erase.part <partition>
      	=> nand write $loadaddr <partition> 7ff
      
      [Editor's note: the bug was added in commit 29072b96, but moved
      around in commit 66507c7b ("mtd: nand: Add support to use nand_base
      poi databuf as bounce buffer")]
      
      Fixes: 29072b96 ("[MTD] NAND: add subpage write support")
      Signed-off-by: NHector Palacios <hector.palacios@digi.com>
      Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      144f4c98
  8. 17 7月, 2016 1 次提交
  9. 16 7月, 2016 1 次提交
  10. 14 7月, 2016 2 次提交