1. 19 Sep, 2016 3 commits
    • Lothar Waßmann's avatar
      mtd: nand: mxc: fix obiwan error in mxc_nand_v[12]_ooblayout_free() functions · 38178e7b
      Lothar Waßmann authored
      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: default avatarLothar Waßmann <LW@KARO-electronics.de>
      Fixes: a894cf6c ("mtd: nand: mxc: switch to mtd_ooblayout_ops")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      38178e7b
    • RogerCC Lin's avatar
      mtd: nand: fix chances to create incomplete ECC data when writing · 559e58e7
      RogerCC Lin authored
      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: default avatarRogerCC Lin <rogercc.lin@mediatek.com>
      Fixes: 1d6b1e46 ("mtd: mediatek: driver for MTK Smart Device")
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      559e58e7
    • RogerCC Lin's avatar
      mtd: nand: fix generating over-boundary ECC data when writing · 7a353289
      RogerCC Lin authored
      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: default avatarRogerCC Lin <rogercc.lin@mediatek.com>
      Fixes: 1d6b1e46 ("mtd: mediatek: driver for MTK Smart Device")
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      7a353289
  2. 09 Sep, 2016 1 commit
    • Karl Beldan's avatar
      mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl · f6d7c1b5
      Karl Beldan authored
      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: default avatarKarl Beldan <kbeldan@baylibre.com>
      Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      f6d7c1b5
  3. 29 Aug, 2016 1 commit
  4. 04 Aug, 2016 1 commit
    • Masahiro Yamada's avatar
      tree-wide: replace config_enabled() with IS_ENABLED() · 97f2645f
      Masahiro Yamada authored
      The use of config_enabled() against config options is ambiguous.  In
      practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the
      author might have used it for the meaning of IS_ENABLED().  Using
      IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc.  makes the intention
      clearer.
      
      This commit replaces config_enabled() with IS_ENABLED() where possible.
      This commit is only touching bool config options.
      
      I noticed two cases where config_enabled() is used against a tristate
      option:
      
       - config_enabled(CONFIG_HWMON)
        [ drivers/net/wireless/ath/ath10k/thermal.c ]
      
       - config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)
        [ drivers/gpu/drm/gma500/opregion.c ]
      
      I did not touch them because they should be converted to IS_BUILTIN()
      in order to keep the logic, but I was not sure it was the authors'
      intention.
      
      Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.comSigned-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Stas Sergeev <stsp@list.ru>
      Cc: Matt Redfearn <matt.redfearn@imgtec.com>
      Cc: Joshua Kinard <kumba@gentoo.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: "Dmitry V. Levin" <ldv@altlinux.org>
      Cc: yu-cheng yu <yu-cheng.yu@intel.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Nikolay Martynov <mar.kolya@gmail.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Rafal Milecki <zajec5@gmail.com>
      Cc: James Cowgill <James.Cowgill@imgtec.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alex Smith <alex.smith@imgtec.com>
      Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
      Cc: Qais Yousef <qais.yousef@imgtec.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
      Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Roland McGrath <roland@hack.frob.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Kalle Valo <kvalo@qca.qualcomm.com>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Tony Wu <tung7970@gmail.com>
      Cc: Huaitong Han <huaitong.han@intel.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andrea Gelmini <andrea.gelmini@gelma.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rabin Vincent <rabin@rab.in>
      Cc: "Maciej W. Rozycki" <macro@imgtec.com>
      Cc: David Daney <david.daney@cavium.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      97f2645f
  5. 29 Jul, 2016 12 commits
  6. 19 Jul, 2016 4 commits
  7. 18 Jul, 2016 2 commits
  8. 16 Jul, 2016 1 commit
  9. 15 Jul, 2016 4 commits
  10. 14 Jul, 2016 1 commit
  11. 13 Jul, 2016 4 commits
  12. 11 Jul, 2016 6 commits