Re: [PATCH 02/28] staging: android: ion: use vmap instead of vm_map_ram

2020-04-08 Thread Hillf Danton
On Wed, 8 Apr 2020 13:59:00 +0200 > > vm_map_ram can keep mappings around after the vm_unmap_ram. Using that > with non-PAGE_KERNEL mappings can lead to all kinds of aliasing issues. > > Signed-off-by: Christoph Hellwig > --- > drivers/staging/android/ion/ion_heap.c | 4 ++-- > 1 file chang

Re: [PATCH 04/28] dma-mapping: use vmap insted of reimplementing it

2020-04-08 Thread Hillf Danton
On Wed, 8 Apr 2020 13:59:02 +0200 Christoph Hellwig wrote: > > @@ -62,24 +42,20 @@ void *dma_common_pages_remap(struct page **pages, size_t > size, > void *dma_common_contiguous_remap(struct page *page, size_t size, > pgprot_t prot, const void *caller) > { > - int

Re: [rfc v2 3/6] dma-pool: dynamically expanding atomic pools

2020-04-10 Thread Hillf Danton
On Wed, 8 Apr 2020 14:21:06 -0700 (PDT) David Rientjes wrote: > > When an atomic pool becomes fully depleted because it is now relied upon > for all non-blocking allocations through the DMA API, allow background > expansion of each pool by a kworker. > > When an atomic pool has less than the de

Re: [PATCH V5 3/5] iommu/dma-iommu: Handle deferred devices

2019-08-16 Thread Hillf Danton
On Thu, 15 Aug 2019 12:09:41 +0100 Tom Murphy wrote: > > Handle devices which defer their attach to the iommu in the dma-iommu api > > Signed-off-by: Tom Murphy > --- > drivers/iommu/dma-iommu.c | 27 ++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --gi

Re: regression in ath10k dma allocation

2019-08-17 Thread Hillf Danton
On Sat, 17 Aug 2019 00:42:48 +0200 Tobias Klausmann wrote: >Hi Nicolin, > >On 17.08.19 00:25, Nicolin Chen wrote: >> Hi Tobias >> >> On Fri, Aug 16, 2019 at 10:16:45PM +0200, Tobias Klausmann wrote: do you have CONFIG_DMA_CMA set in your config? If not please make sure you have this co

Re: regression in ath10k dma allocation

2019-08-19 Thread Hillf Danton
On Tue, 20 Aug 2019 10:15:01 +0800 Christoph Hellwig wrote: > On Mon, Aug 19, 2019 at 06:58:52PM -0700, Nicolin Chen wrote: > > Right...the condition was in-between. However, not every caller > > of dma_alloc_contiguous() is supposed to have a coherent check. > > So we either add a 'bool coherent

Re: regression in ath10k dma allocation

2019-08-20 Thread Hillf Danton
utright or dip into a small zone that might not succeed either. > > Thanks to Hillf Danton for debugging this issue. > > Fixes: b1d2dc009dec ("dma-contiguous: add dma_{alloc,free}_contiguous() > helpers") > Reported-by: Tobias Klausmann > Signed-off-by: Christoph

Re: [PATCH v3 07/34] iommu: Add probe_device() and release_device() call-backs

2020-07-04 Thread Hillf Danton
On Wed, 29 Apr 2020 15:36:45 +0200 Joerg Roedel wrote: > > +static int __iommu_probe_device(struct device *dev) > +{ > + const struct iommu_ops *ops = dev->bus->iommu_ops; > + struct iommu_device *iommu_dev; > + struct iommu_group *group; > + int ret; > + > + iommu_dev = ops-

[RFC PATCH] vfio: type1: fix kthread use case

2020-07-06 Thread Hillf Danton
ce to switch mm. Fixes: 8d46c0cca5f4 ("vfio: introduce vfio_dma_rw to read/write a range of IOVAs") Cc: Yan Zhao Cc: Markus Elfring Cc: Christoph Hellwig Signed-off-by: Hillf Danton --- --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -279

Re: [RFC PATCH] vfio: type1: fix kthread use case

2020-07-06 Thread Hillf Danton
On Mon, 6 Jul 2020 13:32:18 +0200 Markus Elfring wrote: > =E2=80=A6 > > +++ b/drivers/vfio/vfio_iommu_type1.c > > @@ -2798,7 +2798,8 @@ static int vfio_iommu_type1_dma_rw_chunk > =E2=80=A6 > > - bool kthread =3D current->mm =3D=3D NULL; > > + bool kthread =3D current->flags & PF_KTHREAD; > >

Re: [RFC PATCH] vfio: type1: fix kthread use case

2020-07-06 Thread Hillf Danton
On Mon, 6 Jul 2020 15:33:58 +0200 Markus Elfring wrote: > > I would prefer the following variable declarations then. > > + bool kthread, use_mm; > > > > size_t offset; > > > > + kthread =3D current->flags & PF_KTHREAD; > > + use_mm =3D current->mm =3D=3D NULL; > > I propose to mov

Re: [RFC PATCH] vfio: type1: fix kthread use case

2020-07-06 Thread Hillf Danton
On Mon, 6 Jul 2020 16:04:13 +0200 Markus Elfring wrote: > > Can another design approach make sense here? > > + bool thread_use_mm = ((current->flags & PF_KTHREAD) && !current->mm); > + if (thread_use_mm) Good. See below. > > > > kthread_use_mm(mm); --- a/drivers/vfio/vf

Re: [RFC PATCH] vfio: type1: fix kthread use case

2020-07-06 Thread Hillf Danton
On Tue, 7 Jul 2020 08:31:41 +0800 Yan Zhao wrote: > > I think "current->mm == NULL" in itself implies kthread and not use_mm, > as a user thread is not able to have "current->mm == NULL", right? Nope, it's the fix target as checking the current mm does not make sense without current being kthrea

Re: [PATCH 7/7] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-02-04 Thread Hillf Danton
Tue, 2 Feb 2021 10:51:10 +0100 > From: Ricardo Ribalda > > On architectures where the is no coherent caching such as ARM use the > dma_alloc_noncontiguos API and handle manually the cache flushing using > dma_sync_sgtable(). > > With this patch on the affected architectures we can measure up to

Re: [PATCH 4/8] dma-direct: use __GFP_ZERO in dma_direct_alloc_pages

2020-10-06 Thread Hillf Danton
On Wed, 30 Sep 2020 18:09:13 Christoph Hellwig wrote: > > Prepare for supporting the DMA_ATTR_NO_KERNEL_MAPPING flag in > dma_alloc_pages. > > Signed-off-by: Christoph Hellwig > --- > kernel/dma/direct.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/kernel