Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-25 Thread Afzal Mohammed
Hi, On Fri, Jun 24, 2016 at 12:15:41PM -0400, Lennart Sorensen wrote: > although the style does require using brackets for the else if the > if required them. As an aside, though most of the style rationale is K & R, K & R consistently uses unbalanced braces for if-else-* For a one that learns

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-24 Thread Lennart Sorensen
On Fri, Jun 24, 2016 at 07:58:32PM +0300, Grygorii Strashko wrote: > Oh. nice :( So, seems, I'd need to send v3. Right? > By the way, this code hasn't been introduced by this patch - I've > just moved whole function from one place to another. Well since it is moving I would think that was a handy

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-24 Thread Grygorii Strashko
On 06/24/2016 07:15 PM, Lennart Sorensen wrote: > On Fri, Jun 24, 2016 at 11:35:15AM +0530, Mugunthan V N wrote: +static void cpdma_desc_pool_destroy(struct cpdma_desc_pool *pool) +{ +if (!pool) +return; + +WARN_ON(pool->used_desc); +if

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-24 Thread Lennart Sorensen
On Fri, Jun 24, 2016 at 11:35:15AM +0530, Mugunthan V N wrote: > >> +static void cpdma_desc_pool_destroy(struct cpdma_desc_pool *pool) > >> +{ > >> +if (!pool) > >> +return; > >> + > >> +WARN_ON(pool->used_desc); > >> +if (pool->cpumap) { > >> +

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-24 Thread Afzal Mohammed
Hi, On Fri, Jun 24, 2016 at 11:35:15AM +0530, Mugunthan V N wrote: > On Thursday 23 June 2016 06:26 PM, Ivan Khoronzhuk wrote: > >> +if (pool->cpumap) { > >> +dma_free_coherent(pool->dev, pool->mem_size, pool->cpumap, > >> + pool->phys); > >> +} else { > >> +

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-24 Thread Mugunthan V N
On Thursday 23 June 2016 06:26 PM, Ivan Khoronzhuk wrote: > > > On 23.06.16 15:36, Grygorii Strashko wrote: >> TI CPDMA currently uses a bitmap for tracking descriptors alloactions >> allocations, but The genalloc already handles the same and can be used >> as with special memory (SRAM) as with

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-24 Thread Mugunthan V N
On Thursday 23 June 2016 06:06 PM, Grygorii Strashko wrote: > TI CPDMA currently uses a bitmap for tracking descriptors alloactions > allocations, but The genalloc already handles the same and can be used > as with special memory (SRAM) as with DMA cherent memory chank > (dma_alloc_coherent()).

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-23 Thread ivan.khoronzhuk
On 23.06.16 15:36, Grygorii Strashko wrote: TI CPDMA currently uses a bitmap for tracking descriptors alloactions allocations, but The genalloc already handles the same and can be used as with special memory (SRAM) as with DMA cherent memory chank (dma_alloc_coherent()). Hence, switch to using

Re: [PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-23 Thread Ivan Khoronzhuk
On 23.06.16 15:36, Grygorii Strashko wrote: TI CPDMA currently uses a bitmap for tracking descriptors alloactions allocations, but The genalloc already handles the same and can be used as with special memory (SRAM) as with DMA cherent memory chank (dma_alloc_coherent()). Hence, switch to using

[PATCH] net: ethernet: ti: cpdma: switch to use genalloc

2016-06-23 Thread Grygorii Strashko
TI CPDMA currently uses a bitmap for tracking descriptors alloactions allocations, but The genalloc already handles the same and can be used as with special memory (SRAM) as with DMA cherent memory chank (dma_alloc_coherent()). Hence, switch to using genalloc and add desc_num property for each