1. 30 7月, 2012 2 次提交
    • M
      common: dma-mapping: introduce dma_get_sgtable() function · d2b7428e
      Marek Szyprowski 提交于
      This patch adds dma_get_sgtable() function which is required to let
      drivers to share the buffers allocated by DMA-mapping subsystem. Right
      now the driver gets a dma address of the allocated buffer and the kernel
      virtual mapping for it. If it wants to share it with other device (= map
      into its dma address space) it usually hacks around kernel virtual
      addresses to get pointers to pages or assumes that both devices share
      the DMA address space. Both solutions are just hacks for the special
      cases, which should be avoided in the final version of buffer sharing.
      
      To solve this issue in a generic way, a new call to DMA mapping has been
      introduced - dma_get_sgtable(). It allocates a scatter-list which
      describes the allocated buffer and lets the driver(s) to use it with
      other device(s) by calling dma_map_sg() on it.
      
      This patch provides a generic implementation based on virt_to_page()
      call. Architectures which require more sophisticated translation might
      provide their own get_sgtable() methods.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d2b7428e
    • M
      common: dma-mapping: add support for generic dma_mmap_* calls · 64ccc9c0
      Marek Szyprowski 提交于
      Commit 9adc5374 ('common: dma-mapping: introduce mmap method') added a
      generic method for implementing mmap user call to dma_map_ops structure.
      
      This patch converts ARM and PowerPC architectures (the only providers of
      dma_mmap_coherent/dma_mmap_writecombine calls) to use this generic
      dma_map_ops based call and adds a generic cross architecture
      definition for dma_mmap_attrs, dma_mmap_coherent, dma_mmap_writecombine
      functions.
      
      The generic mmap virt_to_page-based fallback implementation is provided for
      architectures which don't provide their own implementation for mmap method.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NKyungmin Park <kyungmin.park@samsung.com>
      64ccc9c0
  2. 05 3月, 2012 1 次提交
    • P
      BUG: headers with BUG/BUG_ON etc. need linux/bug.h · 187f1882
      Paul Gortmaker 提交于
      If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
      other BUG variant in a static inline (i.e. not in a #define) then
      that header really should be including <linux/bug.h> and not just
      expecting it to be implicitly present.
      
      We can make this change risk-free, since if the files using these
      headers didn't have exposure to linux/bug.h already, they would have
      been causing compile failures/warnings.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      187f1882
  3. 01 11月, 2011 1 次提交
    • C
      dma-mapping: fix sync_single_range_* DMA debugging · 07a72309
      Clemens Ladisch 提交于
      Commit 5fd75a78 (dma-mapping: remove unnecessary sync_single_range_*
      in dma_map_ops) unified not only the dma_map_ops but also the
      corresponding debug_dma_sync_* calls.  This led to spurious WARN()ings
      like the following because the DMA debug code was no longer able to detect
      the DMA buffer base address without the separate offset parameter:
      
      WARNING: at lib/dma-debug.c:911 check_sync+0xce/0x446()
      firewire_ohci 0000:04:00.0: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x00000000cedaa400] [size=1024 bytes]
      Call Trace: ...
       [<ffffffff811326a5>] check_sync+0xce/0x446
       [<ffffffff81132ad9>] debug_dma_sync_single_for_device+0x39/0x3b
       [<ffffffffa01d6e6a>] ohci_queue_iso+0x4f3/0x77d [firewire_ohci]
       ...
      
      To fix this, unshare the sync_single_* and sync_single_range_*
      implementations so that we are able to call the correct debug_dma_sync_*
      functions.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      07a72309
  4. 28 5月, 2010 1 次提交
  5. 12 5月, 2010 1 次提交
  6. 10 8月, 2009 1 次提交
    • A
      dma-ops: Remove flush_write_buffers() in dma-mapping-common.h · a8ad568d
      Arnd Bergmann 提交于
      This moves flush_write_buffers() in
      asm-generic/dma-mapping-common.h to
      arch/x86/kernel/pci-nommu.c.
      
      The purpose of this patch is that, we can avoid defining NULL
      flush_write_buffers() on IA64 and SPARC.
      
      dma-mapping-common.h is used by X86 and IA64 (and SPARC soon)
      but only X86 with CONFIG_X86_OOSTORE or CONFIG_X86_PPRO_FENCE
      actually uses flush_write_buffers(). CONFIG_X86_OOSTORE or
      CONFIG_X86_PPRO_FENCE is usable with only kernel/pci-nommu.c
      (that is, not usable with other X86 IOMMU implementations such
      as SWIOTLB, VT-d, etc) so we can safely move
      flush_write_buffers() in asm-generic/dma-mapping-common.h to
      arch/x86/kernel/pci-nommu.c.
      
      The further discussion is:
      
        http://lkml.org/lkml/2009/6/28/104Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: davem@davemloft.net
      Cc: tony.luck@intel.com
      Cc: fenghua.yu@intel.com
      LKML-Reference: <1249872797-1314-2-git-send-email-fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a8ad568d
  7. 19 6月, 2009 1 次提交
    • F
      dma-mapping: add asm-generic/dma-mapping-common.h · c147d8ea
      FUJITA Tomonori 提交于
      We unified x86 and IA64's handling of multiple dma mapping operations
      (struct dma_map_ops in linux/dma-mapping.h) so we can remove duplication
      in their arch/include/asm/dma-mapping.h.
      
      This patchset adds include/asm-generic/dma-mapping-common.h that provides
      some generic dma mapping function definitions for the users of struct
      dma_map_ops.  This enables us to remove about 100 lines.  This also
      enables us to easily add CONFIG_DMA_API_DEBUG support, which only x86
      supports for now.  The 4th patch adds CONFIG_DMA_API_DEBUG support to IA64
      by adding only 8 lines.
      
      This patch:
      
      This header file provides some mapping function definitions that the users
      of struct dma_map_ops can use.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Acked-by: NJoerg Roedel <joerg.roedel@amd.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c147d8ea