linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE: 8260 CPM DP ram free function
@ 2004-05-21 20:16 Rune Torgersen
  2004-05-21 20:26 ` Tom Rini
  0 siblings, 1 reply; 16+ messages in thread
From: Rune Torgersen @ 2004-05-21 20:16 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

> Er?  Aren't dpfree/hostfree new functions?  I didn't see them 
> added as exports in your patch, and regardless they belong in 
> comproc.c now.

Try this then

The problem is that on 2.6.x I have never gotten EXPORT() in commproc.c
(or anywhere else) to work, I have had to put them on ppc_ksyms.c to be
able to load my modules

I do not know if there is some magic thatI have forgotten to do.




[-- Attachment #2: cpm_dpfree.patch.gz --]
[-- Type: application/x-gzip, Size: 3509 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 8260 CPM DP ram free function
@ 2004-05-25 16:04 Rune Torgersen
  0 siblings, 0 replies; 16+ messages in thread
From: Rune Torgersen @ 2004-05-25 16:04 UTC (permalink / raw)
  To: Tom Rini, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

Ok, here is the revised version of the dpalloc/free patch

Rune Torgersen
System Developer
Innovative Systems LLC
1000 Innovative Drive
Mitchell, SD 57301
www.innovsys.com

[-- Attachment #2: cpm_alloc_free.patch.gz --]
[-- Type: application/x-gzip, Size: 3854 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 8260 CPM DP ram free function
@ 2004-05-24 16:03 Rune Torgersen
       [not found] ` <20040524161520.GQ6763@smtp.west.cox.net>
  0 siblings, 1 reply; 16+ messages in thread
From: Rune Torgersen @ 2004-05-24 16:03 UTC (permalink / raw)
  To: Tom Rini, Wolfgang Denk; +Cc: linuxppc-embedded


> I suppose once Dan's comments are addressed, since I thought
> he's been the biggest objector to all of the previous
> implementations (or, my memory is faulty, and every one of
> them just fell on the ground), we can push this out, at least
> for cpm2 stuff.

I have fixed the #ifdefs Dan complained about, but I cannot really do
much about changing hostalloc to kfree for the stuff in the kernel,
since hostalloc gets called a few times before kalloc is initialized.

What else should I do before resubmitting?

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

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 8260 CPM DP ram free function
@ 2004-05-21 21:52 Rune Torgersen
  0 siblings, 0 replies; 16+ messages in thread
From: Rune Torgersen @ 2004-05-21 21:52 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-embedded


> Will you please get rid of those #ifdefs?  If the code works,
> just use it, if not, don't ask for a patch to be applied.
> There is no reason for this.

Ok

> The "host" functions should simply be removed and drivers
> should use kmalloc()/kfree(), manage their own alignment
> restrictions, since the 82xx is cache coherent.

Not sure how easy that would be. The host_alloc and dp_alloc gets called
at few times _before_ kmem_cache_init() is called, so a kmalloc call
panic()s the kernel.
I know, because I tried to use kmalloc for handling the linked lists for
the dp_alloc/free functions.

It would make allocating buffers in drivers easier.

> Let's clean this up and do it right if we are going to do it at all.
Cleaning up is always good.

Any more suggestions before I remove the #ifdefs and resubmit?

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

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 8260 CPM DP ram free function
@ 2004-05-21 21:41 Rune Torgersen
  0 siblings, 0 replies; 16+ messages in thread
From: Rune Torgersen @ 2004-05-21 21:41 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-embedded


> Did you run 'make clean' before trying?  Perhaps there's
> still a bug when you add exports to a file that previously
> didn't have any..

Tried that, it did not work. I get Unknown symbol errors when loading
the module.

BTW there is a an error in the patch file I sendt... No Idea how that
snuck in there before I did the diff..., line 103 of commproc.c has one
too many closing parens

-	init_rt_alloc(&dp_heap, (void*)dp_alloc_base, CPM_DATAONLY_SIZE
));
+	init_rt_alloc(&dp_heap, (void*)dp_alloc_base, CPM_DATAONLY_SIZE
);

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

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 8260 CPM DP ram free function
@ 2004-05-21 19:34 Rune Torgersen
  2004-05-21 19:50 ` Tom Rini
  0 siblings, 1 reply; 16+ messages in thread
From: Rune Torgersen @ 2004-05-21 19:34 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-embedded


> First, when this has come up in the past, the first question
> is why is this useful, given that with the hardware and
> peripherals in question, loadable drivers aren't really
> useful (and don't shoot the messenger please).

Right now I mainly use it to debug a driver, which would run out of host
ram when I reloaded it

> Second, you removed the EXPORT_SYMBOL for the old alloc, but
> I didn't see quickly how a module would make use of the new
> infrastructure since there weren't any new EXPORT_SYMBOLs.

This is because I did my patch against 2.6.5, and all the EXPORT sympols
are in arch/ppc/kernel/ppc_ksyms.c
and not in commprocs.c

In ppc_ksyms.c I have:
extern uint m8260_cpm_dpalloc(uint size, uint align);
extern uint m8260_cpm_hostalloc(uint size, uint align);
extern uint m8260_cpm_hostfree(uint ptr);
extern uint m8260_cpm_dpfree(uint ptr);

EXPORT_SYMBOL(m8260_cpm_dpalloc);
EXPORT_SYMBOL(m8260_cpm_hostalloc);
EXPORT_SYMBOL(m8260_cpm_dpfree);
EXPORT_SYMBOL(m8260_cpm_hostfree);


>
> --
> Tom Rini
> http://gate.crashing.org/~trini/
>

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

^ permalink raw reply	[flat|nested] 16+ messages in thread
* 8260 CPM DP ram free function
@ 2004-05-21 17:35 Rune Torgersen
  2004-05-21 19:23 ` Tom Rini
  2004-05-21 21:44 ` Dan Malek
  0 siblings, 2 replies; 16+ messages in thread
From: Rune Torgersen @ 2004-05-21 17:35 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]

Hi

I hope someone on this list can push the following patch to one of the
ppc trees.

It adds functionality to the 8260 CPM to free() allocated host and dp
ram memory. (nice for loadable drivers that use DP ram)

The functions that are added are m8260_cpm_dpfree() and
m8260_cpm_hostfree()

This patch is agains 2.6.5, but it should apply cleanly agains any 2.4.x
and 2.6.x, since it only touches arch/ppc/8260_io/commproc.c and
include/asm-ppc/cpm_8260.h

This could possibly also be used on the 8xx CPUs, since the code is
identical.

[-- Attachment #2: cpm_dpfree.patch.gz --]
[-- Type: application/x-gzip, Size: 3496 bytes --]

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

end of thread, other threads:[~2004-05-25 16:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-21 20:16 8260 CPM DP ram free function Rune Torgersen
2004-05-21 20:26 ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2004-05-25 16:04 Rune Torgersen
2004-05-24 16:03 Rune Torgersen
     [not found] ` <20040524161520.GQ6763@smtp.west.cox.net>
2004-05-25 11:00   ` Dan Malek
2004-05-21 21:52 Rune Torgersen
2004-05-21 21:41 Rune Torgersen
2004-05-21 19:34 Rune Torgersen
2004-05-21 19:50 ` Tom Rini
2004-05-21 17:35 Rune Torgersen
2004-05-21 19:23 ` Tom Rini
2004-05-24 13:50   ` Wolfgang Denk
2004-05-24 14:06     ` Pantelis Antoniou
2004-05-24 14:28       ` Wolfgang Denk
2004-05-24 15:24     ` Tom Rini
2004-05-21 21:44 ` 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).