1. 31 Oct, 2013 2 commits
    • Santosh Shilimkar's avatar
      ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev) helper function · 00c8f162
      Santosh Shilimkar authored
      Most of the kernel assumes that PFN0 is the start of the physical
      memory (RAM). This assumptions is not true on most of the ARM SOCs
      and hence and if one try to update the ARM port to follow the assumptions,
      we end of breaking the dma bounce limit for few block layer drivers.
      One such example is trying to unify the meaning of max*_pfn on ARM
      as the bootmem layer expects, breaks few block layer driver dma
      bounce limit.
      
      To fix this problem, we introduce dma_max_pfn(dev) generic helper with
      a possibility of override from the architecture code. The helper converts
      a DMA bitmask of bits to a block PFN number. In all the generic cases,
      it is just  "dev->dma_mask >> PAGE_SHIFT" and hence default behavior
      is maintained as is.
      
      Subsequent patches will make use of the helper. No functional change.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      00c8f162
    • Russell King's avatar
      DMA-API: provide a helper to setup DMA masks · fa6a8d6d
      Russell King authored
      Many drivers contain code such as:
      
      	dev->dma_mask = &dev->coherent_dma_mask;
      	dev->coherent_dma_mask = MASK;
      
      Let's move this pattern out of drivers and have the DMA API provide a
      helper for it.  This helper uses dma_set_mask_and_coherent() to allow
      platform issues to be properly dealt with via dma_set_mask()/
      dma_is_supported().
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      fa6a8d6d
  2. 17 Sep, 2013 1 commit
  3. 29 Aug, 2013 1 commit
  4. 30 Jul, 2012 1 commit
    • Marek Szyprowski's avatar
      common: dma-mapping: introduce dma_get_sgtable() function · d2b7428e
      Marek Szyprowski authored
      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: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d2b7428e
  5. 28 Mar, 2012 3 commits
  6. 25 Mar, 2012 1 commit
  7. 02 Nov, 2011 1 commit
  8. 19 Sep, 2011 1 commit
  9. 26 Jul, 2011 1 commit
  10. 21 Jun, 2011 1 commit
    • Alexey Dobriyan's avatar
      net: remove mm.h inclusion from netdevice.h · b7f080cf
      Alexey Dobriyan authored
      Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually).
      
      To prevent mm.h inclusion via other channels also extract "enum dma_data_direction"
      definition into separate header. This tiny piece is what gluing netdevice.h with mm.h
      via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h".
      Removal of mm.h from scatterlist.h was tried and was found not feasible
      on most archs, so the link was cutoff earlier.
      
      Hope people are OK with tiny include file.
      
      Note, that mm_types.h is still dragged in, but it is a separate story.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b7f080cf
  11. 22 Sep, 2010 1 commit
  12. 13 Aug, 2010 1 commit
  13. 11 Aug, 2010 1 commit
  14. 27 May, 2010 2 commits
  15. 12 Mar, 2010 2 commits
  16. 27 Aug, 2009 1 commit
  17. 27 Jul, 2009 1 commit
  18. 19 Jun, 2009 2 commits
  19. 07 Apr, 2009 1 commit
  20. 06 Jan, 2009 1 commit
  21. 19 Sep, 2008 1 commit
  22. 14 Sep, 2008 1 commit
  23. 10 Sep, 2008 1 commit
  24. 29 Apr, 2008 1 commit
    • Arthur Kepner's avatar
      dma: add dma_*map*_attrs() interfaces · 74bc7cee
      Arthur Kepner authored
      Introduce new interfaces, dma_*map*_attrs(), for passing architecture-specific
      attributes when memory is mapped and unmapped for DMA.  Give the interfaces
      default implementations which ignore attributes.  Also introduce the
      dma_{set|get}_attr() interfaces for setting and retrieving individual
      attributes.  Define one attribute, DMA_ATTR_WRITE_BARRIER, in anticipation of
      its use by ia64/sn.  Select whether architectures implement arch-specific
      versions of the dma_*map*_attrs() interfaces via HAVE_DMA_ATTRS in Kconfig.
      
      [markn@au1.ibm.com: dma_{set,get}_attr() have to be static inline]
      Signed-off-by: default avatarArthur Kepner <akepner@sgi.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Jes Sorensen <jes@sgi.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Roland Dreier <rdreier@cisco.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Grant Grundler <grundler@parisc-linux.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Signed-off-by: default avatarMark Nelson <markn@au1.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      74bc7cee
  25. 05 Feb, 2008 2 commits
    • FUJITA Tomonori's avatar
      iommu sg merging: add accessors for segment_boundary_mask in device_dma_parameters() · d22a6966
      FUJITA Tomonori authored
      This adds new accessors for segment_boundary_mask in device_dma_parameters
      structure in the same way I did for max_segment_size.  So we can easily change
      where to place struct device_dma_parameters in the future.
      
      dma_get_segment boundary returns 0xffffffff if dma_parms in struct device
      isn't set up properly.  0xffffffff is the default value used in the block
      layer and the scsi mid layer.
      Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d22a6966
    • FUJITA Tomonori's avatar
      iommu sg merging: add device_dma_parameters structure · 6b7b6510
      FUJITA Tomonori authored
      IOMMUs merges scatter/gather segments without considering a low level
      driver's restrictions. The problem is that IOMMUs can't access to the
      limitations because they are in request_queue.
      
      This patchset introduces a new structure, device_dma_parameters,
      including dma information. A pointer to device_dma_parameters is added
      to struct device. The bus specific structures (like pci_dev) includes
      device_dma_parameters. Low level drivers can use dma_set_max_seg_size
      to tell IOMMUs about the restrictions.
      
      We can move more dma stuff in struct device (like dma_mask) to struct
      device_dma_parameters later (needs some cleanups before that).
      
      This includes patches for all the IOMMUs that could merge sg (x86_64,
      ppc, IA64, alpha, sparc64, and parisc) though only the ppc patch was
      tested. The patches for other IOMMUs are only compile tested.
      
      This patch:
      
      Add a new structure, device_dma_parameters, including dma information.  A
      pointer to device_dma_parameters is added to struct device.
      
      - there are only max_segment_size and segment_boundary_mask there but we'll
        move more dma stuff in struct device (like dma_mask) to struct
        device_dma_parameters later.  segment_boundary_mask is not supported yet.
      
      - new accessors for the dma parameters are added.  So we can easily change
        where to place struct device_dma_parameters in the future.
      
      - dma_get_max_seg_size returns 64K if dma_parms in struct device isn't set
        up properly.  64K is the default max_segment_size in the block layer.
      Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Acked-by: default avatarJeff Garzik <jeff@garzik.org>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6b7b6510
  26. 03 Feb, 2008 1 commit
  27. 18 Oct, 2007 2 commits
  28. 16 Oct, 2007 1 commit
  29. 16 Jul, 2007 1 commit
    • Dan Williams's avatar
      dma-mapping: prevent dma dependent code from linking on !HAS_DMA archs · 1b0fac45
      Dan Williams authored
      Continuing the work started in 411f0f3e ...
      
      This enables code with a dma path, that compiles away, to build without
      requiring additional code factoring.  It also prevents code that calls
      dma_alloc_coherent and dma_free_coherent from linking whereas previously
      the code would hit a BUG() at run time.  Finally, it allows archs that set
      !HAS_DMA to delete their asm/dma-mapping.h file.
      
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: John W. Linville <linville@tuxdriver.com>
      Cc: Kyle McMartin <kyle@parisc-linux.org>
      Cc: James Bottomley <James.Bottomley@SteelEye.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: <geert@linux-m68k.org>
      Cc: <zippel@linux-m68k.org>
      Cc: <spyro@f2s.com>
      Cc: <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1b0fac45
  30. 09 Feb, 2007 1 commit
    • Tejun Heo's avatar
      devres: device resource management · 9ac7849e
      Tejun Heo authored
      Implement device resource management, in short, devres.  A device
      driver can allocate arbirary size of devres data which is associated
      with a release function.  On driver detach, release function is
      invoked on the devres data, then, devres data is freed.
      
      devreses are typed by associated release functions.  Some devreses are
      better represented by single instance of the type while others need
      multiple instances sharing the same release function.  Both usages are
      supported.
      
      devreses can be grouped using devres group such that a device driver
      can easily release acquired resources halfway through initialization
      or selectively release resources (e.g. resources for port 1 out of 4
      ports).
      
      This patch adds devres core including documentation and the following
      managed interfaces.
      
      * alloc/free	: devm_kzalloc(), devm_kzfree()
      * IO region	: devm_request_region(), devm_release_region()
      * IRQ		: devm_request_irq(), devm_free_irq()
      * DMA		: dmam_alloc_coherent(), dmam_free_coherent(),
      		  dmam_declare_coherent_memory(), dmam_pool_create(),
      		  dmam_pool_destroy()
      * PCI		: pcim_enable_device(), pcim_pin_device(), pci_is_managed()
      * iomap		: devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
      		  devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
      		  pcim_iomap(), pcim_iounmap()
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      9ac7849e
  31. 29 Sep, 2006 1 commit
  32. 10 May, 2006 1 commit