[RFC PATCH] lib/genalloc: add parameter description to fix doc compile warning

2021-04-05 Thread alexs
From: Alex Shi commit 52fbf1134d47 ("lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk") add a new parameter 'start_addr' w/o description for it. That cause some doc compile warning: lib/genalloc.c:649: warning: Function parameter or member 'start_addr' not described in '

[PATCH] lib: genalloc: fix warning generated by checkpatch

2021-02-21 Thread Hassan Shahbazi
Add missing blank line after declarations. Signed-off-by: Hassan Shahbazi --- lib/genalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/genalloc.c b/lib/genalloc.c index dab97bb69df6..3e901fd93b00 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c @@ -757,6 +757,7 @@ unsigned long gen

[PATCH] lib: genalloc: fix warning generated by checkpatch

2021-02-18 Thread Hassan Shahbazi
Add missing blank line after declarations. Signed-off-by: Hassan Shahbazi --- lib/genalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/genalloc.c b/lib/genalloc.c index dab97bb69df6..3e901fd93b00 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c @@ -757,6 +757,7 @@ unsigned long gen

[PATCH 4.14 05/57] lib/genalloc: fix the overflow when size is too big

2021-01-11 Thread Greg Kroah-Hartman
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH 4.19 07/77] lib/genalloc: fix the overflow when size is too big

2021-01-11 Thread Greg Kroah-Hartman
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH 5.10 065/145] lib/genalloc: fix the overflow when size is too big

2021-01-11 Thread Greg Kroah-Hartman
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH 5.4 06/92] lib/genalloc: fix the overflow when size is too big

2021-01-11 Thread Greg Kroah-Hartman
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH 4.9 03/45] lib/genalloc: fix the overflow when size is too big

2021-01-11 Thread Greg Kroah-Hartman
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH 4.4 03/38] lib/genalloc: fix the overflow when size is too big

2021-01-11 Thread Greg Kroah-Hartman
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH] lib/genalloc: change return type to unsigned long for bitmap_set_ll

2021-01-04 Thread Huang Shijie
Just as bitmap_clear_ll(), change return type to unsigned long for bitmap_set_ll to avoid the possible overflow in future. Signed-off-by: Huang Shijie --- This patch is not a bug fix. I missed to change it in previous patch. --- lib/genalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 delet

[PATCH AUTOSEL 4.14 5/6] lib/genalloc: fix the overflow when size is too big

2021-01-04 Thread Sasha Levin
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH AUTOSEL 5.4 7/8] lib/genalloc: fix the overflow when size is too big

2021-01-04 Thread Sasha Levin
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH AUTOSEL 4.4 2/3] lib/genalloc: fix the overflow when size is too big

2021-01-04 Thread Sasha Levin
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH AUTOSEL 4.19 7/8] lib/genalloc: fix the overflow when size is too big

2021-01-04 Thread Sasha Levin
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH AUTOSEL 4.9 3/4] lib/genalloc: fix the overflow when size is too big

2021-01-04 Thread Sasha Levin
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH AUTOSEL 5.10 15/17] lib/genalloc: fix the overflow when size is too big

2021-01-04 Thread Sasha Levin
From: Huang Shijie [ Upstream commit 36845663843fc59c5d794e3dc0641472e3e572da ] Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G,

[PATCH] lib/genalloc: fix the overflow when size is too big

2020-12-28 Thread Huang Shijie
Some graphic card has very big memory on chip, such as 32G bytes. In the following case, it will cause overflow: pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); ret = gen_pool_add(pool, 0x100, SZ_32G, NUMA_NO_NODE); va = gen_pool_alloc(po

Re: lib/genalloc

2018-11-02 Thread Alexey Skidanov
On 11/2/18 11:16 PM, Daniel Mentz wrote: > On Fri, Nov 2, 2018 at 1:55 PM Alexey Skidanov > wrote: >> >> >> >> On 11/2/18 9:17 PM, Daniel Mentz wrote: >>> On Thu, Nov 1, 2018 at 10:07 AM Alexey Skidanov >>> wrote: On 11/1/18 18:48, Stephen Bates wrote: >>I use gen_pool_first_fit_

Re: lib/genalloc

2018-11-02 Thread Daniel Mentz
On Fri, Nov 2, 2018 at 1:55 PM Alexey Skidanov wrote: > > > > On 11/2/18 9:17 PM, Daniel Mentz wrote: > > On Thu, Nov 1, 2018 at 10:07 AM Alexey Skidanov > > wrote: > >> On 11/1/18 18:48, Stephen Bates wrote: > I use gen_pool_first_fit_align() as pool allocation algorithm > allocat

Re: lib/genalloc

2018-11-02 Thread Alexey Skidanov
On 11/2/18 9:17 PM, Daniel Mentz wrote: > On Thu, Nov 1, 2018 at 10:07 AM Alexey Skidanov > wrote: >> On 11/1/18 18:48, Stephen Bates wrote: I use gen_pool_first_fit_align() as pool allocation algorithm allocating buffers with requested alignment. But if a chunk base address is

Re: lib/genalloc

2018-11-02 Thread Daniel Mentz
On Thu, Nov 1, 2018 at 10:07 AM Alexey Skidanov wrote: > On 11/1/18 18:48, Stephen Bates wrote: > >>I use gen_pool_first_fit_align() as pool allocation algorithm allocating > >>buffers with requested alignment. But if a chunk base address is not > >>aligned to the requested alignment(

Re: lib/genalloc

2018-11-01 Thread Alexey Skidanov
On 11/1/18 18:48, Stephen Bates wrote: >>I use gen_pool_first_fit_align() as pool allocation algorithm allocating >>buffers with requested alignment. But if a chunk base address is not >>aligned to the requested alignment(from some reason), the returned >>address is not aligned

Re: lib/genalloc

2018-11-01 Thread Stephen Bates
>I use gen_pool_first_fit_align() as pool allocation algorithm allocating >buffers with requested alignment. But if a chunk base address is not >aligned to the requested alignment(from some reason), the returned >address is not aligned too. Alexey Can you try using gen_pool_fi

lib/genalloc

2018-11-01 Thread Alexey Skidanov
Hi, I use gen_pool_first_fit_align() as pool allocation algorithm allocating buffers with requested alignment. But if a chunk base address is not aligned to the requested alignment(from some reason), the returned address is not aligned too. The reason is the allocation algorithm works on bitmap,

[PATCH][RESEND 1/8] lib/genalloc: add a helper function for DMA buffer allocation

2013-11-01 Thread Nicolin Chen
When using pool space for DMA buffer, there might be duplicated calling of gen_pool_alloc() and gen_pool_virt_to_phys() in each implementation. Thus it's better to add a simple helper function, a compatible one to the common dma_alloc_coherent(), to save some code. Signed-off-by: Nicolin Chen --

[PATCH 1/8] lib/genalloc: add a helper function for DMA buffer allocation

2013-11-01 Thread Nicolin Chen
When using pool space for DMA buffer, there might be duplicated calling of gen_pool_alloc() and gen_pool_virt_to_phys() in each implementation. Thus it's better to add a simple helper function, a compatible one to the common dma_alloc_coherent(), to save some code. Signed-off-by: Nicolin Chen --

Re: [PATCH][RESEND] lib/genalloc: add a helper function for DMA buffer allocation

2013-10-31 Thread Nicolin Chen
Sir, On Thu, Oct 31, 2013 at 02:26:19PM -0700, Andrew Morton wrote: > On Thu, 31 Oct 2013 17:16:07 +0800 Nicolin Chen wrote: > > > When using pool space for DMA buffer, there might be duplicated calling > > of gen_pool_alloc() and gen_pool_virt_to_phys() in each implementation. > > > > Thus it'

Re: [PATCH][RESEND] lib/genalloc: add a helper function for DMA buffer allocation

2013-10-31 Thread Andrew Morton
On Thu, 31 Oct 2013 17:16:07 +0800 Nicolin Chen wrote: > When using pool space for DMA buffer, there might be duplicated calling > of gen_pool_alloc() and gen_pool_virt_to_phys() in each implementation. > > Thus it's better to add a simple helper function, a compatible one to > the common dma_al

[PATCH][RESEND] lib/genalloc: add a helper function for DMA buffer allocation

2013-10-31 Thread Nicolin Chen
When using pool space for DMA buffer, there might be duplicated calling of gen_pool_alloc() and gen_pool_virt_to_phys() in each implementation. Thus it's better to add a simple helper function, a compatible one to the common dma_alloc_coherent(), to save some code. Signed-off-by: Nicolin Chen --

[PATCH] lib/genalloc: add a helper function for DMA buffer allocation

2013-10-21 Thread Nicolin Chen
When using pool space for DMA buffer, there might be duplicated calling of gen_pool_alloc() and gen_pool_virt_to_phys() in each implementation. Thus it's better to add a simple helper function, a compatible one to the common dma_alloc_coherent(), to save some code. Signed-off-by: Nicolin Chen --