search for: dma_data_direction

Displaying 20 results from an estimated 216 matches for "dma_data_direction".

2008 Dec 22
17
[PATCH 0 of 9] swiotlb: use phys_addr_t for pages
Hi all, Here''s a work in progress series whcih does a partial revert of the previous swiotlb changes, and does a partial replacement with Becky Bruce''s series. The most important difference is Becky''s use of phys_addr_t rather than page+offset to represent arbitrary pages. This turns out to be simpler. I didn''t replicate the map_single_page changes, since
2016 Jun 02
52
[RFC v3 00/45] dma-mapping: Use unsigned long for dma_attrs
Hi, This is third approach (complete this time) for replacing struct dma_attrs with unsigned long. The main patch (2/45) doing the change is split into many subpatches for easier review (3-43). They should be squashed together when applying. *Important:* Patchset is *only* build tested on allyesconfigs: ARM, ARM64, i386, x86_64 and powerpc. Please provide reviewes and tests for other
2009 Sep 02
20
Re: i686 vs i586 glibc segfault issue on 64-bit AMD Xen paravirt guests
On 09/02/09 01:10, Mitchell E Berger wrote: > I apologize for writing to you directly instead of through an officially > supported channel. No problem. > I''ve filed a bug against glibc in Redhat''s Bugzilla > for an issue that only seems to surface on 64-bit Xen paravirt guests > on AMD hosts. Filing this bug with the distro involved seemed to make > sense,
2009 Sep 10
1
[Bug 23830] New: nouvea modules on 2.6.31-rc6 failed
...include/linux/compile.h CC drivers/gpu/drm/ttm/ttm_agp_backend.o In file included from /usr/src/linux-2.6.31_pvops-xen-rebase.master.tree-2009-08-31/arch/x86/include/asm/agp.h:4, from drivers/gpu/drm/ttm/ttm_agp_backend.c:39: include/linux/swiotlb.h:48: warning: 'enum dma_data_direction' declared inside parameter list include/linux/swiotlb.h:48: warning: its scope is only this definition or declaration, which is probably not what you want include/linux/swiotlb.h:51: warning: 'enum dma_data_direction' declared inside parameter list include/linux/swiotlb.h:63: warning: &...
2016 Jun 02
0
[RFC v3 20/45] xen: dma-mapping: Use unsigned long for dma_attrs
...s *attrs) + dma_addr_t dev_addr, unsigned long attrs) { int order = get_order(size); phys_addr_t phys; @@ -378,7 +378,7 @@ EXPORT_SYMBOL_GPL(xen_swiotlb_free_coherent); dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs) + unsigned long attrs) { phys_addr_t map, phys = page_to_phys(page) + offset; dma_addr_t dev_addr = xen_phys_to_bus(phys); @@ -434,7 +434,7 @@ EXPORT_SYMBOL_GPL(xen_swiotlb_map_page); */ static void xen_unmap_single(struct device *hwdev, dma_addr_t dev_...
2020 Sep 15
0
[PATCH 15/18] dma-mapping: add a new dma_alloc_pages API
...e *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs); void dma_direct_free(struct device *dev, size_t size, void *cpu_addr, dma_addr_t dma_addr, unsigned long attrs); +struct page *dma_direct_alloc_pages(struct device *dev, size_t size, + dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp); +void dma_direct_free_pages(struct device *dev, size_t size, + struct page *page, dma_addr_t dma_addr, + enum dma_data_direction dir); int dma_direct_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size, unsigned long attrs...
2020 Sep 15
0
[PATCH 14/18] dma-mapping: remove dma_cache_sync
...herent.c index 97a14adbafc99c..f34ad1f09799f1 100644 --- a/arch/mips/mm/dma-noncoherent.c +++ b/arch/mips/mm/dma-noncoherent.c @@ -137,12 +137,6 @@ void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size, } #endif -void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size, - enum dma_data_direction direction) -{ - dma_sync_virt_for_device(vaddr, size, direction); -} - #ifdef CONFIG_DMA_PERDEV_COHERENT void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, const struct iommu_ops *iommu, bool coherent) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 3b0f53dd70bc9b...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...API internally. > > > + * > > > + * Returns the DMA addr. DMA_MAPPING_ERROR means error. > > > + */ > > > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset, > > > + unsigned int length, enum dma_data_direction dir) > > > +{ > > > > This (and the reset) needs to be done per virtqueue instead per device > > after b0e504e5505d184b0be248b7dcdbe50b79f03758 ("virtio_ring: per > > virtqueue dma device"). > > > YES. > > > > > > > + st...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...API internally. > > > + * > > > + * Returns the DMA addr. DMA_MAPPING_ERROR means error. > > > + */ > > > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset, > > > + unsigned int length, enum dma_data_direction dir) > > > +{ > > > > This (and the reset) needs to be done per virtqueue instead per device > > after b0e504e5505d184b0be248b7dcdbe50b79f03758 ("virtio_ring: per > > virtqueue dma device"). > > > YES. > > > > > > > + st...
2018 Jan 11
0
[PATCH 2/5] drm/prime: Export more helpers for drivers
...e_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf) @@ -254,8 +255,8 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr } } -static struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach, - enum dma_data_direction dir) +struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach, + enum dma_data_direction dir) { struct drm_prime_attachment *prime_attach = attach->priv; struct drm_gem_object *obj = attach->dmabuf->priv; @@ -291,13 +292,15 @@ static struct sg_table *drm_gem_map...
2020 Aug 19
0
[PATCH 08/28] MIPS: make dma_sync_*_for_cpu a little less overzealous
...t.c +++ b/arch/mips/mm/dma-noncoherent.c @@ -55,22 +55,34 @@ void *arch_dma_set_uncached(void *addr, size_t size) return (void *)(__pa(addr) + UNCAC_BASE); } -static inline void dma_sync_virt(void *addr, size_t size, +static inline void dma_sync_virt_for_device(void *addr, size_t size, enum dma_data_direction dir) { switch (dir) { case DMA_TO_DEVICE: dma_cache_wback((unsigned long)addr, size); break; - case DMA_FROM_DEVICE: dma_cache_inv((unsigned long)addr, size); break; - case DMA_BIDIRECTIONAL: dma_cache_wback_inv((unsigned long)addr, size); break; + default: + BUG(); + }...
2023 Feb 20
1
[PATCH vhost 08/10] virtio_ring: introduce dma sync api for virtio
...tio > > + * core handles DMA API internally. > > + */ > > +void virtio_dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t addr, > > + unsigned long offset, size_t size, > > + enum dma_data_direction dir) > > +{ > > + struct virtio_device *vdev = dev_to_virtio(dev); > > + > > + dma_sync_single_range_for_cpu(vdev->dev.parent, addr, offset, > > + size, DMA_BIDIRECTIONAL); > > +} > > +EXPORT_SYMBOL_GPL(vir...
2023 Feb 20
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...gt; + * core handles DMA API internally. > > + * > > + * Returns the DMA addr. DMA_MAPPING_ERROR means error. > > + */ > > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset, > > + unsigned int length, enum dma_data_direction dir) > > +{ > > This (and the reset) needs to be done per virtqueue instead per device > after b0e504e5505d184b0be248b7dcdbe50b79f03758 ("virtio_ring: per > virtqueue dma device"). YES. > > > + struct virtio_device *vdev = dev_to_virtio(dev); > >...
2016 Jun 02
0
[RFC v3 02/45] dma-mapping: Use unsigned long for dma_attrs
...umentation/DMA-API.txt b/Documentation/DMA-API.txt index 45ef3f279c3b..24f9688bb98a 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt @@ -369,35 +369,32 @@ See also dma_map_single(). dma_addr_t dma_map_single_attrs(struct device *dev, void *cpu_addr, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs) + unsigned long attrs) void dma_unmap_single_attrs(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs) + unsigned long attrs) int dma_map_sg_attrs(struct device *d...
2016 Jun 02
0
[RFC v3 09/45] c6x: dma-mapping: Use unsigned long for dma_attrs
...el/dma.c index 8a80f3a250c0..db4a6a301f5e 100644 --- a/arch/c6x/kernel/dma.c +++ b/arch/c6x/kernel/dma.c @@ -38,7 +38,7 @@ static void c6x_dma_sync(dma_addr_t handle, size_t size, static dma_addr_t c6x_dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs) + unsigned long attrs) { dma_addr_t handle = virt_to_phys(page_address(page) + offset); @@ -47,13 +47,13 @@ static dma_addr_t c6x_dma_map_page(struct device *dev, struct page *page, } static void c6x_dma_unmap_page(struct device *dev, dma_addr_t handle, -...
2018 Jan 11
5
[PATCH 1/5] drm/prime: Remove duplicate forward declaration
From: Thierry Reding <treding at nvidia.com> struct device is forward-declared twice. Remove the second instance. Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk> Signed-off-by: Thierry Reding <treding at nvidia.com> --- include/drm/drm_prime.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h index
2020 Aug 19
0
[PATCH 19/28] dma-mapping: replace DMA_ATTR_NON_CONSISTENT with dma_{alloc, free}_pages
...ocessor and an I/O device, you should not be using this part of the -API at all. +API. :: void * - dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle, - gfp_t flag, unsigned long attrs) + dma_alloc_pages(struct device *dev, size_t size, dma_addr_t *dma_handle, + enum dma_data_direction dir, gfp_t gfp) + +This routine allocates a region of <size> bytes of consistent memory. It +returns a pointer to the allocated region (in the processor's virtual address +space) or NULL if the allocation failed. The returned memory is guanteed to +behave like memory allocated using allo...
2023 Mar 02
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...> > > > + * Returns the DMA addr. DMA_MAPPING_ERROR means error. > > > > > + */ > > > > > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset, > > > > > + unsigned int length, enum dma_data_direction dir) > > > > > +{ > > > > > > > > This (and the reset) needs to be done per virtqueue instead per device > > > > after b0e504e5505d184b0be248b7dcdbe50b79f03758 ("virtio_ring: per > > > > virtqueue dma device"). > > >...
2016 Jun 02
0
[RFC v3 30/45] metag: dma-mapping: Use unsigned long for dma_attrs
...rs) { unsigned long flags, user_size, kern_size; struct metag_vm_region *c; @@ -482,7 +482,7 @@ static void dma_sync_for_cpu(void *vaddr, size_t size, int dma_direction) static dma_addr_t metag_dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, - enum dma_data_direction direction, struct dma_attrs *attrs) + enum dma_data_direction direction, unsigned long attrs) { dma_sync_for_device((void *)(page_to_phys(page) + offset), size, direction); @@ -491,14 +491,14 @@ static dma_addr_t metag_dma_map_page(struct device *dev, struct page *page, static void m...
2023 Mar 02
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...> + * Returns the DMA addr. DMA_MAPPING_ERROR means error. > > > > > > + */ > > > > > > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset, > > > > > > + unsigned int length, enum dma_data_direction dir) > > > > > > +{ > > > > > > > > > > This (and the reset) needs to be done per virtqueue instead per device > > > > > after b0e504e5505d184b0be248b7dcdbe50b79f03758 ("virtio_ring: per > > > > > virtqueue dma devic...