Re: [PATCH] staging: android: ion: Skip sync if not mapped

2020-04-17 Thread Ørjan Eide
On Thu, Apr 16, 2020 at 12:49:56PM +0300, Dan Carpenter wrote: > On Tue, Apr 14, 2020 at 04:18:47PM +0200, Ørjan Eide wrote: > > @@ -238,6 +242,10 @@ static void ion_unmap_dma_buf(struct > > dma_buf_attachment *attachment, > > s

Re: [PATCH] staging: android: ion: Skip sync if not mapped

2020-04-15 Thread Ørjan Eide
On Tue, Apr 14, 2020 at 04:28:10PM +0200, Greg Kroah-Hartman wrote: > On Tue, Apr 14, 2020 at 04:18:47PM +0200, �rjan Eide wrote: > > Only sync the sg-list of an Ion dma-buf attachment when the attachment > > is actually mapped on the device. > > > > dma-bufs may be synced at any time. It can be

[PATCH] staging: android: ion: Skip sync if not mapped

2020-04-15 Thread Ørjan Eide
dma-direct: correct the physical addr in dma_direct_sync_sg_for_cpu/device") moves the dma-api back to the old behaviour and picks the dma_address that may be invalid. dma-buf core doesn't ensure that the buffer is mapped on the device, and thus have a valid sg_list, before calling the exporter's beg

[PATCH] staging: android: ion: Skip sync if not mapped

2020-04-15 Thread Ørjan Eide
dma-direct: correct the physical addr in dma_direct_sync_sg_for_cpu/device") moves the dma-api back to the old behaviour and picks the dma_address that may be invalid. dma-buf core doesn't ensure that the buffer is mapped on the device, and thus have a valid sg_list, before calling the exporter's beg

Re: [Linaro-mm-sig] [PATCH 2/4] staging: android: ion: Restrict cache maintenance to dma mapped memory

2019-02-08 Thread Ørjan Eide
back to the device using dma_sync_{single,sg}_to_device. > > > I've run some testing, and this patch does indeed fix the crash in > > dma_sync_sg_for_cpu when it tried to use the 0 dma_address from the sg > > list. > > > > Tested-by: Ørjan Eide > > &g

Re: [Linaro-mm-sig] [PATCH 2/4] staging: android: ion: Restrict cache maintenance to dma mapped memory

2019-02-07 Thread Ørjan Eide
rally > > > while a buffer is dma mapped you have the device access it (though of > > > course it is supported for CPU to access to the buffer while dma mapped) > > > and then once the buffer is dma-unmapped the CPU can access it. This is > > > how the D

[PATCH 2/2] ARM: DMA: Use vm_pgoff for IOMMU mmap

2015-04-16 Thread Ørjan Eide
arm_iommu_mmap_attrs() ignores the page offset in vma->vm_pgoff that was specified in the mmap call. Any user of dma_mmap_* will get an unexpected result when the device uses the IOMMU DMA ops. Some DRM driver that use dma_mmap_* seems to depend on it ignoring vma->vm_pgoff. Both the Samsung Exyn

[PATCH 1/2] drm: rockchip: Don't pass DRM fake offset to dma-api

2015-04-16 Thread Ørjan Eide
Set vm_pgoff to 0 after using it to look up the GEM node, before passing it on rockchip_gem_mmap_buf() where the offset must be from the start of the buffer. Passing in the fake offset currently works because the dma_mmap_attrs implementation that is used for this device, arm_iommu_mmap_attrs, ign