linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Problem allocating large meory using m8260_cpm_hostalloc
@ 2005-07-28 16:50 Prashant Alange
  2005-07-28 18:06 ` Dan Malek
  0 siblings, 1 reply; 6+ messages in thread
From: Prashant Alange @ 2005-07-28 16:50 UTC (permalink / raw)
  To: Linuxppc-embedded

Hi everyone,
I am having problem in allocating large memory using=20
m8260_cpm_hostalloc function in my driver. (Approx 256 Kbytes). I
tried increaing the NUM_CPM_HOST_PAGES macro in cpm_8260.h file to 64
but still it fails for 200K of memory request. This macro is used by
alloc_bootmem_pages() function. I have read that we should use this
function if we intend to have consecutive memory pages allocated.

Could anyone tell what I am missing here?
How can I allocate large memory in my driver using this hostalloc function?

Thanks for your time.

Prashant

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

* RE: Problem allocating large meory using m8260_cpm_hostalloc
@ 2005-07-28 17:29 Goodman, Brad
  2005-07-28 17:55 ` Prashant Alange
  0 siblings, 1 reply; 6+ messages in thread
From: Goodman, Brad @ 2005-07-28 17:29 UTC (permalink / raw)
  To: Prashant Alange, Linuxppc-embedded

I think you have to increase MAX_ORDER in linux/mmzone.h

This number means you can allocate a maximum of 2^(MAX_ORDER-1)
contiguous pages.

Brad Goodman


-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Prashant
Alange
Sent: Thursday, July 28, 2005 12:50 PM
To: Linuxppc-embedded@ozlabs.org
Subject: Problem allocating large meory using m8260_cpm_hostalloc

Hi everyone,
I am having problem in allocating large memory using=20
m8260_cpm_hostalloc function in my driver. (Approx 256 Kbytes). I
tried increaing the NUM_CPM_HOST_PAGES macro in cpm_8260.h file to 64
but still it fails for 200K of memory request. This macro is used by
alloc_bootmem_pages() function. I have read that we should use this
function if we intend to have consecutive memory pages allocated.

Could anyone tell what I am missing here?
How can I allocate large memory in my driver using this hostalloc
function?

Thanks for your time.

Prashant
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

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

* Re: Problem allocating large meory using m8260_cpm_hostalloc
  2005-07-28 17:29 Problem allocating large meory using m8260_cpm_hostalloc Goodman, Brad
@ 2005-07-28 17:55 ` Prashant Alange
  0 siblings, 0 replies; 6+ messages in thread
From: Prashant Alange @ 2005-07-28 17:55 UTC (permalink / raw)
  To: Goodman, Brad; +Cc: Linuxppc-embedded

Thanks I saw linux/mmzone.h file. MAX_ORDER depends on the
CONFIG_FORCE_MAX_ZONEORDER macro. But I do not see any option in
menuconfig to change this value. I am using 2.4.22 kernel on MPC8260
kernel. Can you pls tell me how to chaneg this?

Thanks,
Prashant
I do not see any option in menuconfig to change this value.

On 7/28/05, Goodman, Brad <bgoodman@empirix.com> wrote:
> I think you have to increase MAX_ORDER in linux/mmzone.h
>=20
> This number means you can allocate a maximum of 2^(MAX_ORDER-1)
> contiguous pages.
>=20
> Brad Goodman
>=20
>=20
> -----Original Message-----
> From: linuxppc-embedded-bounces@ozlabs.org
> [mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Prashant
> Alange
> Sent: Thursday, July 28, 2005 12:50 PM
> To: Linuxppc-embedded@ozlabs.org
> Subject: Problem allocating large meory using m8260_cpm_hostalloc
>=20
> Hi everyone,
> I am having problem in allocating large memory using
> m8260_cpm_hostalloc function in my driver. (Approx 256 Kbytes). I
> tried increaing the NUM_CPM_HOST_PAGES macro in cpm_8260.h file to 64
> but still it fails for 200K of memory request. This macro is used by
> alloc_bootmem_pages() function. I have read that we should use this
> function if we intend to have consecutive memory pages allocated.
>=20
> Could anyone tell what I am missing here?
> How can I allocate large memory in my driver using this hostalloc
> function?
>=20
> Thanks for your time.
>=20
> Prashant
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

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

* Re: Problem allocating large meory using m8260_cpm_hostalloc
  2005-07-28 16:50 Prashant Alange
@ 2005-07-28 18:06 ` Dan Malek
  2005-07-28 18:29   ` Prashant Alange
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Malek @ 2005-07-28 18:06 UTC (permalink / raw)
  To: Prashant Alange; +Cc: Linuxppc-embedded


On Jul 28, 2005, at 12:50 PM, Prashant Alange wrote:

> Could anyone tell what I am missing here?

You are not supposed to be using this function for such memory
allocations.

> How can I allocate large memory in my driver using this hostalloc 
> function?

You don't.  If you look at the existing drivers and comments, you'll 
see it's
intended to only allocate small objects that are too inefficient to 
manage
with the usual Linux DMA allocation functions.  You must use the 
standard
Linux DMA for large allocations.  Read Documentation/DMA-API.txt, and
in particular the non-PCI functions.

Thanks.


	-- Dan

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

* Re: Problem allocating large meory using m8260_cpm_hostalloc
  2005-07-28 18:06 ` Dan Malek
@ 2005-07-28 18:29   ` Prashant Alange
  2005-07-28 19:03     ` Dan Malek
  0 siblings, 1 reply; 6+ messages in thread
From: Prashant Alange @ 2005-07-28 18:29 UTC (permalink / raw)
  To: Dan Malek; +Cc: Linuxppc-embedded

Could you pls tell me what function I should be using for larger
memories. I do not know much about the memory management in linux.  It
would be heleful if you can throw some light on this in terms of
functions I should use. I could not find the file DMA-API.txt file but
I did get DMA-mapping.txt. Is this the file you were referring to?

Thanks,
Prashant


On 7/28/05, Dan Malek <dan@embeddededge.com> wrote:
>=20
> On Jul 28, 2005, at 12:50 PM, Prashant Alange wrote:
>=20
> > Could anyone tell what I am missing here?
>=20
> You are not supposed to be using this function for such memory
> allocations.
>=20
> > How can I allocate large memory in my driver using this hostalloc
> > function?
>=20
> You don't.  If you look at the existing drivers and comments, you'll
> see it's
> intended to only allocate small objects that are too inefficient to
> manage
> with the usual Linux DMA allocation functions.  You must use the
> standard
> Linux DMA for large allocations.  Read Documentation/DMA-API.txt, and
> in particular the non-PCI functions.
>=20
> Thanks.
>=20
>=20
>        -- Dan
>=20
>

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

* Re: Problem allocating large meory using m8260_cpm_hostalloc
  2005-07-28 18:29   ` Prashant Alange
@ 2005-07-28 19:03     ` Dan Malek
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Malek @ 2005-07-28 19:03 UTC (permalink / raw)
  To: Prashant Alange; +Cc: Linuxppc-embedded


On Jul 28, 2005, at 2:29 PM, Prashant Alange wrote:

> Could you pls tell me what function I should be using ....

Just look at some of the existing 82xx/CPM2 drivers, like
the SCC/FEC/FCC Ethernet.

> ..... I could not find the file DMA-API.txt file but
> I did get DMA-mapping.txt. Is this the file you were referring to?

Ugh ...  a newer kernel would help.  The DMA-mapping.txt doesn't
apply to the local CPM devices, so just look at some existing drivers.

Thanks.


	-- Dan

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

end of thread, other threads:[~2005-07-28 19:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-28 17:29 Problem allocating large meory using m8260_cpm_hostalloc Goodman, Brad
2005-07-28 17:55 ` Prashant Alange
  -- strict thread matches above, loose matches on Subject: below --
2005-07-28 16:50 Prashant Alange
2005-07-28 18:06 ` Dan Malek
2005-07-28 18:29   ` Prashant Alange
2005-07-28 19:03     ` Dan Malek

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).