1. 04 1月, 2014 2 次提交
  2. 13 11月, 2013 1 次提交
    • H
      mtd: gpmi: fix the NULL pointer · 885d71e5
      Huang Shijie 提交于
      The imx23 board will check the fingerprint, so it will call the
      mx23_check_transcription_stamp. This function will use @chip->buffers->databuf
      as its buffer which is allocated in the nand_scan_tail().
      
      Unfortunately, the mx23_check_transcription_stamp is called before the
      nand_scan_tail(). So we will meet a NULL pointer bug:
      
      --------------------------------------------------------------------
      [    1.150000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xd7 (Samsung NAND 4GiB 3,3V 8-bit), 4096MiB, page size: 4096, OOB size: 8
      [    1.160000] Unable to handle kernel NULL pointer dereference at virtual address 000005d0
      [    1.170000] pgd = c0004000
      [    1.170000] [000005d0] *pgd=00000000
      [    1.180000] Internal error: Oops: 5 [#1] ARM
      [    1.180000] Modules linked in:
      [    1.180000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.12.0 #89
      [    1.180000] task: c7440000 ti: c743a000 task.ti: c743a000
      [    1.180000] PC is at memcmp+0x10/0x54
      [    1.180000] LR is at gpmi_nand_probe+0x42c/0x894
      [    1.180000] pc : [<c025fcb0>]    lr : [<c02f6a68>]    psr: 20000053
      [    1.180000] sp : c743be2c  ip : 600000d3  fp : ffffffff
      [    1.180000] r10: 000005d0  r9 : c02f5f08  r8 : 00000000
      [    1.180000] r7 : c75858a8  r6 : c75858a8  r5 : c7585b18  r4 : c7585800
      [    1.180000] r3 : 000005d0  r2 : 00000004  r1 : c05c33e4  r0 : 000005d0
      [    1.180000] Flags: nzCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
      [    1.180000] Control: 0005317f  Table: 40004000  DAC: 00000017
      [    1.180000] Process swapper (pid: 1, stack limit = 0xc743a1c0)
      --------------------------------------------------------------------
      
      This patch rearrange the init procedure:
         Set the NAND_SKIP_BBTSCAN to skip the nand scan firstly, and after we
         set the proper settings, we will call the chip->scan_bbt() manually.
      
      Cc: stable@vger.kernel.org # 3.12
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Reported-by: NFabio Estevam <festevam@gmail.com>
      Tested-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      885d71e5
  3. 12 11月, 2013 2 次提交
    • H
      mtd: gpmi: fix kernel BUG due to racing DMA operations · 7b3d2fb9
      Huang Shijie 提交于
      [1] The gpmi uses the nand_command_lp to issue the commands to NAND chips.
          The gpmi issues a DMA operation with gpmi_cmd_ctrl when it handles
          a NAND_CMD_NONE control command. So when we read a page(NAND_CMD_READ0)
          from the NAND, we may send two DMA operations back-to-back.
      
          If we do not serialize the two DMA operations, we will meet a bug when
      
          1.1) we enable CONFIG_DMA_API_DEBUG, CONFIG_DMADEVICES_DEBUG,
               and CONFIG_DEBUG_SG.
      
          1.2) Use the following commands in an UART console and a SSH console:
               cmd 1: while true;do dd if=/dev/mtd0 of=/dev/null;done
               cmd 1: while true;do dd if=/dev/mmcblk0 of=/dev/null;done
      
          The kernel log shows below:
          -----------------------------------------------------------------
          kernel BUG at lib/scatterlist.c:28!
          Unable to handle kernel NULL pointer dereference at virtual address 00000000
            .........................
          [<80044a0c>] (__bug+0x18/0x24) from [<80249b74>] (sg_next+0x48/0x4c)
          [<80249b74>] (sg_next+0x48/0x4c) from [<80255398>] (debug_dma_unmap_sg+0x170/0x1a4)
          [<80255398>] (debug_dma_unmap_sg+0x170/0x1a4) from [<8004af58>] (dma_unmap_sg+0x14/0x6c)
          [<8004af58>] (dma_unmap_sg+0x14/0x6c) from [<8027e594>] (mxs_dma_tasklet+0x18/0x1c)
          [<8027e594>] (mxs_dma_tasklet+0x18/0x1c) from [<8007d444>] (tasklet_action+0x114/0x164)
          -----------------------------------------------------------------
      
          1.3) Assume the two DMA operations is X (first) and Y (second).
      
               The root cause of the bug:
      	   Assume process P issues DMA X, and sleep on the completion
      	 @this->dma_done. X's tasklet callback is dma_irq_callback. It firstly
      	 wake up the process sleeping on the completion @this->dma_done,
      	 and then trid to unmap the scatterlist S. The waked process P will
      	 issue Y in another ARM core. Y initializes S->sg_magic to zero
      	 with sg_init_one(), while dma_irq_callback is unmapping S at the same
      	 time.
      
      	 See the diagram:
      
                         ARM core 0              |         ARM core 1
      	 -------------------------------------------------------------
               (P issues DMA X, then sleep)  --> |
                                                 |
               (X's tasklet wakes P)         --> |
                                                 |
                                                 | <-- (P begin to issue DMA Y)
                                                 |
               (X's tasklet unmap the            |
            scatterlist S with dma_unmap_sg) --> | <-- (Y calls sg_init_one() to init
                                                 |      scatterlist S)
                                                 |
      
      [2] This patch serialize both the X and Y in the following way:
           Unmap the DMA scatterlist S firstly, and wake up the process at the end
           of the DMA callback, in such a way, Y will be executed after X.
      
           After this patch:
      
                         ARM core 0              |         ARM core 1
      	 -------------------------------------------------------------
               (P issues DMA X, then sleep)  --> |
                                                 |
               (X's tasklet unmap the            |
            scatterlist S with dma_unmap_sg) --> |
                                                 |
               (X's tasklet wakes P)         --> |
                                                 |
                                                 | <-- (P begin to issue DMA Y)
                                                 |
                                                 | <-- (Y calls sg_init_one() to init
                                                 |     scatterlist S)
                                                 |
      
      Cc: stable@vger.kernel.org # 3.2
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      7b3d2fb9
    • H
      mtd: gpmi: only scan two chips for imx6 · 80bd33ac
      Huang Shijie 提交于
      We cannot scan two chips for imx23 and imx28:
        imx23: the Ready-Busy1 line is not connected for some board.
        imx28: we do not set the pinctrl for Ready-Busy1
      
      So we only scan two chips for imx6.
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      80bd33ac
  4. 08 11月, 2013 1 次提交
  5. 07 11月, 2013 2 次提交
  6. 28 10月, 2013 2 次提交
  7. 26 10月, 2013 1 次提交
    • D
      mtd: gpmi: fix ECC regression · 031e2777
      David Woodhouse 提交于
      The "legacy" ECC layout used until 3.12-rc1 uses all the OOB area by
      computing the ECC strength and ECC step size ourselves.
      
      Commit 2febcdf8 ("mtd: gpmi: set the BCHs geometry with the ecc info")
      makes the driver use the ECC info (ECC strength and ECC step size)
      provided by the MTD code, and creates a different NAND ECC layout
      for the BCH, and use the new ECC layout. This causes a regression:
      
         We can not mount the ubifs which was created by the old NAND ECC layout.
      
      This patch fixes this issue by reverting to the legacy ECC layout.
      
      We will probably introduce a new device-tree property to indicate that
      the new ECC layout can be used. For now though, for the imminent 3.12
      release, we just unconditionally revert to the 3.11 behaviour.
      
      This leaves a harmless cosmetic warning about an unused function. At
      this point in the cycle I really don't care.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Acked-by: NHuang Shijie <b32955@freescale.com>
      Acked-by: NMarek Vasut <marex@denx.de>
      Tested-by: NMarek Vasut <marex@denx.de>
      031e2777
  8. 31 8月, 2013 3 次提交
  9. 30 8月, 2013 1 次提交
    • B
      mtd: nand: refactor chip->block_markbad interface · 5a0edb25
      Brian Norris 提交于
      The chip->block_markbad pointer should really only be responsible for
      writing a bad block marker for new bad blocks. It should not take care
      of BBT-related functionality, nor should it handle bookkeeping of bad
      block stats.
      
      This patch refactors the 3 users of the block_markbad interface (plus
      the default nand_base implementation) so that the common code is kept in
      nand_block_markbad_lowlevel(). It removes some inconsistencies between
      the various implementations and should allow for more centralized
      improvements in the future.
      
      Because gpmi-nand no longer needs the nand_update_bbt() function, let's
      stop exporting it as well.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Acked-by: Huang Shijie <b32955@freescale.com> (for gpmi-nand parts)
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      5a0edb25
  10. 06 8月, 2013 3 次提交
  11. 04 4月, 2013 1 次提交
  12. 04 2月, 2013 4 次提交
  13. 04 1月, 2013 1 次提交
    • G
      Drivers: mtd: remove __dev* attributes. · d8929942
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, and __devexit
      from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d8929942
  14. 22 11月, 2012 3 次提交
  15. 15 11月, 2012 2 次提交
  16. 29 9月, 2012 6 次提交
  17. 17 7月, 2012 2 次提交
  18. 07 7月, 2012 2 次提交
  19. 06 7月, 2012 1 次提交