Skip to contentSkip to conversation

Patches for all four au1000 setup.c files

PATCH Hartvig Ekner 4 participants 7 messages Mar 21, 2003 – Mar 25, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

the patches below for all four au1000 setup.c files removes the wbflush() routine, as this is no longer necessary (handled by the generic code now, which does a sync). This also means that it is not necessary to say yes to CONFIG_CPU_ADVANCED and override the CPU_HAS_WB setting, as the generic MIPS32 code will do just fine.

The patch for the db1x00 setup.c file also fixes a bug which prevented VRA from being used with Audio Codecs which support it.

/Hartvig

Index: db1x00/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/setup.c,v retrieving revision 1.1.2.3

setup.c +3 -10
diff -u -r1.1.2.3 setup.c
@@ -61,7 +61,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -76,11 +75,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1x00_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -109,14 +103,13 @@
     }
 #endif
 
-#if defined(CONFIG_SOUND_AU1000) && !defined(CONFIG_CPU_AU1000)
+#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_CPU_AU1000)
 	// au1000 does not support vra, au1500 and au1100 do
-    strcat(argptr, " au1000_audio=vra");
-    argptr = prom_getcmdline();
+	strcat(argptr, " au1000_audio=vra");
+	argptr = prom_getcmdline();
 #endif
 
 	rtc_ops = &no_rtc_ops;
-	__wbflush = au1x00_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1000/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1000/setup.c,v retrieving revision 1.8.2.8

setup.c +0 -7
diff -u -r1.8.2.8 setup.c
@@ -67,7 +67,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -78,11 +77,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1000_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -103,7 +97,6 @@
 #endif
 
 	rtc_ops = &no_rtc_ops;
-        __wbflush = au1000_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1100/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1100/setup.c,v retrieving revision 1.1.2.6

setup.c +0 -7
diff -u -r1.1.2.6 setup.c
@@ -71,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -82,11 +81,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1100_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -112,7 +106,6 @@
 	argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1100_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1500/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1500/setup.c,v retrieving revision 1.1.2.10

setup.c +0 -8
diff -u -r1.1.2.10 setup.c
@@ -43,7 +43,6 @@
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
 #include <asm/pgtable.h>
-#include <asm/wbflush.h>
 #include <asm/au1000.h>
 #include <asm/pb1500.h>
 
@@ -72,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -87,11 +85,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1500_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -117,7 +110,6 @@
 	argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1500_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;
#1 lore raw

Thanks, I'll take care of them.

Pete

Quoted 173 lines · Hartvig Ekner

Hi,

the patches below for all four au1000 setup.c files removes the wbflush() routine, as this is no longer necessary (handled by the generic code now, which does a sync). This also means that it is not necessary to say yes to CONFIG_CPU_ADVANCED and override the CPU_HAS_WB setting, as the generic MIPS32 code will do just fine.

The patch for the db1x00 setup.c file also fixes a bug which prevented VRA from being used with Audio Codecs which support it.

/Hartvig

______________________________________________________________________

Index: db1x00/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/setup.c,v retrieving revision 1.1.2.3
diff -u -r1.1.2.3 setup.c

setup.c +3 -10
@@ -61,7 +61,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -76,11 +75,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1x00_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -109,14 +103,13 @@
     }
 #endif
 
-#if defined(CONFIG_SOUND_AU1000) && !defined(CONFIG_CPU_AU1000)
+#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_CPU_AU1000)
 	// au1000 does not support vra, au1500 and au1100 do
-    strcat(argptr, " au1000_audio=vra");
-    argptr = prom_getcmdline();
+	strcat(argptr, " au1000_audio=vra");
+	argptr = prom_getcmdline();
 #endif
 
 	rtc_ops = &no_rtc_ops;
-	__wbflush = au1x00_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1000/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1000/setup.c,v retrieving revision 1.8.2.8
diff -u -r1.8.2.8 setup.c

setup.c +0 -7
@@ -67,7 +67,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -78,11 +77,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1000_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -103,7 +97,6 @@
 #endif
 
 	rtc_ops = &no_rtc_ops;
-        __wbflush = au1000_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1100/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1100/setup.c,v retrieving revision 1.1.2.6
diff -u -r1.1.2.6 setup.c

setup.c +0 -7
@@ -71,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -82,11 +81,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1100_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -112,7 +106,6 @@
 	argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1100_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1500/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1500/setup.c,v retrieving revision 1.1.2.10
diff -u -r1.1.2.10 setup.c

setup.c +0 -8
@@ -43,7 +43,6 @@
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
 #include <asm/pgtable.h>
-#include <asm/wbflush.h>
 #include <asm/au1000.h>
 #include <asm/pb1500.h>
 
@@ -72,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -87,11 +85,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1500_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -117,7 +110,6 @@
 	argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1500_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;
#2 lore raw
In reply to Hartvig Ekner

On the subject of __wbflush():

It seems to me that setup.c should be exporting __wbflush, since there are some modules that require this symbol. Try compiling the 8139 ethernet module, or HostAP wireless drivers :)

Are the following patches correct?
Thanks!

-Jeff

Index: Makefile
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/Makefile,v retrieving revision 1.1.2.2

Makefile 21 Mar 2003 19:34:11 -0000 renamed from Makefile 5 Mar 2003 08:18:58 -0000 1.1.2.2 +2 -0
diff -u -r1.1.2.2 Makefile
@@ -19,4 +19,6 @@
 
 obj-y := init.o setup.o
 
+export-objs := setup.o
+
 include $(TOPDIR)/Rules.make

Index: setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/setup.c,v retrieving revision 1.1.2.3

setup.c 21 Mar 2003 19:34:19 -0000 renamed from setup.c 7 Jan 2003 10:41:30 -0000 1.1.2.3 +4 -0
diff -u -r1.1.2.3 setup.c
@@ -242,3 +242,7 @@
                return phys_addr;
 }
 #endif
+
+#include <linux/module.h>
+EXPORT_SYMBOL(__wbflush);
+
Quoted 171 lines · Hartvig Ekner

Hi,

the patches below for all four au1000 setup.c files removes the wbflush() routine, as this is no longer necessary (handled by the generic code now, which does a sync). This also means that it is not necessary to say yes to CONFIG_CPU_ADVANCED and override the CPU_HAS_WB setting, as the generic MIPS32 code will do just fine.

The patch for the db1x00 setup.c file also fixes a bug which prevented VRA from being used with Audio Codecs which support it.

/Hartvig

Index: db1x00/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/setup.c,v retrieving revision 1.1.2.3
diff -u -r1.1.2.3 setup.c

setup.c +3 -10
@@ -61,7 +61,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -76,11 +75,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1x00_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -109,14 +103,13 @@
     }
 #endif
 
-#if defined(CONFIG_SOUND_AU1000) && !defined(CONFIG_CPU_AU1000)
+#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_CPU_AU1000)
 	// au1000 does not support vra, au1500 and au1100 do
-    strcat(argptr, " au1000_audio=vra");
-    argptr = prom_getcmdline();
+	strcat(argptr, " au1000_audio=vra");
+	argptr = prom_getcmdline();
 #endif
 
 	rtc_ops = &no_rtc_ops;
-	__wbflush = au1x00_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1000/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1000/setup.c,v retrieving revision 1.8.2.8
diff -u -r1.8.2.8 setup.c

setup.c +0 -7
@@ -67,7 +67,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -78,11 +77,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1000_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -103,7 +97,6 @@
 #endif
 
 	rtc_ops = &no_rtc_ops;
-        __wbflush = au1000_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1100/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1100/setup.c,v retrieving revision 1.1.2.6
diff -u -r1.1.2.6 setup.c

setup.c +0 -7
@@ -71,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -82,11 +81,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1100_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -112,7 +106,6 @@
 	argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1100_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;

Index: pb1500/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1500/setup.c,v retrieving revision 1.1.2.10
diff -u -r1.1.2.10 setup.c

setup.c +0 -8
@@ -43,7 +43,6 @@
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
 #include <asm/pgtable.h>
-#include <asm/wbflush.h>
 #include <asm/au1000.h>
 #include <asm/pb1500.h>
 
@@ -72,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -87,11 +85,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1500_wbflush(void)
-{
-	__asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
 	char *argptr;
@@ -117,7 +110,6 @@
 	argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1500_wbflush;
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	_machine_power_off = au1000_power_off;
Signature · 7 lines
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  [email protected] 
#3 lore raw

Hi Jeff,

Are you talking about these two 8139 files from 2.4?

/home/hartvige/src/linux/linux-ralf/drivers/net> ls *8139*.c 8139cp.c 8139too.c

I can't see that they are using wbflush in any way. Grepping after wbflush through the entire 2.4 tree, it seems wbflush is something only present on some dec platforms and then the au1000 stuff - which would mean that any driver directly calling __wbflush would be unable to compile/load on the majority of kernels. Or am I missing something? (I haven't been using modules under MIPS at all).

In fact, I can't find a single file including wbflush.h except system.h, and it doesn't look like anybody else should directly be including the wbflush.h file, but only use the macros in system.h:

#define wmb()           fast_wmb()
#define rmb()           fast_rmb()
#define mb()            wbflush();
#define iob()           wbflush();

(which are differently defined if there is no WB configured).

/Hartvig

Quoted 223 lines · Jeff Baitis

On the subject of __wbflush():

It seems to me that setup.c should be exporting __wbflush, since there are some modules that require this symbol. Try compiling the 8139 ethernet module, or HostAP wireless drivers :)

Are the following patches correct?
Thanks!

-Jeff

Index: Makefile
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/Makefile,v retrieving revision 1.1.2.2
diff -u -r1.1.2.2 Makefile

Makefile 21 Mar 2003 19:34:11 -0000 renamed from Makefile 5 Mar 2003 08:18:58 -0000 1.1.2.2 +2 -0
@@ -19,4 +19,6 @@
 
 obj-y := init.o setup.o
 
+export-objs := setup.o
+
 include $(TOPDIR)/Rules.make

Index: setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/setup.c,v retrieving revision 1.1.2.3
diff -u -r1.1.2.3 setup.c

setup.c 21 Mar 2003 19:34:19 -0000 renamed from setup.c 7 Jan 2003 10:41:30 -0000 1.1.2.3 +4 -0
@@ -242,3 +242,7 @@
                return phys_addr;
 }
 #endif
+
+#include <linux/module.h>
+EXPORT_SYMBOL(__wbflush);
+
Quoted 164 lines · Hartvig Ekner

Hi,

the patches below for all four au1000 setup.c files removes the wbflush() routine, as this is no longer necessary (handled by the generic code now, which does a sync). This also means that it is not necessary to say yes to CONFIG_CPU_ADVANCED and override the CPU_HAS_WB setting, as the generic MIPS32 code will do just fine.

The patch for the db1x00 setup.c file also fixes a bug which prevented VRA from being used with Audio Codecs which support it.

/Hartvig

Index: db1x00/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/db1x00/Attic/setup.c,v retrieving revision 1.1.2.3
diff -u -r1.1.2.3 setup.c

setup.c 21 Mar 2003 08:44:49 -0000 renamed from setup.c 7 Jan 2003 10:41:30 -0000 1.1.2.3 +3 -10
@@ -61,7 +61,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -76,11 +75,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1x00_wbflush(void)
-{
-     __asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
      char *argptr;
@@ -109,14 +103,13 @@
     }
 #endif
 
-#if defined(CONFIG_SOUND_AU1000) && !defined(CONFIG_CPU_AU1000)
+#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_CPU_AU1000)
      // au1000 does not support vra, au1500 and au1100 do
-    strcat(argptr, " au1000_audio=vra");
-    argptr = prom_getcmdline();
+     strcat(argptr, " au1000_audio=vra");
+     argptr = prom_getcmdline();
 #endif
 
      rtc_ops = &no_rtc_ops;
-     __wbflush = au1x00_wbflush;
      _machine_restart = au1000_restart;
      _machine_halt = au1000_halt;
      _machine_power_off = au1000_power_off;

Index: pb1000/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1000/setup.c,v retrieving revision 1.8.2.8
diff -u -r1.8.2.8 setup.c

setup.c 21 Mar 2003 08:44:50 -0000 renamed from setup.c 11 Dec 2002 06:12:29 -0000 1.8.2.8 +0 -7
@@ -67,7 +67,6 @@
 extern struct ide_ops *ide_ops;
 #endif
 
-void (*__wbflush) (void);
 extern struct rtc_ops no_rtc_ops;
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
@@ -78,11 +77,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1000_wbflush(void)
-{
-     __asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
      char *argptr;
@@ -103,7 +97,6 @@
 #endif
 
      rtc_ops = &no_rtc_ops;
-        __wbflush = au1000_wbflush;
      _machine_restart = au1000_restart;
      _machine_halt = au1000_halt;
      _machine_power_off = au1000_power_off;

Index: pb1100/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1100/setup.c,v retrieving revision 1.1.2.6
diff -u -r1.1.2.6 setup.c

setup.c 21 Mar 2003 08:44:50 -0000 renamed from setup.c 31 Dec 2002 05:00:22 -0000 1.1.2.6 +0 -7
@@ -71,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -82,11 +81,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1100_wbflush(void)
-{
-     __asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
      char *argptr;
@@ -112,7 +106,6 @@
      argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1100_wbflush;
      _machine_restart = au1000_restart;
      _machine_halt = au1000_halt;
      _machine_power_off = au1000_power_off;

Index: pb1500/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/pb1500/setup.c,v retrieving revision 1.1.2.10
diff -u -r1.1.2.10 setup.c

setup.c 21 Mar 2003 08:44:50 -0000 renamed from setup.c 29 Dec 2002 10:30:35 -0000 1.1.2.10 +0 -7
@@ -43,7 +43,6 @@
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
 #include <asm/pgtable.h>
-#include <asm/wbflush.h>
 #include <asm/au1000.h>
 #include <asm/pb1500.h>
 
@@ -72,7 +71,6 @@
 extern struct rtc_ops pb1500_rtc_ops;
 #endif
 
-void (*__wbflush) (void);
 extern char * __init prom_getcmdline(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
@@ -87,11 +85,6 @@
 
 void __init bus_error_init(void) { /* nothing */ }
 
-void au1500_wbflush(void)
-{
-     __asm__ volatile ("sync");
-}
-
 void __init au1x00_setup(void)
 {
      char *argptr;

setup.c 21 Mar 2003 08:44:50 -0000 line 115

Quoted 7 lines
setup.c 21 Mar 2003 08:44:50 -0000 renamed from setup.c 29 Dec 2002 10:30:35 -0000 1.1.2.10 +0 -1
@@ -117,7 +110,6 @@
      argptr = prom_getcmdline();
 #endif
 
-        __wbflush = au1500_wbflush;
      _machine_restart = au1000_restart;
      _machine_halt = au1000_halt;
      _machine_power_off = au1000_power_off;

--
Jeffrey Baitis - Associate Software Engineer

Evolution Robotics, Inc.
130 West Union Street
Pasadena CA 91103

tel: 626.535.2776 | fax: 626.535.2777 | [email protected]

#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"hartvig" == Hartvig Ekner <[email protected]> writes:

hartvig> I can't see that they are using wbflush in any way. Grepping hartvig> after wbflush through the entire 2.4 tree, it seems wbflush hartvig> is something only present on some dec platforms and then the hartvig> au1000 stuff - which would mean that any driver directly hartvig> calling __wbflush would be unable to compile/load on the hartvig> majority of kernels. Or am I missing something? (I haven't hartvig> been using modules under MIPS at all).

Yes, you missed the definition of mb() :p

quintela$ grep "mb(" drivers/net/8139* | grep -v rmb | grep -v wmb
drivers/net/8139too.c: mb();
quintela$

hartvig> In fact, I can't find a single file including wbflush.h hartvig> except system.h, and it doesn't look like anybody else should hartvig> directly be including the wbflush.h file, but only use the hartvig> macros in system.h:

hartvig> #define wmb()           fast_wmb()
hartvig> #define rmb()           fast_rmb()
hartvig> #define mb()            wbflush();
hartvig> #define iob()           wbflush();

hartvig> (which are differently defined if there is no WB configured).

but WB is configured in :)

quintela$ grep WB arch/mips/defconfig-pb1*
arch/mips/defconfig-pb1000:CONFIG_CPU_HAS_WB=y
arch/mips/defconfig-pb1100:CONFIG_CPU_HAS_WB=y
arch/mips/defconfig-pb1500:CONFIG_CPU_HAS_WB=y
quintela$

Other thing is that this machine should be using wbflush at all, but that is a different story. I agree with (/me looks in archive), *your* patch removing wbflush for that boards. They are only doing "sync" ond wbflush, and that is the thing that __sync() already does.

I.e. If I have to chooses wich patch to integrate, the one exporting __wbflush(), or the one removing it altogether from pb1*, I will choose removing it. It looks superflous.

Later, Juan "who don't have that processor, and handwaving is easy".

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#5 lore raw

Hi Juan,

Quoted 21 lines · Juan Quintela
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"hartvig" == Hartvig Ekner <[email protected]> writes:

hartvig> I can't see that they are using wbflush in any way. Grepping hartvig> after wbflush through the entire 2.4 tree, it seems wbflush hartvig> is something only present on some dec platforms and then the hartvig> au1000 stuff - which would mean that any driver directly hartvig> calling __wbflush would be unable to compile/load on the hartvig> majority of kernels. Or am I missing something? (I haven't hartvig> been using modules under MIPS at all).

Yes, you missed the definition of mb() :p

quintela$ grep "mb(" drivers/net/8139* | grep -v rmb | grep -v wmb
drivers/net/8139too.c: mb();
quintela$

hartvig> In fact, I can't find a single file including wbflush.h hartvig> except system.h, and it doesn't look like anybody else should hartvig> directly be including the wbflush.h file, but only use the hartvig> macros in system.h:

Quoted 9 lines
hartvig> #define wmb()           fast_wmb()
hartvig> #define rmb()           fast_rmb()
hartvig> #define mb()            wbflush();
hartvig> #define iob()           wbflush();

hartvig> (which are differently defined if there is no WB configured).

but WB is configured in :)

That's the problem! Wb does not need to be configured in, it is a mistake. My patch was missing the required fixes to the defconfig files, it was only described in the mail. So I think the only thing missing is a patch to fix all the pb/db defconfig files to look like this:

# CONFIG_CPU_ADVANCED is not set
CONFIG_CPU_HAS_LLSC=y
# CONFIG_CPU_HAS_LLDSCD is not set
# CONFIG_CPU_HAS_WB is not set
CONFIG_CPU_HAS_SYNC=y

... which is the setting also used by all other MIPS32 CPUs. Then everything should be ok.

/Hartvig

Quoted 21 lines

quintela$ grep WB arch/mips/defconfig-pb1*
arch/mips/defconfig-pb1000:CONFIG_CPU_HAS_WB=y
arch/mips/defconfig-pb1100:CONFIG_CPU_HAS_WB=y
arch/mips/defconfig-pb1500:CONFIG_CPU_HAS_WB=y
quintela$

Other thing is that this machine should be using wbflush at all, but that is a different story. I agree with (/me looks in archive), *your* patch removing wbflush for that boards. They are only doing "sync" ond wbflush, and that is the thing that __sync() already does.

I.e. If I have to chooses wich patch to integrate, the one exporting __wbflush(), or the one removing it altogether from pb1*, I will choose removing it. It looks superflous.

Later, Juan "who don't have that processor, and handwaving is easy".

--
In theory, practice and theory are the same, but in practice they are different -- Larry McVoy

#6 lore raw

Yes. mb() was at the heart of the problem.

I've applied the patches that remove wbflush, and de-configured my .config, and everything is compiling just fine!

Thanks,

Jeff

Quoted 71 lines · Hartvig Ekner

Hi Juan,

Quoted 21 lines · Juan Quintela
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"hartvig" == Hartvig Ekner <[email protected]> writes:

hartvig> I can't see that they are using wbflush in any way. Grepping hartvig> after wbflush through the entire 2.4 tree, it seems wbflush hartvig> is something only present on some dec platforms and then the hartvig> au1000 stuff - which would mean that any driver directly hartvig> calling __wbflush would be unable to compile/load on the hartvig> majority of kernels. Or am I missing something? (I haven't hartvig> been using modules under MIPS at all).

Yes, you missed the definition of mb() :p

quintela$ grep "mb(" drivers/net/8139* | grep -v rmb | grep -v wmb
drivers/net/8139too.c: mb();
quintela$

hartvig> In fact, I can't find a single file including wbflush.h hartvig> except system.h, and it doesn't look like anybody else should hartvig> directly be including the wbflush.h file, but only use the hartvig> macros in system.h:

Quoted 9 lines
hartvig> #define wmb()           fast_wmb()
hartvig> #define rmb()           fast_rmb()
hartvig> #define mb()            wbflush();
hartvig> #define iob()           wbflush();

hartvig> (which are differently defined if there is no WB configured).

but WB is configured in :)

That's the problem! Wb does not need to be configured in, it is a mistake. My patch was missing the required fixes to the defconfig files, it was only described in the mail. So I think the only thing missing is a patch to fix all the pb/db defconfig files to look like this:

# CONFIG_CPU_ADVANCED is not set
CONFIG_CPU_HAS_LLSC=y
# CONFIG_CPU_HAS_LLDSCD is not set
# CONFIG_CPU_HAS_WB is not set
CONFIG_CPU_HAS_SYNC=y

... which is the setting also used by all other MIPS32 CPUs. Then everything should be ok.

/Hartvig

Quoted 21 lines

quintela$ grep WB arch/mips/defconfig-pb1*
arch/mips/defconfig-pb1000:CONFIG_CPU_HAS_WB=y
arch/mips/defconfig-pb1100:CONFIG_CPU_HAS_WB=y
arch/mips/defconfig-pb1500:CONFIG_CPU_HAS_WB=y
quintela$

Other thing is that this machine should be using wbflush at all, but that is a different story. I agree with (/me looks in archive), *your* patch removing wbflush for that boards. They are only doing "sync" ond wbflush, and that is the thing that __sync() already does.

I.e. If I have to chooses wich patch to integrate, the one exporting __wbflush(), or the one removing it altogether from pb1*, I will choose removing it. It looks superflous.

Later, Juan "who don't have that processor, and handwaving is easy".

--
In theory, practice and theory are the same, but in practice they are different -- Larry McVoy

Signature · 7 lines
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  [email protected]