[Nouveau] [PATCH 14/17] dma-mapping: add a new dma_alloc_pages API

2020-09-14 Thread Christoph Hellwig
This API is the equivalent of alloc_pages, except that the returned memory is guaranteed to be DMA addressable by the passed in device. The implementation will also be used to provide a more sensible replacement for DMA_ATTR_NON_CONSISTENT flag. Additionally dma_alloc_noncoherent is switched

[Nouveau] [PATCH 04/17] drm/nouveau/gk20a: stop setting DMA_ATTR_NON_CONSISTENT

2020-09-14 Thread Christoph Hellwig
DMA_ATTR_NON_CONSISTENT is a no-op except on PARISC and some mips configs, so don't set it in this ARM specific driver part. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[Nouveau] [PATCH 11/17] sgiseeq: convert to dma_alloc_noncoherent

2020-09-14 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. This includes adding additional calls to dma_sync_desc_dev as the old syncing was rather ad-hoc. Thanks to Thomas Bogendoerfer for debugging the ownership transfer issues. Signed-off-by: Christoph Hellwig ---

Re: [Nouveau] [PATCH 07/17] 53c700: improve non-coherent DMA handling

2020-09-14 Thread James Bottomley
On Mon, 2020-09-14 at 16:44 +0200, Christoph Hellwig wrote: > @@ -429,7 +430,7 @@ struct NCR_700_Host_Parameters { > for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); > i++) { \ > __u32 val = > bS_to_cpu((script)[A_##symbol##_used[i]]) + da; \ >

Re: [Nouveau] [PATCH 01/20] drm/amdgpu: Introduce GEM object functions

2020-09-14 Thread Thomas Zimmermann
Hi Am 13.08.20 um 12:22 schrieb Christian König: > Am 13.08.20 um 10:36 schrieb Thomas Zimmermann: >> GEM object functions deprecate several similar callback interfaces in >> struct drm_driver. This patch replaces the per-driver callbacks with >> per-instance callbacks in amdgpu. The only

[Nouveau] [PATCH 01/17] media/v4l2: remove V4L2-FLAG-MEMORY-NON-CONSISTENT flag

2020-09-14 Thread Christoph Hellwig
From: Sergey Senozhatsky The patch partially reverts some of the UAPI bits of the buffer cache management hints. Namely, the queue consistency (memory coherency) user-space hint because, as it turned out, the kernel implementation of this feature was misusing DMA_ATTR_NON_CONSISTENT. The patch

[Nouveau] [PATCH 06/17] lib82596: move DMA allocation into the callers of i82596_probe

2020-09-14 Thread Christoph Hellwig
This allows us to get rid of the LIB82596_DMA_ATTR defined and prepare for untangling the coherent vs non-coherent DMA allocation API. Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/i825xx/lasi_82596.c | 24 ++-- drivers/net/ethernet/i825xx/lib82596.c | 36

Re: [Nouveau] a saner API for allocating DMA addressable pages v2

2020-09-14 Thread Matthew Wilcox
On Mon, Sep 14, 2020 at 04:44:16PM +0200, Christoph Hellwig wrote: > I'm still a little unsure about the API naming, as alloc_pages sort of > implies a struct page return value, but we return a kernel virtual > address. Erm ... dma_alloc_pages() returns a struct page, so is this sentence stale?

[Nouveau] [PATCH 08/17] dma-mapping: add a new dma_alloc_noncoherent API

2020-09-14 Thread Christoph Hellwig
Add a new API to allocate and free memory that is guaranteed to be addressable by a device, but which potentially is not cache coherent for DMA. To transfer ownership to and from the device, the existing streaming DMA API calls dma_sync_single_for_device and dma_sync_single_for_cpu must be used.

[Nouveau] a saner API for allocating DMA addressable pages v2

2020-09-14 Thread Christoph Hellwig
Hi all, this series replaced the DMA_ATTR_NON_CONSISTENT flag to dma_alloc_attrs with a separate new dma_alloc_pages API, which is available on all platforms. In addition to cleaning up the convoluted code path, this ensures that other drivers that have asked for better support for non-coherent

[Nouveau] [PATCH 02/17] mm: turn alloc_pages into an inline function

2020-09-14 Thread Christoph Hellwig
To prevent a compiler error when a method call alloc_pages is added (which I plan to for the dma_map_ops). Signed-off-by: Christoph Hellwig --- include/linux/gfp.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index

[Nouveau] [PATCH 12/17] 53c700: convert to dma_alloc_noncoherent

2020-09-14 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. Signed-off-by: Christoph Hellwig --- drivers/scsi/53c700.c | 11 +-- drivers/scsi/53c700.h | 16 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/53c700.c

[Nouveau] [PATCH 16/17] dma-iommu: implement ->alloc_noncoherent

2020-09-14 Thread Christoph Hellwig
Implement the alloc_noncoherent method to provide memory that is neither coherent not contiguous. Signed-off-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 41 +++ 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/dma-iommu.c

[Nouveau] [PATCH 10/17] hal2: convert to dma_alloc_noncoherent

2020-09-14 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. This also means we can allocate the buffer memory with the proper direction instead of bidirectional. Signed-off-by: Christoph Hellwig --- sound/mips/hal2.c | 58 ++- 1 file

[Nouveau] [PATCH 09/17] sgiwd93: convert to dma_alloc_noncoherent

2020-09-14 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. This also means we can allocate the memory as DMA_TO_DEVICE instead of bidirectional. Signed-off-by: Christoph Hellwig --- drivers/scsi/sgiwd93.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

[Nouveau] [PATCH 15/17] dma-mapping: add new {alloc, free}_noncoherent dma_map_ops methods

2020-09-14 Thread Christoph Hellwig
This will allow IOMMU drivers to allocate non-contigous memory and return a vmapped virtual address. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 5 + kernel/dma/mapping.c| 33 +++-- 2 files changed, 32 insertions(+), 6 deletions(-)

Re: [Nouveau] [PATCH 11/17] sgiseeq: convert to dma_alloc_noncoherent

2020-09-14 Thread Matthew Wilcox
On Mon, Sep 14, 2020 at 04:44:27PM +0200, Christoph Hellwig wrote: > drivers/net/ethernet/i825xx/lasi_82596.c | 25 ++--- > drivers/net/ethernet/i825xx/lib82596.c | 114 ++- > drivers/net/ethernet/i825xx/sni_82596.c | 4 - > drivers/net/ethernet/seeq/sgiseeq.c | 28

[Nouveau] [PATCH 03/17] drm/exynos: stop setting DMA_ATTR_NON_CONSISTENT

2020-09-14 Thread Christoph Hellwig
DMA_ATTR_NON_CONSISTENT is a no-op except on PARISC and some mips configs, so don't set it in this ARM specific driver. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c

[Nouveau] [PATCH 13/17] dma-mapping: remove dma_cache_sync

2020-09-14 Thread Christoph Hellwig
All users are gone now, remove the API. Signed-off-by: Christoph Hellwig --- arch/mips/Kconfig | 1 - arch/mips/jazz/jazzdma.c| 1 - arch/mips/mm/dma-noncoherent.c | 6 -- arch/parisc/Kconfig | 1 - arch/parisc/kernel/pci-dma.c| 6 --

[Nouveau] [PATCH 05/17] net/au1000-eth: stop using DMA_ATTR_NON_CONSISTENT

2020-09-14 Thread Christoph Hellwig
The au1000-eth driver contains none of the manual cache synchronization required for using DMA_ATTR_NON_CONSISTENT. From what I can tell it can be used on both dma coherent and non-coherent DMA platforms, but I suspect it has been buggy on the non-coherent platforms all along. Signed-off-by:

Re: [Nouveau] [PATCH 03/17] drm/exynos: stop setting DMA_ATTR_NON_CONSISTENT

2020-09-14 Thread Sergei Shtylyov
On 9/14/20 5:44 PM, Christoph Hellwig wrote: > DMA_ATTR_NON_CONSISTENT is a no-op except on PARISC and some mips > configs, so don't set it in this ARM specific driver. Hm, PARICS and ARM capitalized but mips in lower case? :-) > Signed-off-by: Christoph Hellwig [...] MBR, Sergei

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-14 Thread Dan Williams
On Mon, Sep 14, 2020 at 3:45 PM Ralph Campbell wrote: > > ZONE_DEVICE struct pages have an extra reference count that complicates the > code for put_page() and several places in the kernel that need to check the > reference count to see that a page is not being used (gup, compaction, > migration,

Re: [Nouveau] [PATCH 01/20] drm/amdgpu: Introduce GEM object functions

2020-09-14 Thread Christian König
Am 14.09.20 um 17:05 schrieb Thomas Zimmermann: Hi Am 13.08.20 um 12:22 schrieb Christian König: Am 13.08.20 um 10:36 schrieb Thomas Zimmermann: GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with

[Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-14 Thread Ralph Campbell
ZONE_DEVICE struct pages have an extra reference count that complicates the code for put_page() and several places in the kernel that need to check the reference count to see that a page is not being used (gup, compaction, migration, etc.). Clean up the code so the reference count doesn't need to

Re: [Nouveau] libva-utils test siuite is crashing in nouveau sriver

2020-09-14 Thread Ilia Mirkin
On Sun, Sep 13, 2020 at 5:01 PM Tomasz Kłoczko wrote: > > > On Sun, 13 Sep 2020 at 20:35, Ilia Mirkin wrote: >> >> What hardware are you using? > > > :18:00.0 VGA compatible controller: NVIDIA Corporation GP104GL [Quadro > P4000] (rev a1) There's no acceleration support for video decoding