Re: [PATCH v4 2/6] misc: Generic on-chip SRAM allocation driver

From: Matt Porter
Date: Thu Oct 04 2012 - 11:24:44 EST


On Fri, Sep 07, 2012 at 02:43:44PM +0200, Philipp Zabel wrote:
> This driver requests and remaps a memory region as configured in the
> device tree. It serves memory from this region via the genalloc API.
>
> Other drivers can retrieve the genalloc pool from a phandle pointing
> to this drivers' device node in the device tree.

<snip>

> + sram->pool = gen_pool_create(PAGE_SHIFT, -1);
> + if (!sram->pool)
> + return -ENOMEM;

As mentioned in the uio_pruss/genalloc discussion, removing the
hardcoded minimum allocation order will allow this to be used for
a number of other cases. The most notable is moving mach-davinci/
off of its own genalloc-based SRAM arch driver. Some of the davinci
SoCs have very small SRAMs and need the ability to allocate a smaller
chunk.

Here's a build-tested patch to add this option: