Displaying 16 results from an estimated 16 matches for "dma_map_sg_attrs".
2016 Jun 02
0
[RFC v3 02/45] dma-mapping: Use unsigned long for dma_attrs
...,
 		     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 *dev, struct scatterlist *sgl,
 		 int nents, enum dma_data_direction dir,
-		 struct dma_attrs *attrs)
+		 unsigned long attrs)
 
 void
 dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl,
 		   int nents, enum dma_data_direction dir,
-		   struct dma_attrs *attrs)
+...
2016 Jun 02
0
[RFC v3 19/45] [media] dma-mapping: Use unsigned long for dma_attrs
...-	dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);
 
 	/* Only cache aligned DMA transfers are reliable */
 	if (!IS_ALIGNED(vaddr | size, dma_align)) {
@@ -554,7 +548,7 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr,
 	 * prepare() memop is called.
 	 */
 	sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents,
-				      buf->dma_dir, &attrs);
+				      buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC);
 	if (sgt->nents <= 0) {
 		pr_err("failed to map scatterlist\n");
 		ret = -EIO;
@@ -578,7 +572,7 @@ out:
 
 fail_map_sg:
 	dma_unmap_sg_attrs...
2023 Jun 22
1
[PATCH vhost v10 10/10] virtio_net: support dma premapped
...+{
> +	enum dma_data_direction dir;
> +	struct device *dev;
> +	int err, ret;
> +
> +	if (!premapped)
> +		return virtqueue_add_sg(vq, sg, num, out, data, ctx, gfp);
> +
> +	dir = out ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
> +	dev = virtqueue_dma_dev(vq);
> +
> +	ret = dma_map_sg_attrs(dev, sg, num, dir, 0);
> +	if (ret != num)
> +		goto err;
> +
> +	err = virtqueue_add_sg(vq, sg, num, out, data, ctx, gfp);
> +	if (err < 0)
> +		goto err;
> +
> +	return 0;
> +
> +err:
> +	dma_unmap_sg_attrs(dev, sg, num, dir, 0);
> +	return -ENOMEM;
> +}...
2020 Aug 24
2
Is: virtio_gpu_object_shmem_init issues? Was:Re: upstream boot error: general protection fault in swiotlb_map
...00350ef0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>  dma_direct_map_page include/linux/dma-direct.h:170 [inline]
>  dma_direct_map_sg+0x3bb/0x670 kernel/dma/direct.c:368
>  dma_map_sg_attrs+0xd0/0x160 kernel/dma/mapping.c:183
>  drm_gem_shmem_get_pages_sgt drivers/gpu/drm/drm_gem_shmem_helper.c:700 [inline]
>  drm_gem_shmem_get_pages_sgt+0x1fc/0x310 drivers/gpu/drm/drm_gem_shmem_helper.c:679
>  virtio_gpu_object_shmem_init drivers/gpu/drm/virtio/virtgpu_object.c:153 [inline]...
2020 Aug 13
1
[PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
...amp;& obj->funcs->get_sg_table)
>  		sgt = obj->funcs->get_sg_table(obj);
> -	else
> -		sgt = obj->dev->driver->gem_prime_get_sg_table(obj);
> +
> +	if (!sgt)
> +		return ERR_PTR(-EINVAL);
> +	else if (IS_ERR(sgt))
> +		return sgt;
>  
>  	if (!dma_map_sg_attrs(attach->dev, sgt->sgl, sgt->nents, dir,
>  			      DMA_ATTR_SKIP_CPU_SYNC)) {
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index 7116abc1a04e..8b325bf6cef4 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -36,10 +36,12 @@ struct d...
2020 Jul 16
0
[PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code
...ast + 1);
   258					err = -ENOMEM;
   259					goto err_map;
   260				}
   261				sg_set_page(sg, pg, sglen, 0);
   262				sg = sg_next(sg);
   263				if (!sg)
   264					goto done;
   265			}
   266		}
   267	done:
   268		mr->log_size = log_entity_size;
   269		mr->nsg = nsg;
   270		ret = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
   271		if (!ret)
   272			goto err_map;
   273	
   274		err = create_direct_mr(mvdev, mr);
   275		if (err)
   276			goto err_direct;
   277	
   278		return 0;
   279	
   280	err_direct:
   281		dma_unmap_sg_attrs(dma, mr->sg_head.sgl,...
2020 Aug 13
0
[PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
...VAL);
 
-	if (obj->funcs)
+	if (obj->funcs && obj->funcs->get_sg_table)
 		sgt = obj->funcs->get_sg_table(obj);
-	else
-		sgt = obj->dev->driver->gem_prime_get_sg_table(obj);
+
+	if (!sgt)
+		return ERR_PTR(-EINVAL);
+	else if (IS_ERR(sgt))
+		return sgt;
 
 	if (!dma_map_sg_attrs(attach->dev, sgt->sgl, sgt->nents, dir,
 			      DMA_ATTR_SKIP_CPU_SYNC)) {
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 7116abc1a04e..8b325bf6cef4 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -36,10 +36,12 @@ struct drm_file;
 struct drm_gem_objec...
2020 Sep 15
0
[PATCH v2 21/21] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
...VAL);
 
-	if (obj->funcs)
+	if (obj->funcs && obj->funcs->get_sg_table)
 		sgt = obj->funcs->get_sg_table(obj);
-	else
-		sgt = obj->dev->driver->gem_prime_get_sg_table(obj);
+
+	if (!sgt)
+		return ERR_PTR(-EINVAL);
+	else if (IS_ERR(sgt))
+		return sgt;
 
 	if (!dma_map_sg_attrs(attach->dev, sgt->sgl, sgt->nents, dir,
 			      DMA_ATTR_SKIP_CPU_SYNC)) {
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 9b11a2f0babc..240b0eab8018 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -36,10 +36,12 @@ struct drm_file;
 struct drm_gem_objec...
2009 Sep 10
1
[Bug 23830] New: nouvea modules on 2.6.31-rc6 failed
...mmon.h: At top level:
include/asm-generic/dma-mapping-common.h:43: warning: 'enum dma_data_direction'
declared inside parameter list
include/asm-generic/dma-mapping-common.h:42: error: parameter 4 ('dir') has
incomplete type
include/asm-generic/dma-mapping-common.h: In function 'dma_map_sg_attrs':
include/asm-generic/dma-mapping-common.h:52: error: dereferencing pointer to
incomplete type
include/asm-generic/dma-mapping-common.h: At top level:
include/asm-generic/dma-mapping-common.h:60: warning: 'enum dma_data_direction'
declared inside parameter list
include/asm-generic/dma-m...
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,
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
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
2020 Aug 13
28
[PATCH 00/20] Convert all remaining drivers to GEM object functions
The GEM and PRIME related callbacks in struct drm_driver are deprecated in
favor of GEM object functions in struct drm_gem_object_funcs. This patchset
converts the remaining drivers to object functions and removes most of the
obsolete interfaces.
Patches #1 to #18 convert DRM drivers to GEM object functions, one by one.
Each patch moves existing callbacks from struct drm_driver to an instance
of
2020 Sep 15
40
[PATCH v2 00/21] Convert all remaining drivers to GEM object functions
The GEM and PRIME related callbacks in struct drm_driver are deprecated in
favor of GEM object functions in struct drm_gem_object_funcs. This patchset
converts the remaining drivers to object functions and removes most of the
obsolete interfaces.
Patches #1 to #16 and #18 to #19 convert DRM drivers to GEM object functions,
one by one. Each patch moves existing callbacks from struct drm_driver to
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs
Now, virtio may can not work with DMA APIs when virtio features do not have
VIRTIO_F_ACCESS_PLATFORM.
1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just
   work with the "real" devices.
2. I tried to let xsk support callballs to get phy address from virtio-net
   driver as the dma address. But the maintainers of xsk may want to use
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs
Now, virtio may can not work with DMA APIs when virtio features do not have
VIRTIO_F_ACCESS_PLATFORM.
1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just
   work with the "real" devices.
2. I tried to let xsk support callballs to get phy address from virtio-net
   driver as the dma address. But the maintainers of xsk may want to use