1. 07 6月, 2016 1 次提交
    • S
      dmaengine: mv_xor: Fix incorrect offset in dma_map_page() · 51564635
      Stefan Roese 提交于
      Upon booting, I occasionally spotted some BUGs triggered by the internal
      DMA test routine executed upon driver probing. This was detected by
      SLUB_DEBUG ("Freechain corrupt" or "Redzone overwritten"). Tracking
      this down located a problem in passing 0 as offset in dma_map_page().
      As kmalloc, especially when used with SLUB_DEBUG, may return a non page
      aligned address.
      
      This patch fixes this issue by passing the correct offset in
      dma_map_page().
      
      Tested on a custom Armada XP board.
      Signed-off-by: NStefan Roese <sr@denx.de>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
      Cc: Marcin Wojtas <mw@semihalf.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      51564635
  2. 03 5月, 2016 3 次提交
    • M
      dmaengine: mv_xor: add support for Armada 3700 SoC · ac5f0f3f
      Marcin Wojtas 提交于
      Armada 3700 SoC comprise a single XOR engine compliant with the ones used
      in older Marvell SoC's like Armada XP or 38x. The only thing that needs
      modification is the Mbus configuration, which has to be done on two
      levels: global and in device. The first one is inherited from the
      bootloader. The latter can be opened in a default way, leaving
      arbitration to the bus controller. Hence filled mbus_dram_target_info
      structure is not needed.
      
      Patch "dmaengine: mv_xor: optimize performance by using a subset
      of the XOR channels" introduced limitation for using XOR engines and
      channels vs number of available CPU's. Those constraints do not however
      fit Armada 3700 architecture with two possible CPU's and single,
      dual-channel engine. Hence in this commit an adjustment for setting
      maximum available channels is added.
      
      This patch enables XOR access to DRAM by opening default window to 4GB
      space with specific attribute.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      ac5f0f3f
    • G
      dmaengine: mv_xor: use SoC type instead of directly the operation mode · dd130c65
      Gregory CLEMENT 提交于
      Currently the main difference between legacy XOR engine and newer one, is
      the way the engine modes are setup (either in the descriptor or through
      the controller registers). In order to be able to take into account new
      generation of the XOR engine for the ARM64 SoC, we need to identify them
      by type, and then depending to the type the engine setup will be
      selected.
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      dd130c65
    • G
      dmaengine: mv_xor: make the code 64 bits compliant · bc822e12
      Gregory CLEMENT 提交于
      Fix two warnings which appear when building for 64 bits target:
      
      drivers/dma/mv_xor.c: In function ‘mv_xor_prep_dma_xor’:
      drivers/dma/mv_xor.c:480:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 6 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
         "%s src_cnt: %d len: %u dest %pad flags: %ld\n",
         ^
      drivers/dma/mv_xor.c: In function ‘mv_xor_probe’:
      drivers/dma/mv_xor.c:1223:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
          op_in_desc = (int)of_id->data;
                       ^
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      bc822e12
  3. 09 3月, 2016 1 次提交
    • L
      dma, mm/pat: Rename dma_*_writecombine() to dma_*_wc() · f6e45661
      Luis R. Rodriguez 提交于
      Rename dma_*_writecombine() to dma_*_wc(), so that the naming
      is coherent across the various write-combining APIs. Keep the
      old names for compatibility for a while, these can be removed
      at a later time. A guard is left to enable backporting of the
      rename, and later remove of the old mapping defines seemlessly.
      
      Build tested successfully with allmodconfig.
      
      The following Coccinelle SmPL patch was used for this simple
      transformation:
      
      @ rename_dma_alloc_writecombine @
      expression dev, size, dma_addr, gfp;
      @@
      
      -dma_alloc_writecombine(dev, size, dma_addr, gfp)
      +dma_alloc_wc(dev, size, dma_addr, gfp)
      
      @ rename_dma_free_writecombine @
      expression dev, size, cpu_addr, dma_addr;
      @@
      
      -dma_free_writecombine(dev, size, cpu_addr, dma_addr)
      +dma_free_wc(dev, size, cpu_addr, dma_addr)
      
      @ rename_dma_mmap_writecombine @
      expression dev, vma, cpu_addr, dma_addr, size;
      @@
      
      -dma_mmap_writecombine(dev, vma, cpu_addr, dma_addr, size)
      +dma_mmap_wc(dev, vma, cpu_addr, dma_addr, size)
      
      We also keep the old names as compatibility helpers, and
      guard against their definition to make backporting easier.
      
      Generated-by: Coccinelle SmPL
      Suggested-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: airlied@linux.ie
      Cc: akpm@linux-foundation.org
      Cc: benh@kernel.crashing.org
      Cc: bhelgaas@google.com
      Cc: bp@suse.de
      Cc: dan.j.williams@intel.com
      Cc: daniel.vetter@ffwll.ch
      Cc: dhowells@redhat.com
      Cc: julia.lawall@lip6.fr
      Cc: konrad.wilk@oracle.com
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-pci@vger.kernel.org
      Cc: luto@amacapital.net
      Cc: mst@redhat.com
      Cc: tomi.valkeinen@ti.com
      Cc: toshi.kani@hp.com
      Cc: vinod.koul@intel.com
      Cc: xen-devel@lists.xensource.com
      Link: http://lkml.kernel.org/r/1453516462-4844-1-git-send-email-mcgrof@do-not-panic.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      f6e45661
  4. 06 1月, 2016 3 次提交
  5. 23 8月, 2015 1 次提交
    • P
      drivers/dma: make mv_xor.c driver explicitly non-modular · 25cf68da
      Paul Gortmaker 提交于
      The Kconfig for this driver is currently:
      
      config MV_XOR
              bool "Marvell XOR engine support"
      
      ...meaning that it currently is not being built as a module by anyone.
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      We leave some tags like MODULE_AUTHOR for documentation purposes.
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: dmaengine@vger.kernel.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      25cf68da
  6. 20 8月, 2015 2 次提交
    • T
      dmaengine: mv_xor: optimize performance by using a subset of the XOR channels · 77757291
      Thomas Petazzoni 提交于
      Due to how async_tx behaves internally, having more XOR channels than
      CPUs is actually hurting performance more than it improves it, because
      memcpy requests get scheduled on a different channel than the XOR
      requests, but async_tx will still wait for the completion of the
      memcpy requests before scheduling the XOR requests.
      
      It is in fact more efficient to have at most one channel per CPU,
      which this patch implements by limiting the number of channels per
      engine, and the number of engines registered depending on the number
      of availables CPUs.
      
      Marvell platforms are currently available in one CPU, two CPUs and
      four CPUs configurations:
      
       - in the configurations with one CPU, only one channel from one
         engine is used.
      
       - in the configurations with two CPUs, only one channel from each
         engine is used (they are two XOR engines)
      
       - in the configurations with four CPUs, both channels of both engines
         are used.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      77757291
    • T
      dmaengine: mv_xor: remove support for dmacap,* DT properties · 6d8f7abd
      Thomas Petazzoni 提交于
      The only reason why we had dmacap,* properties is because back when
      DMA_MEMSET was supported, only one out of the two channels per engine
      could do a memset operation. But this is something that the driver
      already knows anyway, and since then, the DMA_MEMSET support has been
      removed.
      
      The driver is already well aware of what each channel supports and the
      one to one mapping between Linux specific implementation details (such
      as dmacap,interrupt enabling DMA_INTERRUPT) and DT properties is a
      good indication that these DT properties are wrong.
      
      Therefore, this commit simply gets rid of these dmacap,* properties,
      they are now ignored, and the driver is responsible for knowing the
      capabilities of the hardware with regard to the dmaengine subsystem
      expectations.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      6d8f7abd
  7. 31 7月, 2015 1 次提交
    • T
      dmaengine: mv_xor: fix big endian operation in register mode · 0ec9ebc7
      Thomas Petazzoni 提交于
      Commit 6f166312 ("dmaengine: mv_xor: add support for a38x command
      in descriptor mode") introduced the support for a feature that
      appeared in Armada 38x: specifying the operation to be performed in a
      per-descriptor basis rather than globally per channel.
      
      However, when doing so, it changed the function mv_chan_set_mode() to
      use:
      
        if (IS_ENABLED(__BIG_ENDIAN))
      
      instead of:
      
        #if defined(__BIG_ENDIAN)
      
      While IS_ENABLED() is perfectly fine for CONFIG_* symbols, it is not
      for other symbols such as __BIG_ENDIAN that is provided directly by
      the compiler. Consequently, the commit broke support for big-endian,
      as the XOR_DESCRIPTOR_SWAP flag was not set in the XOR channel
      configuration register.
      
      The primarily visible effect was some nasty warnings and failures
      appearing during the self-test of the XOR unit:
      
      [    1.197368] mv_xor d0060900.xor: error on chan 0. intr cause 0x00000082
      [    1.197393] mv_xor d0060900.xor: config       0x00008440
      [    1.197410] mv_xor d0060900.xor: activation   0x00000000
      [    1.197427] mv_xor d0060900.xor: intr cause   0x00000082
      [    1.197443] mv_xor d0060900.xor: intr mask    0x000003f7
      [    1.197460] mv_xor d0060900.xor: error cause  0x00000000
      [    1.197477] mv_xor d0060900.xor: error addr   0x00000000
      [    1.197491] ------------[ cut here ]------------
      [    1.197513] WARNING: CPU: 0 PID: 1 at ../drivers/dma/mv_xor.c:664 mv_xor_interrupt_handler+0x14c/0x170()
      
      See also:
      
        http://storage.kernelci.org/next/next-20150617/arm-mvebu_v7_defconfig+CONFIG_CPU_BIG_ENDIAN=y/lab-khilman/boot-armada-xp-openblocks-ax3-4.txtSigned-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Fixes: 6f166312 ("dmaengine: mv_xor: add support for a38x command in descriptor mode")
      Reviewed-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      0ec9ebc7
  8. 11 6月, 2015 4 次提交
  9. 19 3月, 2015 1 次提交
  10. 17 3月, 2015 1 次提交
  11. 22 12月, 2014 1 次提交
  12. 20 10月, 2014 1 次提交
  13. 23 9月, 2014 7 次提交
  14. 22 5月, 2014 1 次提交
  15. 11 4月, 2014 4 次提交
  16. 13 2月, 2014 1 次提交
    • O
      dma: mv_xor: Silence a bunch of LPAE-related warnings · 31fd8f5b
      Olof Johansson 提交于
      Enabling some of the mvebu platforms in the multiplatform config for ARM
      enabled these drivers, which also triggered a bunch of warnings when LPAE
      is enabled (thus making phys_addr_t 64-bit).
      
      Most changes are switching printk formats, but also a bit of changes to what
      used to be array-based pointer arithmetic that could just be done with the
      address types instead.
      
      The warnings were:
      
      drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
      drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
          'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
      drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
      drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
          different size [-Wint-to-pointer-cast]
      drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
          different size [-Wpointer-to-int-cast]
      drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
      drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
          'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
      drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
          'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
      drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
      drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
          'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
      Acked-by: NVinod Koul <vinod.koul@intel.com>
      Acked-by: NJason Cooper <jason@lakedaemon.net>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      31fd8f5b
  17. 13 12月, 2013 3 次提交
  18. 15 11月, 2013 3 次提交
  19. 14 11月, 2013 1 次提交