[PATCH v5 4/5] usb: host: ohci-tmio: init genalloc for local memory

2019-05-21 Thread laurentiu . tudor
From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For co

[PATCH v5 1/5] lib/genalloc.c: Add gen_pool_dma_zalloc() for zeroed DMA allocations

2019-05-21 Thread laurentiu . tudor
From: Fredrik Noring gen_pool_dma_zalloc() is a zeroed memory variant of gen_pool_dma_alloc(). Document return values of both, and indicate NULL as a "%NULL" constant. Signed-off-by: Fredrik Noring --- include/linux/genalloc.h | 1 + lib/genalloc.c | 29 -

[PATCH v5 0/5] prerequisites for device reserved local mem rework

2019-05-21 Thread laurentiu . tudor
From: Laurentiu Tudor For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. Current implementation was relying

Re: [RFC PATCH v2 0/3] prerequisites for device reserved local mem rework

2019-05-17 Thread Laurentiu Tudor
usly the device memory was mapped with memremap() while with genalloc I'm doing a devm_ioremap(). I can't think of a relevant difference except that memremap() maps with WC buth maybe there are other arch specific subtleties. I've attached a new version of the ohci-ps2 patch repla

[PATCH v4 1/3] USB: use genalloc for USB HCs with local memory

2019-05-16 Thread laurentiu . tudor
From: Laurentiu Tudor For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. Current implementation was relying

[PATCH v4 3/3] usb: host: ohci-tmio: init genalloc for local memory

2019-05-16 Thread laurentiu . tudor
From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For co

[PATCH v4 2/3] usb: host: ohci-sm501: init genalloc for local memory

2019-05-16 Thread laurentiu . tudor
From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For co

Re: [RFC PATCH v2 0/3] prerequisites for device reserved local mem rework

2019-05-16 Thread Laurentiu Tudor
responding patch is below for reference. I applied your 1/3 patch > to test it. I took your code, added the missing mapping and placed it in a patch. Please see attached (compile tested only). --- Thanks & Best Regards, Laurentiu From 510c34990bbe899a2e4f43f3b904183f126f81de Mon Sep 1

[PATCH v4 0/3] prerequisites for device reserved local mem rework

2019-05-16 Thread laurentiu . tudor
From: Laurentiu Tudor For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. Current implementation was relying

Re: [RFC PATCH v2 0/3] prerequisites for device reserved local mem rework

2019-05-16 Thread Laurentiu Tudor
Hi Fredrik, Thanks very much for taking the time to look into this. Please see comments inline. On 15.05.2019 19:28, Fredrik Noring wrote: > Hi Lauretniu, > >> I think that any recent kernel will do, so I'd say your current branch >> should be fine. > > The kernel oopses with "unable to handle

[PATCH v3 3/3] usb: host: ohci-tmio: init genalloc for local memory

2019-05-15 Thread laurentiu . tudor
From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For co

[PATCH v3 2/3] usb: host: ohci-sm501: init genalloc for local memory

2019-05-15 Thread laurentiu . tudor
From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For co

[PATCH v3 1/3] USB: use genalloc for USB HCs with local memory

2019-05-15 Thread laurentiu . tudor
From: Laurentiu Tudor For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. Current implementation was relying

[PATCH v3 0/3] prerequisites for device reserved local mem rework

2019-05-15 Thread laurentiu . tudor
From: Laurentiu Tudor For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. Current implementation was relying

Re: [RFC PATCH v2 0/3] prerequisites for device reserved local mem rework

2019-05-15 Thread Laurentiu Tudor
Hello, On 14.05.2019 21:29, Fredrik Noring wrote: > Thanks Robin! > >>> For HCs that have local memory, replace the current DMA API usage >>> with a genalloc generic allocator to manage the mappings for these >>> devices. >>> This is in preparation for dropping the existing "coherent" dma >>> mem

Re: [RFC PATCH v2 1/3] USB: use genalloc for USB HCs with local memory

2019-05-15 Thread Laurentiu Tudor
On 14.05.2019 17:42, Christoph Hellwig wrote: >> @@ -136,6 +137,10 @@ void *hcd_buffer_alloc( >> if (size <= pool_max[i]) >> return dma_pool_alloc(hcd->pool[i], mem_flags, dma); >> } >> + >> +if (hcd->driver->flags & HCD_LOCAL_MEM) >> +return g

[RFC PATCH v2 3/3] usb: host: ohci-tmio: init genalloc for local memory

2019-05-14 Thread laurentiu . tudor
From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For co

[RFC PATCH v2 1/3] USB: use genalloc for USB HCs with local memory

2019-05-14 Thread laurentiu . tudor
From: Laurentiu Tudor For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. Current implementation was relying

[RFC PATCH v2 2/3] usb: host: ohci-sm501: init genalloc for local memory

2019-05-14 Thread laurentiu . tudor
From: Laurentiu Tudor In preparation for dropping the existing "coherent" dma mem declaration APIs, replace the current dma_declare_coherent_memory() based mechanism with the creation of a genalloc pool that will be used in the OHCI subsystem as replacement for the DMA APIs. For co

[RFC PATCH v2 0/3] prerequisites for device reserved local mem rework

2019-05-14 Thread laurentiu . tudor
From: Laurentiu Tudor For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. Current implementation was relying