<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/genalloc.c, branch v3.18.40</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.40</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.40'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-12-03T17:36:04Z</updated>
<entry>
<title>lib/genalloc.c: export devm_gen_pool_create() for modules</title>
<updated>2014-12-03T17:36:04Z</updated>
<author>
<name>Michal Simek</name>
<email>michal.simek@xilinx.com</email>
</author>
<published>2014-12-02T23:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b724aa213df7aee08d57237ee0bbafffef09aea5'/>
<id>urn:sha1:b724aa213df7aee08d57237ee0bbafffef09aea5</id>
<content type='text'>
Modules can use this function for creating pool.

Signed-off-by: Michal Simek &lt;michal.simek@xilinx.com&gt;
Acked-by: Lad, Prabhakar &lt;prabhakar.csengg@gmail.com&gt;
Cc: Laura Abbott &lt;lauraa@codeaurora.org&gt;
Cc: Olof Johansson &lt;olof@lixom.net&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Vladimir Zapolskiy &lt;vladimir_zapolskiy@mentor.com&gt;
Cc: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/genalloc.c: add genpool range check function</title>
<updated>2014-10-10T02:25:52Z</updated>
<author>
<name>Laura Abbott</name>
<email>lauraa@codeaurora.org</email>
</author>
<published>2014-10-09T22:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9efb3a421d55d30b65fb0dbee05108d15c6c55f7'/>
<id>urn:sha1:9efb3a421d55d30b65fb0dbee05108d15c6c55f7</id>
<content type='text'>
After allocating an address from a particular genpool, there is no good
way to verify if that address actually belongs to a genpool.  Introduce
addr_in_gen_pool which will return if an address plus size falls
completely within the genpool range.

Signed-off-by: Laura Abbott &lt;lauraa@codeaurora.org&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Reviewed-by: Olof Johansson &lt;olof@lixom.net&gt;
Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: David Riley &lt;davidriley@chromium.org&gt;
Cc: Ritesh Harjain &lt;ritesh.harjani@gmail.com&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/genalloc.c: add power aligned algorithm</title>
<updated>2014-10-10T02:25:52Z</updated>
<author>
<name>Laura Abbott</name>
<email>lauraa@codeaurora.org</email>
</author>
<published>2014-10-09T22:26:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=505e3be6c082489a32a88e042f930d047b6415bc'/>
<id>urn:sha1:505e3be6c082489a32a88e042f930d047b6415bc</id>
<content type='text'>
One of the more common algorithms used for allocation is to align the
start address of the allocation to the order of size requested.  Add this
as an algorithm option for genalloc.

Signed-off-by: Laura Abbott &lt;lauraa@codeaurora.org&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Olof Johansson &lt;olof@lixom.net&gt;
Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: David Riley &lt;davidriley@chromium.org&gt;
Cc: Ritesh Harjain &lt;ritesh.harjani@gmail.com&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>genalloc: fix device node resource counter</title>
<updated>2014-09-26T15:10:35Z</updated>
<author>
<name>Vladimir Zapolskiy</name>
<email>vladimir_zapolskiy@mentor.com</email>
</author>
<published>2014-09-25T23:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6f3aabd183984120acb59f5d57a45cfa7455be9a'/>
<id>urn:sha1:6f3aabd183984120acb59f5d57a45cfa7455be9a</id>
<content type='text'>
Decrement the np_pool device_node refcount, which was incremented on
the preceding of_parse_phandle() call.

Signed-off-by: Vladimir Zapolskiy &lt;vladimir_zapolskiy@mentor.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Olof Johansson &lt;olof@lixom.net&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/genalloc.c: add check gen_pool_dma_alloc() if dma pointer is not NULL</title>
<updated>2014-01-30T00:22:39Z</updated>
<author>
<name>Lad, Prabhakar</name>
<email>prabhakar.csengg@gmail.com</email>
</author>
<published>2014-01-29T22:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0368dfd01ae3b7647ef9b2f0525fdefd5e0d28e1'/>
<id>urn:sha1:0368dfd01ae3b7647ef9b2f0525fdefd5e0d28e1</id>
<content type='text'>
In the gen_pool_dma_alloc() the dma pointer can be NULL and while
assigning gen_pool_virt_to_phys(pool, vaddr) to dma caused the following
crash on da850 evm:

   Unable to handle kernel NULL pointer dereference at virtual address 00000000
   Internal error: Oops: 805 [#1] PREEMPT ARM
   Modules linked in:
   CPU: 0 PID: 1 Comm: swapper Tainted: G        W    3.13.0-rc1-00001-g0609e45-dirty #5
   task: c4830000 ti: c4832000 task.ti: c4832000
   PC is at gen_pool_dma_alloc+0x30/0x3c
   LR is at gen_pool_virt_to_phys+0x74/0x80
   Process swapper, call trace:
     gen_pool_dma_alloc+0x30/0x3c
     davinci_pm_probe+0x40/0xa8
     platform_drv_probe+0x1c/0x4c
     driver_probe_device+0x98/0x22c
     __driver_attach+0x8c/0x90
     bus_for_each_dev+0x6c/0x8c
     bus_add_driver+0x124/0x1d4
     driver_register+0x78/0xf8
     platform_driver_probe+0x20/0xa4
     davinci_init_late+0xc/0x14
     init_machine_late+0x1c/0x28
     do_one_initcall+0x34/0x15c
     kernel_init_freeable+0xe4/0x1ac
     kernel_init+0x8/0xec

This patch fixes the above.

[akpm@linux-foundation.org: update kerneldoc]
Signed-off-by: Lad, Prabhakar &lt;prabhakar.csengg@gmail.com&gt;
Cc: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Cc: Nicolin Chen &lt;b42378@freescale.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Sachin Kamat &lt;sachin.kamat@linaro.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;	[3.13.x]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/genalloc: add a helper function for DMA buffer allocation</title>
<updated>2013-11-13T03:09:22Z</updated>
<author>
<name>Nicolin Chen</name>
<email>b42378@freescale.com</email>
</author>
<published>2013-11-12T23:09:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=684f0d3d14f2744ae7ad79063b21909e32bf444e'/>
<id>urn:sha1:684f0d3d14f2744ae7ad79063b21909e32bf444e</id>
<content type='text'>
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 &lt;b42378@freescale.com&gt;
Cc: "Hans J. Koch" &lt;hjk@hansjkoch.de&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Eric Miao &lt;eric.y.miao@gmail.com&gt;
Cc: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Haojian Zhuang &lt;haojian.zhuang@gmail.com&gt;
Cc: Jaroslav Kysela &lt;perex@perex.cz&gt;
Cc: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Mauro Carvalho Chehab &lt;m.chehab@samsung.com&gt;
Cc: Rob Herring &lt;rob.herring@calxeda.com&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Sekhar Nori &lt;nsekhar@ti.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/genalloc.c: correct dev_get_gen_pool documentation</title>
<updated>2013-09-11T22:58:38Z</updated>
<author>
<name>Emilio López</name>
<email>emilio@elopez.com.ar</email>
</author>
<published>2013-09-11T21:23:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5ab58acc40ead5521cbafcd1cc7f35170ccceeee'/>
<id>urn:sha1:5ab58acc40ead5521cbafcd1cc7f35170ccceeee</id>
<content type='text'>
The documentation mentions a "name" parameter, which does not exist.  This
commit removes such mention from the function documentation.

Signed-off-by: Emilio López &lt;emilio@elopez.com.ar&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/genalloc.c: convert kmalloc_node(...GFP_ZERO...) to kzalloc_node(...)</title>
<updated>2013-09-11T22:58:13Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2013-09-11T21:23:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ade34a35722fab0c8a1d162a15b919d20373a894'/>
<id>urn:sha1:ade34a35722fab0c8a1d162a15b919d20373a894</id>
<content type='text'>
Use the helper function instead of __GFP_ZERO.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/genalloc.c: fix overflow of ending address of memory chunk</title>
<updated>2013-09-11T22:57:35Z</updated>
<author>
<name>Joonyoung Shim</name>
<email>jy0922.shim@samsung.com</email>
</author>
<published>2013-09-11T21:21:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=674470d97958a0ec72f72caf7f6451da40159cc7'/>
<id>urn:sha1:674470d97958a0ec72f72caf7f6451da40159cc7</id>
<content type='text'>
In struct gen_pool_chunk, end_addr means the end address of memory chunk
(inclusive), but in the implementation it is treated as address + size of
memory chunk (exclusive), so it points to the address plus one instead of
correct ending address.

The ending address of memory chunk plus one will cause overflow on the
memory chunk including the last address of memory map, e.g.  when starting
address is 0xFFF00000 and size is 0x100000 on 32bit machine, ending
address will be 0x100000000.

Use correct ending address like starting address + size - 1.

[akpm@linux-foundation.org: add comment to struct gen_pool_chunk:end_addr]
Signed-off-by: Joonyoung Shim &lt;jy0922.shim@samsung.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>genalloc: add devres support, allow to find a managed pool by device</title>
<updated>2013-04-30T01:28:13Z</updated>
<author>
<name>Philipp Zabel</name>
<email>p.zabel@pengutronix.de</email>
</author>
<published>2013-04-29T23:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9375db07adeaeea5f5ea7ca0463a8b371d71ddbb'/>
<id>urn:sha1:9375db07adeaeea5f5ea7ca0463a8b371d71ddbb</id>
<content type='text'>
This patch adds three exported functions to lib/genalloc.c:
devm_gen_pool_create, dev_get_gen_pool, and of_get_named_gen_pool.

devm_gen_pool_create is a managed version of gen_pool_create that keeps
track of the pool via devres and allows the management code to
automatically destroy it after device removal.

dev_get_gen_pool retrieves the gen_pool for a given device, if it was
created with devm_gen_pool_create, using devres_find.

of_get_named_gen_pool retrieves the gen_pool for a given device node and
property name, where the property must contain a phandle pointing to a
platform device node.  The corresponding platform device is then fed into
dev_get_gen_pool and the resulting gen_pool is returned.

[akpm@linux-foundation.org: make the of_get_named_gen_pool() stub static, fixing a zillion link errors]
[akpm@linux-foundation.org: squish "struct device declared inside parameter list" warning]
Signed-off-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Acked-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Tested-by: Michal Simek &lt;monstr@monstr.eu&gt;
Cc: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Cc: Matt Porter &lt;mporter@ti.com&gt;
Cc: Dong Aisheng &lt;dong.aisheng@linaro.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Rob Herring &lt;rob.herring@calxeda.com&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Javier Martin &lt;javier.martin@vista-silicon.com&gt;
Cc: Huang Shijie &lt;shijie8@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
