Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-08 Thread Alexey Skidanov
On 11/8/18 00:14, Andrew Morton wrote: > On Wed, 7 Nov 2018 08:21:07 +0200 Alexey Skidanov > wrote: > >>> Why does this need "fixing"? Are there current callers which can >>> misalign chunk_start_addr? Or is there a requirement that future >>> callers can misalign chunk_start_addr? >>> >>

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-08 Thread Alexey Skidanov
On 11/8/18 00:14, Andrew Morton wrote: > On Wed, 7 Nov 2018 08:21:07 +0200 Alexey Skidanov > wrote: > >>> Why does this need "fixing"? Are there current callers which can >>> misalign chunk_start_addr? Or is there a requirement that future >>> callers can misalign chunk_start_addr? >>> >>

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-08 Thread Alexey Skidanov
On 11/8/18 00:12, Andrew Morton wrote: > On Wed, 7 Nov 2018 08:27:31 +0200 Alexey Skidanov > wrote: > >> >> >> On 11/7/18 12:15 AM, Andrew Morton wrote: >>> On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov >>> wrote: >>> On success, gen_pool_first_fit_align() returns the bit number

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-08 Thread Alexey Skidanov
On 11/8/18 00:12, Andrew Morton wrote: > On Wed, 7 Nov 2018 08:27:31 +0200 Alexey Skidanov > wrote: > >> >> >> On 11/7/18 12:15 AM, Andrew Morton wrote: >>> On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov >>> wrote: >>> On success, gen_pool_first_fit_align() returns the bit number

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 08:21:07 +0200 Alexey Skidanov wrote: > > Why does this need "fixing"? Are there current callers which can > > misalign chunk_start_addr? Or is there a requirement that future > > callers can misalign chunk_start_addr? > > > I work on adding aligned allocation support for

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 08:21:07 +0200 Alexey Skidanov wrote: > > Why does this need "fixing"? Are there current callers which can > > misalign chunk_start_addr? Or is there a requirement that future > > callers can misalign chunk_start_addr? > > > I work on adding aligned allocation support for

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 08:27:31 +0200 Alexey Skidanov wrote: > > > On 11/7/18 12:15 AM, Andrew Morton wrote: > > On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov > > wrote: > > > >> On success, gen_pool_first_fit_align() returns the bit number such that > >> chunk_start_addr + (bit << order)

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 08:27:31 +0200 Alexey Skidanov wrote: > > > On 11/7/18 12:15 AM, Andrew Morton wrote: > > On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov > > wrote: > > > >> On success, gen_pool_first_fit_align() returns the bit number such that > >> chunk_start_addr + (bit << order)

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Alexey Skidanov
On 11/7/18 12:15 AM, Andrew Morton wrote: > On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov > wrote: > >> On success, gen_pool_first_fit_align() returns the bit number such that >> chunk_start_addr + (bit << order) is properly aligned. On failure, >> the bitmap size parameter is returned.

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Alexey Skidanov
On 11/7/18 12:15 AM, Andrew Morton wrote: > On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov > wrote: > >> On success, gen_pool_first_fit_align() returns the bit number such that >> chunk_start_addr + (bit << order) is properly aligned. On failure, >> the bitmap size parameter is returned.

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Alexey Skidanov
On 11/7/18 12:11 AM, Andrew Morton wrote: > On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov > wrote: > >> On success, gen_pool_first_fit_align() returns the bit number such that >> chunk_start_addr + (bit << order) is properly aligned. On failure, >> the bitmap size parameter is returned.

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Alexey Skidanov
On 11/7/18 12:11 AM, Andrew Morton wrote: > On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov > wrote: > >> On success, gen_pool_first_fit_align() returns the bit number such that >> chunk_start_addr + (bit << order) is properly aligned. On failure, >> the bitmap size parameter is returned.

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Andrew Morton
On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov wrote: > On success, gen_pool_first_fit_align() returns the bit number such that > chunk_start_addr + (bit << order) is properly aligned. On failure, > the bitmap size parameter is returned. > > When the chunk_start_addr isn't aligned

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Andrew Morton
On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov wrote: > On success, gen_pool_first_fit_align() returns the bit number such that > chunk_start_addr + (bit << order) is properly aligned. On failure, > the bitmap size parameter is returned. > > When the chunk_start_addr isn't aligned

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Andrew Morton
On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov wrote: > On success, gen_pool_first_fit_align() returns the bit number such that > chunk_start_addr + (bit << order) is properly aligned. On failure, > the bitmap size parameter is returned. > > When the chunk_start_addr isn't aligned

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Andrew Morton
On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov wrote: > On success, gen_pool_first_fit_align() returns the bit number such that > chunk_start_addr + (bit << order) is properly aligned. On failure, > the bitmap size parameter is returned. > > When the chunk_start_addr isn't aligned

[PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Alexey Skidanov
On success, gen_pool_first_fit_align() returns the bit number such that chunk_start_addr + (bit << order) is properly aligned. On failure, the bitmap size parameter is returned. When the chunk_start_addr isn't aligned properly, the chunk_start_addr + (bit << order) isn't aligned too. To fix

[PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Alexey Skidanov
On success, gen_pool_first_fit_align() returns the bit number such that chunk_start_addr + (bit << order) is properly aligned. On failure, the bitmap size parameter is returned. When the chunk_start_addr isn't aligned properly, the chunk_start_addr + (bit << order) isn't aligned too. To fix