1. 18 7月, 2012 3 次提交
  2. 06 7月, 2012 4 次提交
    • H
      mtd: nandsim: don't open code a do_div helper · 596fd462
      Herton Ronaldo Krzesinski 提交于
      We don't need to open code the divide function, just use div_u64 that
      already exists and do the same job. While this is a straightforward
      clean up, there is more to that, the real motivation for this.
      
      While building on a cross compiling environment in armel, using gcc
      4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5), I was getting the following build
      error:
      
      ERROR: "__aeabi_uldivmod" [drivers/mtd/nand/nandsim.ko] undefined!
      
      After investigating with objdump and hand built assembly version
      generated with the compiler, I narrowed __aeabi_uldivmod as being
      generated from the divide function. When nandsim.c is built with
      -fno-inline-functions-called-once, that happens when
      CONFIG_DEBUG_SECTION_MISMATCH is enabled, the do_div optimization in
      arch/arm/include/asm/div64.h doesn't work as expected with the open
      coded divide function: even if the do_div we are using doesn't have a
      constant divisor, the compiler still includes the else parts of the
      optimized do_div macro, and translates the divisions there to use
      __aeabi_uldivmod, instead of only calling __do_div_asm -> __do_div64 and
      optimizing/removing everything else out.
      
      So to reproduce, gcc 4.6 plus CONFIG_DEBUG_SECTION_MISMATCH=y and
      CONFIG_MTD_NAND_NANDSIM=m should do it, building on armel.
      
      After this change, the compiler does the intended thing even with
      -fno-inline-functions-called-once, and optimizes out as expected the
      constant handling in the optimized do_div on arm. As this also avoids a
      build issue, I'm marking for Stable, as I think is applicable for this
      case.
      Signed-off-by: NHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
      Cc: stable@vger.kernel.org
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      596fd462
    • S
      mtd: gpmi-nand: fix read page when reading to vmalloced area · 6023813a
      Sascha Hauer 提交于
      The gpmi-nand driver uses virt_addr_valid() to check whether a buffer
      is suitable for dma. If it's not, a driver allocated buffer is used
      instead. Then after a page read the driver allocated buffer must be
      copied to the user supplied buffer. This does not happen since commit
      7725cc85.
      
      This patch fixes the issue. The bug is encountered with UBI which uses a
      vmalloced buffer for the volume table.
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Tested-by: snijsure@grid-net.com
      Acked-by: NHuang Shijie <b32955@freescale.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      6023813a
    • S
      mtd: mxc_nand: use 32bit copy functions · 096bcc23
      Sascha Hauer 提交于
      The following commit changes the function used to copy from/to
      the hardware buffer to memcpy_[from|to]io. This does not work
      since the hardware cannot handle the byte accesses used by these
      functions. Instead of reverting this patch introduce 32bit
      correspondents of these functions.
      
      | commit 5775ba36ea9c760c2d7e697dac04f2f7fc95aa62
      | Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      | Date:   Tue Apr 24 10:05:22 2012 +0200
      |
      |    mtd: mxc_nand: fix several sparse warnings about incorrect address space
      |
      |     Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      |     Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      096bcc23
    • D
      mtd: cafe_nand: fix an & vs | mistake · 48f8b641
      Dan Carpenter 提交于
      The intent here was clearly to set result to true if the 0x40000000 flag
      was set.  But instead there was a | vs & typo and we always set result
      to true.
      
      Artem: check the spec at
      wiki.laptop.org/images/5/5c/88ALP01_Datasheet_July_2007.pdf
      and this fix looks correct.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      48f8b641
  3. 27 6月, 2012 1 次提交
  4. 16 6月, 2012 1 次提交
  5. 09 6月, 2012 1 次提交
  6. 07 6月, 2012 2 次提交
  7. 02 6月, 2012 4 次提交
  8. 29 5月, 2012 2 次提交
    • D
      mtd: nand: fix scan_read_raw_oob · 34a5704d
      Dmitry Maluka 提交于
      It seems there is a bug in scan_read_raw_oob() in nand_bbt.c which
      should cause wrong functioning of NAND_BBT_SCANALLPAGES option.
      
      Artem: the patch did not apply and I had to amend it a bit.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Cc: stable@kernel.org
      34a5704d
    • R
      mtd: docg3 fix in-middle of blocks reads · 52c2d9aa
      Robert Jarzmik 提交于
      Corner case reads do not work, and return false data and
      ECC. This case is typically seen in a ubifs usage, with a
      read of type:
       - docg3 docg3: doc_read_oob(from=14882415, mode=1,
       data=(c30eca40:12), oob=(  (null):0))
      
      This results in the following reads:
       - docg3 docg3: doc_read_data_area(buf=  (null), len=111)
       - docg3 docg3: doc_read_data_area(buf=c30eca40, len=12)
       - docg3 docg3: doc_read_data_area(buf=  (null), len=389)
       - docg3 docg3: doc_read_data_area(buf=  (null), len=0)
       - docg3 docg3: doc_read_data_area(buf=  (null), len=16)
      
      If we suppose that the pages content is :
       - bytes 0 .. 111   : 0x0a
       - bytes 112 .. 255 : 0x0f
      Then the returned bytes will be :
       - 111 times 0x0a (correct)
       - 0x0a 2 times and 0x0f 10 times (incorrect, should be
       0x0a,0x0f)
       - 0x0f 389 times (correct)
       - nothing
       - correct OOB
      
      The reason seams that the first 111 bytes read ends between
      the 2 docg3 planes, and that the first following read (in
      the 12 bytes sequence, read of 16 bit word) returns the byte
      of the rightmost plane duplicated in high and lower byte of
      the word.
      
      Fix this behaviour by ensuring that if the previous read
      ended up in-between the 2 planes, there will be a first 1
      byte read to get back to the beginning of leftmost plane.
      Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      52c2d9aa
  9. 21 5月, 2012 22 次提交