linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Why not kmalloc() ??
@ 2004-07-16  9:25 Rupesh S
  2004-07-16 10:25 ` kernel 2.4.26 doesn't seem to work with a MPC859T Pedro Aguilar
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Rupesh S @ 2004-07-16  9:25 UTC (permalink / raw)
  To: linuxppc-embedded


Hi,

I just figured out that I need to use m8xx_cpm_hostalloc() to allocate memory for "buffer" that needs to be attached to the "Buffer Descriptor" of an  MPC8xx CPM peripheral (like IIC, SPI, SCC etc). Instead, if I try to use kmalloc() or a static memory allocation, my driver isn't working.

1) Can somebody throw some light on what exactly is the difference between m8xx_cpm_hostalloc() and kmalloc().
2) Why is the difference important in ppc linux ?




Thanks
--
Rupesh S


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Why not kmalloc() ??
@ 2004-07-17  4:51 Rupesh S
  0 siblings, 0 replies; 12+ messages in thread
From: Rupesh S @ 2004-07-17  4:51 UTC (permalink / raw)
  To: linuxppc-embedded


Here I put my understanding.

The hostalloc() function allocates space from "hostalloc space" which  is basically a small pre-allocated non-caches space that has been initialized before "kernel memory allocator" is initialized. This "hostalloc space" is "Cache coherent" and not available for the "kernel memory allocator". But, "hostalloc space" cannot provide large memory buffers.

dma_alloc_consistent() function can be used allocating large memory buffers which is non-cached.

How is dma_alloc_consistent() different from kmalloc() ? - Is it that dma_alloc_consistent() allocates memory which is non-cached and kmaloc() allocates cached memory?



Thanks
--
Rupesh S


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-07-17  4:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-16  9:25 Why not kmalloc() ?? Rupesh S
2004-07-16 10:25 ` kernel 2.4.26 doesn't seem to work with a MPC859T Pedro Aguilar
2004-07-16 11:34 ` Why not kmalloc() ?? Magnus Damm
2004-07-16 12:06   ` sanjeev ramachandran
2004-07-16 13:32     ` Dan Malek
2004-07-16 14:06       ` Mark Chambers
2004-07-16 15:42         ` Rune Torgersen
2004-07-16 19:03           ` Dan Malek
2004-07-16 19:02         ` Dan Malek
2004-07-16 13:29   ` Dan Malek
2004-07-16 11:46 ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2004-07-17  4:51 Rupesh S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).