Skip to contentSkip to conversation

New style dpalloc/hostalloc routines (diff).

PATCH Pantelis Antoniou 4 participants 9 messages Dec 18, 2002 – Jan 20, 2003

lore
Share & tools
lore
#0 lore raw

Sorry forgot to attach the patch.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1190 -> 1.1191
# arch/ppc/8xx_io/Makefile 1.8 -> 1.9
# arch/ppc/8xx_io/commproc.c 1.19 -> 1.20
# arch/ppc/kernel/ppc_ksyms.c 1.106 -> 1.107
# include/asm-ppc/commproc.h 1.4 -> 1.5
# arch/ppc/8xx_io/Config.in 1.10 -> 1.11

#	               (new)	        -> 1.1     arch/ppc/8xx_io/rheap.c
#	               (new)	        -> 1.1     arch/ppc/8xx_io/rheap.h

#
# The following is the BitKeeper ChangeSet Log # --------------------------------------------
# 02/12/18 [email protected] 1.1191
# Add support for new style dpalloc/hostalloc routines

# which properly manage memory, and permit their use in modules.
# --------------------------------------------
#
diff -Nru a/arch/ppc/8xx_io/Config.in b/arch/ppc/8xx_io/Config.in
--- a/arch/ppc/8xx_io/Config.in	Wed Dec 18 14:27:45 2002
+++ b/arch/ppc/8xx_io/Config.in	Wed Dec 18 14:27:45 2002
@@ -36,5 +36,11 @@
 bool 'Copy-Back Data Cache (else Writethrough)' CONFIG_8xx_COPYBACK
 bool 'CPU6 Silicon Errata (860 Pre Rev. C)' CONFIG_8xx_CPU6
 bool 'I2C/SPI Microcode Patch' CONFIG_UCODE_PATCH
+# Support new type of routines, usable from modules
+bool 'Use new type dpalloc routines()' CONFIG_NEW_DPALLOC
+bool 'Use new type hostalloc routines()' CONFIG_NEW_HOSTALLOC
+if [ "$CONFIG_NEW_DPALLOC" = "y" -o "$CONFIG_NEW_HOSTALLOC" = "y" ]; then
+  define_bool CONFIG_CPM_RHEAP y
+fi

endmenu

arch/ppc/8xx_io/Makefile +1 -0
diff -Nru a/arch/ppc/8xx_io/Makefile b/arch/ppc/8xx_io/Makefile
@@ -17,5 +17,6 @@
 obj-$(CONFIG_SCC_ENET)	+= enet.o
 obj-$(CONFIG_UCODE_PATCH) += micropatch.o
 obj-$(CONFIG_HTDMSOUND) += cs4218_tdm.o
+obj-$(CONFIG_CPM_RHEAP)		+= rheap.o
 
 include $(TOPDIR)/Rules.make
arch/ppc/8xx_io/commproc.c +392 -2

482 lines not on this page · raw message

arch/ppc/8xx_io/rheap.c new file +657 -0

657 lines not on this page · raw message

arch/ppc/8xx_io/rheap.h new file +89 -0

89 lines not on this page · raw message

arch/ppc/kernel/ppc_ksyms.c +11 -0
diff -Nru a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
@@ -357,6 +357,17 @@
 EXPORT_SYMBOL(__res);
 EXPORT_SYMBOL(cpm_install_handler);
 EXPORT_SYMBOL(cpm_free_handler);
+#ifdef CONFIG_NEW_DPALLOC
+EXPORT_SYMBOL(new_m8xx_cpm_dpalloc);
+EXPORT_SYMBOL(new_m8xx_cpm_dpfree);
+EXPORT_SYMBOL(new_m8xx_cpm_dpalloc_fixed);
+EXPORT_SYMBOL(new_m8xx_cpm_dpdump);
+#endif
+#ifdef CONFIG_NEW_HOSTALLOC
+EXPORT_SYMBOL(new_m8xx_cpm_hostalloc);
+EXPORT_SYMBOL(new_m8xx_cpm_hostfree);
+EXPORT_SYMBOL(new_m8xx_cpm_hostdump);
+#endif
 #endif /* CONFIG_8xx */
 #if defined(CONFIG_8xx) || defined(CONFIG_8260)
 EXPORT_SYMBOL(request_8xxirq);
include/asm-ppc/commproc.h +13 -0
diff -Nru a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
@@ -797,4 +797,17 @@
 		void (*handler)(void *, struct pt_regs *regs), void *dev_id);
 extern void cpm_free_handler(int vec);
 
+#ifdef CONFIG_NEW_DPALLOC
+extern void *new_m8xx_cpm_dpalloc(unsigned int size, const char *owner);
+extern int   new_m8xx_cpm_dpfree(void *start);
+extern void *new_m8xx_cpm_dpalloc_fixed(void *start, int size, const char *owner);
+extern void  new_m8xx_cpm_dpdump(void);
+#endif
+
+#ifdef CONFIG_NEW_HOSTALLOC
+extern void *new_m8xx_cpm_hostalloc(unsigned int size, const char *owner);
+extern int   new_m8xx_cpm_hostfree(void *start);
+extern void  new_m8xx_cpm_hostdump(void);
+#endif
+
 #endif /* __CPM_8XX__ */
#1 lore raw

Review

Quoted 6 lines · Pantelis Antoniou
(quoted diff) +6 -0
+# Support new type of routines, usable from modules
+bool 'Use new type dpalloc routines()' CONFIG_NEW_DPALLOC
+bool 'Use new type hostalloc routines()' CONFIG_NEW_HOSTALLOC
+if [ "$CONFIG_NEW_DPALLOC" = "y" -o "$CONFIG_NEW_HOSTALLOC" = "y" ]; then
+  define_bool CONFIG_CPM_RHEAP y
+fi

I don't want to see config options that select between different internal implementations of the same thing. Either your new routines are better, and we'll use them, or they are worse, and we'll use the old ones. Having a config option just leads to tons of ifdefs throughout the code, which makes it harder to read and understand. Having two implementations of the same thing is just bloat.

Similarly, I don't like the way all your new routines have a "new_" prefix on the name. You should be thinking of replacing the existing routines rather than providing an alternative implementation with a different name. Where you have changed the API, either fix the drivers or provide a compatibility routine.

The way it looks at the moment, it seems that you don't really have the conviction that your code is better than what is there already. Please redo your patch so that it just replaces the old routines. And please don't send it as a bkpatch since they are impossible to read, a plain diff -u is much better.

Paul.

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

#2 lore raw
Quoted 24 lines · Paul Mackerras

Review

Quoted 7 lines · Pantelis Antoniou
(quoted diff) +6 -0
+# Support new type of routines, usable from modules
+bool 'Use new type dpalloc routines()' CONFIG_NEW_DPALLOC
+bool 'Use new type hostalloc routines()' CONFIG_NEW_HOSTALLOC
+if [ "$CONFIG_NEW_DPALLOC" = "y" -o "$CONFIG_NEW_HOSTALLOC" = "y" ]; then
+  define_bool CONFIG_CPM_RHEAP y
+fi

I don't want to see config options that select between different internal implementations of the same thing. Either your new routines are better, and we'll use them, or they are worse, and we'll use the old ones. Having a config option just leads to tons of ifdefs throughout the code, which makes it harder to read and understand. Having two implementations of the same thing is just bloat.

Similarly, I don't like the way all your new routines have a "new_" prefix on the name. You should be thinking of replacing the existing routines rather than providing an alternative implementation with a different name. Where you have changed the API, either fix the drivers or provide a compatibility routine.

Quoted 12 lines

The way it looks at the moment, it seems that you don't really have the conviction that your code is better than what is there already. Please redo your patch so that it just replaces the old routines. And please don't send it as a bkpatch since they are impossible to read, a plain diff -u is much better.

Paul.

Well that's easy to do since that's the way it is in my tree.

The only reason for the new_ prefixes and the config options was to make it easy for people to test them.

I didn't sent it only as a bkpatch, a following mail had the patch in diff format.

Anyway I'll repost them as per you suggestions...

Pantelis

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

#3 lore raw
In reply to Paul Mackerras
Quoted 26 lines · Paul Mackerras

Review

Quoted 8 lines · Pantelis Antoniou
(quoted diff) +6 -0
+# Support new type of routines, usable from modules
+bool 'Use new type dpalloc routines()' CONFIG_NEW_DPALLOC
+bool 'Use new type hostalloc routines()' CONFIG_NEW_HOSTALLOC
+if [ "$CONFIG_NEW_DPALLOC" = "y" -o "$CONFIG_NEW_HOSTALLOC" = "y" ]; then
+  define_bool CONFIG_CPM_RHEAP y
+fi

I don't want to see config options that select between different internal implementations of the same thing. Either your new routines are better, and we'll use them, or they are worse, and we'll use the old ones. Having a config option just leads to tons of ifdefs throughout the code, which makes it harder to read and understand. Having two implementations of the same thing is just bloat.

Similarly, I don't like the way all your new routines have a "new_" prefix on the name. You should be thinking of replacing the existing routines rather than providing an alternative implementation with a different name. Where you have changed the API, either fix the drivers or provide a compatibility routine.

Quoted 13 lines

The way it looks at the moment, it seems that you don't really have the conviction that your code is better than what is there already. Please redo your patch so that it just replaces the old routines. And please don't send it as a bkpatch since they are impossible to read, a plain diff -u is much better.

Paul.

OK

Here is the updated patch in diff format as per your suggestions.

Any more suggestions?

Pantelis

#4 lore raw
Quoted 1 line · Pantelis Antoniou

Here is the updated patch in diff format as per your suggestions.

Looks good. My only real issue is that this is a big change, so I would rather see either (or both) of the following happen:
Make a patch vs 2.5. This will require additional 8xx work to get things going again.
Please hold on this until all of the otherwise stable 8xx work can get out of the linuxppc_2_4_devel tree and into linuxppc_2_4 / Marcelo.

Also, Dan Malek, any comments on all of this?

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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

#5 lore raw
Quoted 1 line · Tom Rini

Also, Dan Malek, any comments on all of this?

I've had some life distractions for the past couple of weeks. I'll have some time to look at this over the next few days.

When are we going to stop using 2.4 as our development tree? Things like this should first be developed and proven in the 2.5 tree then moved into 2.4 after we agree it's necessary.

Thanks.

	-- Dan

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

#6 lore raw
Quoted 6 lines · Dan Malek
Quoted 1 line · Tom Rini

Also, Dan Malek, any comments on all of this?

I've had some life distractions for the past couple of weeks. I'll have some time to look at this over the next few days.

So, have you had time to look at all of this yet?

Quoted 3 lines

When are we going to stop using 2.4 as our development tree? Things like this should first be developed and proven in the 2.5 tree then moved into 2.4 after we agree it's necessary.

Mainly because no one with the indepth knowledge of 8xx (*hint*hint* :)) has gone and fixed the very low level issues on 8xx which need to be fixed, such as some MM thing or another from 2.5.5/2.5.10 timeframe and the exception handling stuff ne3ds a look at, at a minimum based on what Paul has done for 'classic' and what Paul and/or David and others have done for 40x. At which point the more trivial things like fixing up drivers can happen. :)

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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

#7 lore raw
In reply to Tom Rini
Quoted 4 lines · Tom Rini
Quoted 1 line · Pantelis Antoniou

Here is the updated patch in diff format as per your suggestions.

Quoted 8 lines

Looks good. My only real issue is that this is a big change, so I would rather see either (or both) of the following happen:
Make a patch vs 2.5. This will require additional 8xx work to get things going again.
Please hold on this until all of the otherwise stable 8xx work can get out of the linuxppc_2_4_devel tree and into linuxppc_2_4 / Marcelo.

Also, Dan Malek, any comments on all of this?

Well, I'll try but I haven't messed with 2.5 yet. Does it even work at all for 8xx?
Has anybody in the list worked with it?

I would very much like the two trees getting merged finally, as I'm forced to maintaining my own tree, forked off Marcelo.

Regards, and Merry Christmas to all

Pantelis

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

#8 lore raw
Quoted 15 lines · Pantelis Antoniou
Quoted 13 lines · Tom Rini
Quoted 2 lines · Pantelis Antoniou

Here is the updated patch in diff format as per your suggestions.

Looks good. My only real issue is that this is a big change, so I would rather see either (or both) of the following happen:
Make a patch vs 2.5. This will require additional 8xx work to get things going again.
Please hold on this until all of the otherwise stable 8xx work can get out of the linuxppc_2_4_devel tree and into linuxppc_2_4 / Marcelo.

Quoted 4 lines
Quoted 2 lines

Also, Dan Malek, any comments on all of this?

Well, I'll try but I haven't messed with 2.5 yet.
Does it even work at all for 8xx?

No, it does not. As I said above, it needs a few fixups here and there.

Quoted 1 line

Has anybody in the list worked with it?

On all of the other types of boards, yes.

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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