1. 06 Jan, 2016 6 commits
  2. 05 Jan, 2016 1 commit
    • Stephen Rothwell's avatar
      mtd: nand: fix for drop unnecessary partition parser data · 887e9d3a
      Stephen Rothwell authored
      From Stephen:
      
          Hi Brian,
      
          After merging the l2-mtd tree, today's linux-next build (powerpc
          ppc44x_defconfig) failed like this:
      
          drivers/mtd/nand/ndfc.c: In function 'ndfc_chip_init':
          drivers/mtd/nand/ndfc.c:177:2: error: 'ppdata' undeclared (first use in this function)
            ppdata.of_node = flash_np;
            ^
      
          Caused by commit
      
            a61ae81a ("mtd: nand: drop unnecessary partition parser data")
      
      The flash node is already correctly assigned using the new helper
      (nand_set_flash_node()) so the correct fix is indeed to simply drop this
      line.
      
      Fixes: a61ae81a ("mtd: nand: drop unnecessary partition parser data")
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      887e9d3a
  3. 04 Jan, 2016 1 commit
    • Brian Norris's avatar
      mtd: fix cmdlinepart parser, early naming for auto-filled MTD · 472b444e
      Brian Norris authored
      Commit 807f16d4 ("mtd: core: set some defaults when dev.parent is
      set") attempted to provide some default settings for MTDs that
       (a) assign the parent device and
       (b) don't provide their own name or owner
      
      However, this isn't a perfect drop-in replacement for the boilerplate
      found in some drivers, because the MTD name is used by partition
      parsers like cmdlinepart, but the name isn't set until add_mtd_device(),
      after the parsing is completed. This means cmdlinepart sees a NULL name
      and therefore will not work properly.
      
      Fix this by moving the default name and owner assignment to be first in
      the MTD registration process.
      
      [Note: this does not fix all reported issues, particularly with NAND
      drivers. Will require an additional fix for drivers/mtd/nand/]
      
      Fixes: 807f16d4 ("mtd: core: set some defaults when dev.parent is set")
      Reported-by: default avatarHeiko Schocher <hs@denx.de>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Cc: Heiko Schocher <hs@denx.de>
      Cc: Frans Klaver <fransklaver@gmail.com>
      472b444e
  4. 19 Dec, 2015 5 commits
    • Arnd Bergmann's avatar
      mtd: sh_flctl: pass FIFO as physical address · 1873315f
      Arnd Bergmann authored
      By convention, the FIFO address we pass using dmaengine_slave_config
      is a physical address in the form that is understood by the DMA
      engine, as a dma_addr_t, phys_addr_t or resource_size_t.
      
      The sh_flctl driver however passes a virtual __iomem address that
      gets cast to dma_addr_t in the slave driver. This happens to work
      on shmobile because that platform sets up an identity mapping for
      its MMIO regions, but such code is not portable to other platforms,
      and prevents us from ever changing the platform mapping or reusing
      the driver on other architectures like ARM64 that might not have the
      mapping.
      
      We also get a warning about a type mismatch for the case that
      dma_addr_t is wider than a pointer, i.e. when CONFIG_LPAE is set:
      
      drivers/mtd/nand/sh_flctl.c: In function 'flctl_setup_dma':
      drivers/mtd/nand/sh_flctl.c:163:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
        cfg.dst_addr = (dma_addr_t)FLDTFIFO(flctl);
      
      This changes the driver to instead pass the physical address of
      the FIFO that is extracted from the MMIO resource, making the
      code more portable and avoiding the warning.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      1873315f
    • Masahiro Yamada's avatar
      mtd: denali: make MTD_NAND_DENALI_DT dependent on OF · 0ed6ca3a
      Masahiro Yamada authored
      The build passes even if CONFIG_OF is undefined, but it makes sense
      to let it depend on OF.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      0ed6ca3a
    • Helmut Schaa's avatar
      mtd: nand: Disable subpage writes for drivers without ecc->hwctl · 44991b3d
      Helmut Schaa authored
      nand_write_subpage_hwecc causes a crash if the driver did not register
      ecc->hwctl or ecc->calculate. Fix this by disabling subpage writes if
      ecc->hwctl or ecc->calculate is not provided by the driver.
      
      This behavior was introduced in commit 837a6ba4
      "mtd: nand: subpage write support for hardware based ECC schemes".
      
      This fixes a crash with fsl_elbc_nand and maybe others:
      
      Unable to handle kernel paging request for instruction fetch
      Faulting instruction address: 0x00000000
      Oops: Kernel access of bad area, sig: 11 [#1]
      SMP NR_CPUS=2 P1020 RDB
      Modules linked in: ath9k ath9k_common pppoe ppp_async option iptable_nat ath9k_hw ath usb_wwan pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_quota xt_policy xt_pkttype xt_owner xt_nat xt_multiport xt_mh
      CPU: 1 PID: 2161 Comm: ubiformat Not tainted 3.10.26 #6
      task: efbc2700 ti: c7950000 task.ti: c7950000
      NIP: 00000000 LR: c01a495c CTR: 00000000
      REGS: c7951cb0 TRAP: 0400   Not tainted  (3.10.26)
      MSR: 00029000 <CE,EE,ME>  CR: 24002028  XER: 00000000
      
      GPR00: c01a4b6c c7951d60 efbc2700 ef84b000 00000001 00000000 000001ff c7800500
      GPR08: 00000000 00000000 efae5e40 c01a4ae4 24002022 10023418 c7951e5c c7800500
      GPR16: c017b6a8 00000000 0000003f c053404c 00000000 00000004 00000000 00000003
      GPR24: 00000010 00000200 ef84b000 c7800d00 c7800000 c7800500 ef84b1c8 00000000
      NIP [00000000]   (null)
      LR [c01a495c] nand_write_subpage_hwecc+0x74/0x174
      Call Trace:
      [c7951d60] [c7951d64] 0xc7951d64 (unreliable)
      [c7951da0] [c01a4b6c] nand_write_page+0x88/0x198
      [c7951dd0] [c01a5f7c] nand_do_write_ops+0x2f4/0x39c
      [c7951e40] [c01a61e0] nand_write+0x58/0x84
      [c7951e80] [c019e29c] mtdchar_write+0x1dc/0x28c
      [c7951ef0] [c00aba84] vfs_write+0xcc/0x1ac
      [c7951f10] [c00ac04c] SyS_write+0x4c/0x90
      [c7951f40] [c000cd84] ret_from_syscall+0x0/0x3c
       --- Exception: c01 at 0x48050ed8
           LR = 0x100071b8
       Instruction dump:
       XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
       XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
       ---[ end trace 161d3c65a2a15cb8 ]---
      
      Kernel panic - not syncing: Fatal exception
      
      [Brian: editorial note - we've applied a previous fix for the driver in
      question (fsl_elbc_nand) long ago:
      commit f034d87d ("mtd: eLBC NAND: fix subpage write support")
      but this still makes sense, and it could solve issues on some other
      unforseen driver.]
      
      Cc: Pekon Gupta <pekon.gupta@gmail.com>
      Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      44991b3d
    • Fabian Frederick's avatar
      mtd: ftl: use swap() in copy_erase_unit() · 6166a76f
      Fabian Frederick authored
      Use kernel.h macro definition.
      
      Thanks to Julia Lawall for Coccinelle scripting support.
      Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      6166a76f
    • Fabian Frederick's avatar
      mtd: cfi_cmdset_0002: use swap() in cfi_cmdset_0002() · fdd9d27c
      Fabian Frederick authored
      Use kernel.h macro definition.
      
      Thanks to Julia Lawall for Coccinelle scripting support.
      Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      fdd9d27c
  5. 18 Dec, 2015 27 commits