Skip to contentSkip to conversation

SGI O2 meth: missing sysfs device symlink

DISCUSSION Martin Michlmayr 8 participants 22 messages May 17, 2007 – May 24, 2007 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#4 lore raw
In reply to a message not in the archive

Apparently udev fails to rename the SGI O2 interface because it doesn't have a sysfs device symlink. Does someone here know how to fix this?

Quoted 19 lines · Giuseppe Sacco

[...]

Quoted 2 lines

Interfaces must have a device symlink (in /sys/class/net/$IFACE/, which some broken drivers lack) and unique MAC addresses.

Hi Marco,
this "device" link is missing for this driver. So probably this is a kernel bug.

giuseppe@sgi:~$ ls -ld /sys/class/net/*{,/device}
drwxr-xr-x 3 root root 0 2007-05-17 08:22 /sys/class/net/eth0
drwxr-xr-x 3 root root 0 2007-05-17 08:22 /sys/class/net/eth100
lrwxrwxrwx 1 root root 0 2007-05-17 08:22 /sys/class/net/eth100/device ->
../../../devices/pci0000:00/0000:00:03.0
drwxr-xr-x 3 root root 0 2007-05-12 23:35 /sys/class/net/lo
drwxr-xr-x 3 root root 0 2007-05-12 15:10 /sys/class/net/ppp0
drwxr-xr-x 3 root root 0 2007-05-12 21:35 /sys/class/net/sit0

Thanks,
Giuseppe

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#5 lore raw
Quoted 3 lines · Martin Michlmayr

Apparently udev fails to rename the SGI O2 interface because it doesn't have a sysfs device symlink. Does someone here know how to fix this?

The driver needs to be rewritten to support the device driver model which in this case means as a platform device.

The driver is ok; it's just ancient style, not long ago was using constructs there were already deprecated for 2.4 ...

Ralf

#6 lore raw

On Mon, May 21, 2007 at 04:47:26PM +0100, Ralf Baechle wrote:

Below patch is meant to cure the problem. It's against HEAD but should apply to somewhat older problems as well.

I appreciate testing asap so I can try to still push this upstream for 2.6.22.

Thanks,

Ralf

arch/mips/sgi-ip32/Makefile +1 -1
index 7e14167..60f0227 100644
@@ -3,5 +3,5 @@
 # under Linux.
 #
 
-obj-y	+= ip32-berr.o ip32-irq.o ip32-setup.o ip32-reset.o \
+obj-y	+= ip32-berr.o ip32-irq.o ip32-platform.o ip32-setup.o ip32-reset.o \
 	   crime.o ip32-memory.o
arch/mips/sgi-ip32/ip32-platform.c new file +20 -0
new file mode 100644
index 0000000..120b159
@@ -0,0 +1,20 @@
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+static __init int meth_devinit(void)
+{
+	struct platform_device *pd;
+	int ret;
+
+	pd = platform_device_alloc("meth", -1);
+	if (!pd)
+		return -ENOMEM;
+
+	ret = platform_device_add(pd);
+	if (ret)
+		platform_device_put(pd);
+
+	return ret;
+}
+
+device_initcall(meth_devinit);
drivers/net/meth.c +45 -23

122 lines not on this page · raw message

#7 lore raw

Il giorno mar, 22/05/2007 alle 12.09 +0100, Ralf Baechle ha scritto:

Quoted 7 lines · Ralf Baechle

Below patch is meant to cure the problem. It's against HEAD but should apply to somewhat older problems as well.

I appreciate testing asap so I can try to still push this upstream for 2.6.22.

[...]

I may test it against 2.6.18, the standard debian kernel for stable; but I will be on the console only in two days :-(

Bye,
Giuseppe

#8 lore raw

I've noticed that besides kernel complied from the Debian 2.6.18, I can't get any other kernel (vanilla from kernel.org or the separate linux-MIPS repository) to boot on my O2.

If you need beta testers, I can try, but it will take a day or so (compiling on the O2 is slow).

Finally, I've been working on the PCI Legacy IO issue (progress is sadly slow - don't have a fully compiling patchset yet), would this patch be relevant since its also an O2 sysfs issue?

Quoted 19 lines

Il giorno mar, 22/05/2007 alle 12.09 +0100, Ralf Baechle ha scritto:

Quoted 7 lines · Ralf Baechle

Below patch is meant to cure the problem. It's against HEAD but should apply to somewhat older problems as well.

I appreciate testing asap so I can try to still push this upstream for 2.6.22.

[...]

I may test it against 2.6.18, the standard debian kernel for stable; but I will be on the console only in two days :-(

Bye,
Giuseppe

#20 lore raw
In reply to Giuseppe Sacco

Il giorno mar, 22/05/2007 alle 13.41 +0200, Giuseppe Sacco ha scritto:

Quoted 6 lines

Il giorno mar, 22/05/2007 alle 12.09 +0100, Ralf Baechle ha scritto:

Quoted 5 lines · Ralf Baechle

Below patch is meant to cure the problem. It's against HEAD but should apply to somewhat older problems as well.

Quoted 6 lines
Quoted 2 lines

I appreciate testing asap so I can try to still push this upstream for 2.6.22.

[...]

I may test it against 2.6.18, the standard debian kernel for stable; but I will be on the console only in two days :-(

It seems the patch doesn't apply on 2.6.18, so I will recompile 2.6.22-rc2, but I do not know if it works on my SGI. I never tried it.

The error is:

giuseppe@sgi:/usr/local/src/linux-source-2.6.18$ patch -p1 --dry-run </tmp/sgi.patch 
patching file arch/mips/sgi-ip32/Makefile
Hunk #1 succeeded at 3 with fuzz 2.
patching file arch/mips/sgi-ip32/ip32-platform.c
patching file drivers/net/meth.c
Hunk #1 FAILED at 8.
Hunk #2 succeeded at 36 with fuzz 2 (offset 2 lines).
Hunk #3 succeeded at 53 (offset 2 lines).
Hunk #4 succeeded at 785 (offset 3 lines).
Hunk #5 succeeded at 809 with fuzz 2 (offset 3 lines).
Hunk #6 succeeded at 822 (offset 3 lines).
1 out of 6 hunks FAILED -- saving rejects to file drivers/net/meth.c.rej
#9 lore raw
In reply to [email protected]
Quoted 6 lines · On Tue, May 22, 2007 at 08:01:53AM -0400, [email protected] wrote:

I've noticed that besides kernel complied from the Debian 2.6.18, I can't get any other kernel (vanilla from kernel.org or the separate linux-MIPS repository) to boot on my O2.

If you need beta testers, I can try, but it will take a day or so (compiling on the O2 is slow).

Sounds almost like you're building an excessibly large kernel configuration. A realistic kernel config will crosscompile within a few minutes on a modest machine such as a 3GHz / 1GB P4-class PC.

But to lessen the pains of your aching CPU, here's a binary tarball:

ftp://ftp.linux-mips.org/pub/linux/mips/people/ralf/sgi-ip32/linux-2.6.22-rc2-gc6b5a619-dirty.tar.bz2

Quoted 3 lines

Finally, I've been working on the PCI Legacy IO issue (progress is sadly slow - don't have a fully compiling patchset yet), would this patch be relevant since its also an O2 sysfs issue?

The two issues are entirely unrelated.

Ralf

#21 lore raw
In reply to Giuseppe Sacco
Quoted 2 lines · Giuseppe Sacco

It seems the patch doesn't apply on 2.6.18, so I will recompile 2.6.22-rc2, but I do not know if it works on my SGI. I never tried it.

Remove the "#include <linux/sched.h>" line drivers/net/meth.c, then apply the patch. Anyway, here's also a binary tarball:

ftp://ftp.linux-mips.org/pub/linux/mips/people/ralf/sgi-ip32/linux-2.6.18.8-gb29bece0-dirty.tar.bz2

Ralf

#10 lore raw
In reply to Ralf Baechle
Quoted 7 lines · On Tue, May 22, 2007 at 08:01:53AM -0400, [email protected] wrote:
Quoted 6 lines

I've noticed that besides kernel complied from the Debian 2.6.18, I can't
get any other kernel (vanilla from kernel.org or the separate linux-MIPS repository) to boot on my O2.

Quoted 8 lines
Quoted 2 lines

If you need beta testers, I can try, but it will take a day or so (compiling on the O2 is slow).

Sounds almost like you're building an excessibly large kernel configuration.
A realistic kernel config will crosscompile within a few minutes on a modest machine such as a 3GHz / 1GB P4-class PC.

I could never get cross-compiling to work, so I've been doing all my compiling directly on the R5K 300 Mhz CPU in my O2. If there is an easy way to get this to work, I'd be very thankful for some pointers. Might my trying to compile on the actual machine be why I can't seem to use any source other than Debian's 2.6.18?

Quoted 4 lines

But to lessen the pains of your aching CPU, here's a binary tarball:

ftp://ftp.linux-mips.org/pub/linux/mips/people/ralf/sgi-ip32/linux-2.6.22-rc2-gc6b5a619-dirty.tar.bz2

Thanks. I installed the kernel and arcboot was able to load it, but nothing showed up on the screen. Does this have framebuffer support? In was also unable to ssh in. Does this kernel have the necessary support for that? It didn't fault at boot (like most of my nonbootable kernel do) and I did hear the standard startup hard drive activity, so things may be working. I was also able to get a response from the power button to correctly reboot. Sadly I lack the necessary null modem cable for a serial console (if this was the only interface you configured). If you can crank out a new one with framebuffer support just as quickly, I'll gladly give it a whirl.

Quoted 8 lines
Quoted 3 lines

Finally, I've been working on the PCI Legacy IO issue (progress is sadly slow - don't have a fully compiling patchset yet), would this patch be relevant since its also an O2 sysfs issue?

The two issues are entirely unrelated.

Ralf

Nice to know.

#19 lore raw
In reply to [email protected]
Quoted 6 lines · [email protected] wrote:

I've noticed that besides kernel complied from the Debian 2.6.18, I can't get any other kernel (vanilla from kernel.org or the separate linux-MIPS repository) to boot on my O2.

If you need beta testers, I can try, but it will take a day or so (compiling on the O2 is slow).

If you have a faster Debian system around you may want to try a cross compiler: http://people.debian.org/~ths/toolchain/

Thiemo

#11 lore raw
In reply to [email protected]
Quoted 16 lines · [email protected] wrote:
Quoted 7 lines · On Tue, May 22, 2007 at 08:01:53AM -0400, [email protected] wrote:
Quoted 6 lines

I've noticed that besides kernel complied from the Debian 2.6.18, I can't
get any other kernel (vanilla from kernel.org or the separate linux-MIPS repository) to boot on my O2.

Quoted 8 lines
Quoted 2 lines

If you need beta testers, I can try, but it will take a day or so (compiling on the O2 is slow).

Sounds almost like you're building an excessibly large kernel configuration.
A realistic kernel config will crosscompile within a few minutes on a modest machine such as a 3GHz / 1GB P4-class PC.

Quoted 5 lines

I could never get cross-compiling to work, so I've been doing all my compiling directly on the R5K 300 Mhz CPU in my O2. If there is an easy way to get this to work, I'd be very thankful for some pointers. Might my trying to compile on the actual machine be why I can't seem to use any source other than Debian's 2.6.18?

Should be rather straightforward:

- Add the sources.list line mentioned in the repository to your /etc/apt/sources.list, for debian/stable that's:

deb http://people.debian.org/~ths/toolchain/current etch/

- apt-get update
- apt-get install gcc-4.1-mips-linux-gnu

- In your www.linux-mips.org source tree, compile with e.g. make CROSS_COMPILE=mips-linux-gnu- oldconfig make CROSS_COMPILE=mips-linux-gnu- all

Thiemo

#12 lore raw

Cross-Compile difficulties

Quoted 35 lines
Quoted 17 lines · [email protected] wrote:
Quoted 5 lines · On Tue, May 22, 2007 at 08:01:53AM -0400, [email protected] wrote:
Quoted 4 lines

I've noticed that besides kernel complied from the Debian 2.6.18, I can't
get any other kernel (vanilla from kernel.org or the separate

linux-MIPS

Quoted 10 lines
Quoted 4 lines

repository) to boot on my O2.

If you need beta testers, I can try, but it will take a day or so (compiling on the O2 is slow).

Sounds almost like you're building an excessibly large kernel configuration.
A realistic kernel config will crosscompile within a few minutes on a modest machine such as a 3GHz / 1GB P4-class PC.

Quoted 6 lines

I could never get cross-compiling to work, so I've been doing all my compiling directly on the R5K 300 Mhz CPU in my O2. If there is an easy way to get this to work, I'd be very thankful for some pointers. Might my
trying to compile on the actual machine be why I can't seem to use any source other than Debian's 2.6.18?

Should be rather straightforward:

- Add the sources.list line mentioned in the repository to your /etc/apt/sources.list, for debian/stable that's:

deb http://people.debian.org/~ths/toolchain/current etch/

- apt-get update
- apt-get install gcc-4.1-mips-linux-gnu

Quoted 8 lines

- In your www.linux-mips.org source tree, compile with e.g. make CROSS_COMPILE=mips-linux-gnu- oldconfig make CROSS_COMPILE=mips-linux-gnu- all

Thiemo

Thanks for your help, but that isn't working.
With both the 2.6.20.11 and 2.6.21.1 I get the same results. To be verbose:

Shiva:/usr/src/linux-2.6.20.11# more /etc/apt/sources.list
deb http://ftp.debian.org/ etch main contrib non-free
deb http://mirrors.kernel.org/debian/ etch main contrib non-free
deb http://debian.lcs.mit.edu/debian/ etch main contrib non-free
deb http://people.debian.org/~ths/toolchain/current etch/
deb http://security.debian.org/ etch/updates main
Shiva:/usr/src/linux-2.6.20.11# apt-get update
Get:1 http://debian.lcs.mit.edu etch Release.gpg [378B]
Hit http://debian.lcs.mit.edu etch Release
Ign http://debian.lcs.mit.edu etch/main Packages/DiffIndex
Ign http://debian.lcs.mit.edu etch/contrib Packages/DiffIndex
Ign http://debian.lcs.mit.edu etch/non-free Packages/DiffIndex
Hit http://debian.lcs.mit.edu etch/main Packages
Hit http://debian.lcs.mit.edu etch/contrib Packages
Hit http://debian.lcs.mit.edu etch/non-free Packages
Ign http://people.debian.org etch/ Release.gpg
Get:2 http://ftp.debian.org etch Release.gpg [378B]
Ign http://people.debian.org etch/ Release
Get:3 http://mirrors.kernel.org etch Release.gpg [378B]
Hit http://ftp.debian.org etch Release
Ign http://people.debian.org etch/ Packages/DiffIndex
Ign http://ftp.debian.org etch/main Packages/DiffIndex
Hit http://mirrors.kernel.org etch Release
Ign http://people.debian.org etch/ Packages
Ign http://ftp.debian.org etch/contrib Packages/DiffIndex
Ign http://ftp.debian.org etch/non-free Packages/DiffIndex
Get:4 http://security.debian.org etch/updates Release.gpg [189B]
Hit http://people.debian.org etch/ Packages
Ign http://mirrors.kernel.org etch/main Packages/DiffIndex
Hit http://ftp.debian.org etch/main Packages
Hit http://ftp.debian.org etch/contrib Packages
Hit http://ftp.debian.org etch/non-free Packages
Ign http://mirrors.kernel.org etch/contrib Packages/DiffIndex
Ign http://mirrors.kernel.org etch/non-free Packages/DiffIndex
Hit http://security.debian.org etch/updates Release
Hit http://mirrors.kernel.org etch/main Packages
Hit http://mirrors.kernel.org etch/contrib Packages
Hit http://mirrors.kernel.org etch/non-free Packages
Ign http://security.debian.org etch/updates/main Packages/DiffIndex
Hit http://security.debian.org etch/updates/main Packages
Fetched 4B in 0s (5B/s)
Reading package lists... Done
Shiva:/usr/src/linux-2.6.20.11# apt-get install gcc-4.1-mips-linux-gnu
Reading package lists... Done
Building dependency tree... Done
gcc-4.1-mips-linux-gnu is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Shiva:/usr/src/linux-2.6.20.11# make CROSS_COMPILE=mips-linux-gnu- oldconfig
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c:107:23: error: sys/types.h: No such file or directory
scripts/basic/fixdep.c:108:22: error: sys/stat.h: No such file or directory
scripts/basic/fixdep.c:109:22: error: sys/mman.h: No such file or directory
scripts/basic/fixdep.c:110:20: error: unistd.h: No such file or directory
scripts/basic/fixdep.c:111:19: error: fcntl.h: No such file or directory
scripts/basic/fixdep.c:112:20: error: string.h: No such file or directory
scripts/basic/fixdep.c:113:20: error: stdlib.h: No such file or directory
scripts/basic/fixdep.c:114:19: error: stdio.h: No such file or directory
In file included from
/usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h:7,
                 from /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h:11,
                 from scripts/basic/fixdep.c:115:
/usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h:122:61: error:
limits.h: No such file or directory
scripts/basic/fixdep.c:116:19: error: ctype.h: No such file or directory
scripts/basic/fixdep.c:117:23: error: arpa/inet.h: No such file or directory
scripts/basic/fixdep.c: In function ‘usage’:
scripts/basic/fixdep.c:131: warning: implicit declaration of function
‘fprintf’
scripts/basic/fixdep.c:131: warning: incompatible implicit declaration of
built-in function ‘fprintf’
scripts/basic/fixdep.c:131: error: ‘stderr’ undeclared (first use in this
function)
scripts/basic/fixdep.c:131: error: (Each undeclared identifier is reported
only once
scripts/basic/fixdep.c:131: error: for each function it appears in.)
scripts/basic/fixdep.c:132: warning: implicit declaration of function ‘exit’
scripts/basic/fixdep.c:132: warning: incompatible implicit declaration of
built-in function ‘exit’
scripts/basic/fixdep.c: In function ‘print_cmdline’:
scripts/basic/fixdep.c:140: warning: implicit declaration of function
‘printf’
scripts/basic/fixdep.c:140: warning: incompatible implicit declaration of
built-in function ‘printf’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:143: error: ‘NULL’ undeclared here (not in a function)
scripts/basic/fixdep.c: In function ‘grow_config’:
scripts/basic/fixdep.c:156: warning: implicit declaration of function
‘realloc’
scripts/basic/fixdep.c:156: warning: assignment makes pointer from integer
without a cast
scripts/basic/fixdep.c:158: warning: implicit declaration of function
‘perror’
scripts/basic/fixdep.c:158: warning: incompatible implicit declaration of
built-in function ‘exit’
scripts/basic/fixdep.c: In function ‘is_defined_config’:
scripts/basic/fixdep.c:174: warning: implicit declaration of function
‘memcmp’
scripts/basic/fixdep.c: In function ‘define_config’:
scripts/basic/fixdep.c:187: warning: implicit declaration of function
‘memcpy’
scripts/basic/fixdep.c:187: warning: incompatible implicit declaration of
built-in function ‘memcpy’
scripts/basic/fixdep.c: In function ‘use_config’:
scripts/basic/fixdep.c:206: error: ‘PATH_MAX’ undeclared (first use in
this function)
scripts/basic/fixdep.c:214: warning: incompatible implicit declaration of
built-in function ‘memcpy’
scripts/basic/fixdep.c:220: warning: implicit declaration of function
‘tolower’
scripts/basic/fixdep.c:222: warning: incompatible implicit declaration of
built-in function ‘printf’
scripts/basic/fixdep.c:206: warning: unused variable ‘s’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:225: error: expected declaration specifiers or
‘...’ before ‘size_t’
scripts/basic/fixdep.c: In function ‘parse_config_file’:
scripts/basic/fixdep.c:227: error: ‘len’ undeclared (first use in this
function)
scripts/basic/fixdep.c:233: warning: implicit declaration of function ‘ntohl’
scripts/basic/fixdep.c:244: warning: implicit declaration of function
‘isalnum’
scripts/basic/fixdep.c: In function ‘strrcmp’:
scripts/basic/fixdep.c:259: warning: implicit declaration of function
‘strlen’
scripts/basic/fixdep.c:259: warning: incompatible implicit declaration of
built-in function ‘strlen’
scripts/basic/fixdep.c: In function ‘do_config_file’:
scripts/basic/fixdep.c:270: error: storage size of ‘st’ isn’t known
scripts/basic/fixdep.c:274: warning: implicit declaration of function ‘open’
scripts/basic/fixdep.c:274: error: ‘O_RDONLY’ undeclared (first use in
this function)
scripts/basic/fixdep.c:276: warning: incompatible implicit declaration of
built-in function ‘fprintf’
scripts/basic/fixdep.c:276: error: ‘stderr’ undeclared (first use in this
function)
scripts/basic/fixdep.c:278: warning: incompatible implicit declaration of
built-in function ‘exit’
scripts/basic/fixdep.c:280: warning: implicit declaration of function ‘fstat’
scripts/basic/fixdep.c:282: warning: implicit declaration of function ‘close’
scripts/basic/fixdep.c:285: warning: implicit declaration of function ‘mmap’
scripts/basic/fixdep.c:285: error: ‘PROT_READ’ undeclared (first use in
this function)
scripts/basic/fixdep.c:285: error: ‘MAP_PRIVATE’ undeclared (first use in
this function)
scripts/basic/fixdep.c:285: warning: assignment makes pointer from integer
without a cast
scripts/basic/fixdep.c:292: error: too many arguments to function
‘parse_config_file’
scripts/basic/fixdep.c:294: warning: implicit declaration of function
‘munmap’
scripts/basic/fixdep.c:270: warning: unused variable ‘st’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:299: error: expected declaration specifiers or
‘...’ before ‘size_t’
scripts/basic/fixdep.c: In function ‘parse_dep_file’:
scripts/basic/fixdep.c:302: error: ‘len’ undeclared (first use in this
function)
scripts/basic/fixdep.c:304: error: ‘PATH_MAX’ undeclared (first use in
this function)
scripts/basic/fixdep.c:306: warning: implicit declaration of function
‘strchr’
scripts/basic/fixdep.c:306: warning: incompatible implicit declaration of
built-in function ‘strchr’
scripts/basic/fixdep.c:308: warning: incompatible implicit declaration of
built-in function ‘fprintf’
scripts/basic/fixdep.c:308: error: ‘stderr’ undeclared (first use in this
function)
scripts/basic/fixdep.c:309: warning: incompatible implicit declaration of
built-in function ‘exit’
scripts/basic/fixdep.c:311: warning: incompatible implicit declaration of
built-in function ‘memcpy’
scripts/basic/fixdep.c:312: warning: incompatible implicit declaration of
built-in function ‘printf’
scripts/basic/fixdep.c:304: warning: unused variable ‘s’
scripts/basic/fixdep.c: In function ‘print_deps’:
scripts/basic/fixdep.c:341: error: storage size of ‘st’ isn’t known
scripts/basic/fixdep.c:345: error: ‘O_RDONLY’ undeclared (first use in
this function)
scripts/basic/fixdep.c:347: warning: incompatible implicit declaration of
built-in function ‘fprintf’
scripts/basic/fixdep.c:347: error: ‘stderr’ undeclared (first use in this
function)
scripts/basic/fixdep.c:349: warning: incompatible implicit declaration of
built-in function ‘exit’
scripts/basic/fixdep.c:353: warning: incompatible implicit declaration of
built-in function ‘fprintf’
scripts/basic/fixdep.c:357: error: ‘PROT_READ’ undeclared (first use in
this function)
scripts/basic/fixdep.c:357: error: ‘MAP_PRIVATE’ undeclared (first use in
this function)
scripts/basic/fixdep.c:357: warning: assignment makes pointer from integer
without a cast
scripts/basic/fixdep.c:364: error: too many arguments to function
‘parse_dep_file’
scripts/basic/fixdep.c:341: warning: unused variable ‘st’
scripts/basic/fixdep.c: In function ‘traps’:
scripts/basic/fixdep.c:376: warning: incompatible implicit declaration of
built-in function ‘fprintf’
scripts/basic/fixdep.c:376: error: ‘stderr’ undeclared (first use in this
function)
scripts/basic/fixdep.c:378: warning: incompatible implicit declaration of
built-in function ‘exit’
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
Shiva:/usr/src/linux-2.6.20.11#

Any ideas?

#13 lore raw

Re: Cross-Compile difficulties

Quoted 1 line · On Tue, 22 May 2007, [email protected] wrote:

scripts/basic/fixdep.c:107:23: error: sys/types.h: No such file or directory

You're missing the basic libraries for native compilation.

| apt-get install libc6-dev

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#14 lore raw

Re: Cross-Compile difficulties

Quoted 11 lines · On Tue, 22 May 2007, [email protected] wrote:
Quoted 2 lines

scripts/basic/fixdep.c:107:23: error: sys/types.h: No such file or directory

You're missing the basic libraries for native compilation.

| apt-get install libc6-dev

Gr{oetje,eeting}s,

Thanks, I feel like a real idiot. Somehow a bunch of development packages (libc6-dev, ncurses5-dev, and a few others) got uninstalled on that machine.

Anyway... I was somewhat able to cross-compile a kernel.

Shiva:/usr/src/linux-2.6.21.1# file vmlinux
vmlinux: ELF 64-bit MSB executable, MIPS, MIPS-IV version 1 (SYSV),
statically linked, not stripped

However, when I rsync it over to my O2, it does not boot. It panics almost immediately, like all other kernels I compiled natively (on the O2) from something other than the Debian sources. This is the full panic as displayed from the PROM:

Status register: 0x34010082<CUI,CU0,FR,DE,IPL=8,KX,MODE=KERNEL> Cause register: 0x8014<CE=0,IP8,EXC=WADE>
Exception PC: 0x801da9fc, Exception RA: 0x8047b0ec Write address error exception, bad address: 0xfffff000 Saved user regs in hex (&gpda 0x81061838, &_regs 0x81061a38):
arg: 81070000 50000 8049f510 2
tmp: 81070000 a800 804b5808 fff804d9 ffffffff 81412ef4 a13fab68 8
sve: 81070000 c064d6ca 0 46136478 0 c02b80ce 0 be4acb69 t8 81070000 0 t9 0 at 0 v0 c04936d8 v1 0 k1 fffff000
gp 81070000 fp0 sp 0 ra 0

Just to make sure I'm not doing something stupid. Here are the command in my kernel build sequence:

make CROSS_COMPILE=mips-linux-gnu- oldconfig
make -j 3 CROSS_COMPILE=mips-linux-gnu- all
make CROSS_COMPILE=mips-linux-gnu- INSTALL_MOD_PATH=~/ modules_install cp vmlinux ~/boot/vmlinux-2.6.21.1
cp System.map ~/boot/System.map-2.6.21.1
cp .config ~/boot/config-2.6.21.1
cd ~/
tar -cf kernel.tar lib boot

CONFIG_CROSSCOMPILE=y in my .config.

I also tried rsyncing the Debian sources over to my Core Duo 2 Debian machine for cross-compiling. I was unable to get past the .config step. Debian's patches must hinder cross-compiling in some manner. For example, make menuconfig seems to refuse to display MIPS as the architecture anymore.

I've been mainly using a working Debian 2.6.18 config (i.e. the one from their package which lets me compile working 2.6.18 from the Debian sources), but the default config (set to IP32, RK5, etc.) panics at boot as well. Not sure if the message is 100% identical, I can double check if anyone thinks that would help.

Thanks again for all the help, it's appreciated.

Geert

Quoted 12 lines

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#15 lore raw

Re: Cross-Compile difficulties

Quoted 9 lines · [email protected] wrote:

make CROSS_COMPILE=mips-linux-gnu- oldconfig
make -j 3 CROSS_COMPILE=mips-linux-gnu- all
make CROSS_COMPILE=mips-linux-gnu- INSTALL_MOD_PATH=~/ modules_install cp vmlinux ~/boot/vmlinux-2.6.21.1
cp System.map ~/boot/System.map-2.6.21.1
cp .config ~/boot/config-2.6.21.1
cd ~/
tar -cf kernel.tar lib boot

Don't know if it makes any difference, but I always specify the architecture on the command line:

make ARCH=mips -j 3 CROSS_COMPILE=mips-linux-gnu all

#16 lore raw

Re: Cross-Compile difficulties

In reply to [email protected]
Quoted 57 lines · [email protected] wrote:
Quoted 10 lines · On Tue, 22 May 2007, [email protected] wrote:
Quoted 2 lines

scripts/basic/fixdep.c:107:23: error: sys/types.h: No such file or directory

You're missing the basic libraries for native compilation.

| apt-get install libc6-dev

Gr{oetje,eeting}s,

Thanks, I feel like a real idiot. Somehow a bunch of development packages (libc6-dev, ncurses5-dev, and a few others) got uninstalled on that machine.

Anyway... I was somewhat able to cross-compile a kernel.

Shiva:/usr/src/linux-2.6.21.1# file vmlinux
vmlinux: ELF 64-bit MSB executable, MIPS, MIPS-IV version 1 (SYSV),
statically linked, not stripped

However, when I rsync it over to my O2, it does not boot. It panics almost immediately, like all other kernels I compiled natively (on the O2) from something other than the Debian sources. This is the full panic as displayed from the PROM:

Status register: 0x34010082<CUI,CU0,FR,DE,IPL=8,KX,MODE=KERNEL> Cause register: 0x8014<CE=0,IP8,EXC=WADE>
Exception PC: 0x801da9fc, Exception RA: 0x8047b0ec Write address error exception, bad address: 0xfffff000 Saved user regs in hex (&gpda 0x81061838, &_regs 0x81061a38):
arg: 81070000 50000 8049f510 2
tmp: 81070000 a800 804b5808 fff804d9 ffffffff 81412ef4 a13fab68 8
sve: 81070000 c064d6ca 0 46136478 0 c02b80ce 0 be4acb69 t8 81070000 0 t9 0 at 0 v0 c04936d8 v1 0 k1 fffff000
gp 81070000 fp0 sp 0 ra 0

Just to make sure I'm not doing something stupid. Here are the command in my kernel build sequence:

make CROSS_COMPILE=mips-linux-gnu- oldconfig
make -j 3 CROSS_COMPILE=mips-linux-gnu- all
make CROSS_COMPILE=mips-linux-gnu- INSTALL_MOD_PATH=~/ modules_install cp vmlinux ~/boot/vmlinux-2.6.21.1
cp System.map ~/boot/System.map-2.6.21.1
cp .config ~/boot/config-2.6.21.1
cd ~/
tar -cf kernel.tar lib boot

CONFIG_CROSSCOMPILE=y in my .config.

I also tried rsyncing the Debian sources over to my Core Duo 2 Debian machine for cross-compiling. I was unable to get past the .config step. Debian's patches must hinder cross-compiling in some manner. For example, make menuconfig seems to refuse to display MIPS as the architecture anymore.

Quoted 8 lines

I've been mainly using a working Debian 2.6.18 config (i.e. the one from their package which lets me compile working 2.6.18 from the Debian sources), but the default config (set to IP32, RK5, etc.) panics at boot as well. Not sure if the message is 100% identical, I can double check if anyone thinks that would help.

Thanks again for all the help, it's appreciated.

One, make sure you're doing "make vmlinux.32", and two, CONFIG_BUILD_ELF64 is _not_ enabled. For 2.6.20, I had to cram in a patch from Frank to get these things to not PROM crash (due to the elimination of CPHYSADDY and replacement by __pa()), but on 2.6.21, this patch was unnecessary. Unsure about 2.6.22-rcX.

O2's will boot a pure 64bit kernel, but my experience is that they are ridiculously slow at it (the console lags severely). vmlinux.32 is the modern method of 64bit-code-in-a-32bit-shell, which the O2's and IP22 systems will swallow much better.

Also, gbefb must be no greater than 4MB memory in menuconfig.

And what's the MHz of your R5000? 300MHz?, if so, it'll be the RM5200, and you'll want "RM52xx" for CPU instead.

--Kumba

Signature · 3 lines
Gentoo/MIPS Team Lead

"Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere."  --Elrond
#24 lore raw
In reply to Ralf Baechle
Quoted 5 lines · Ralf Baechle

On Mon, May 21, 2007 at 04:47:26PM +0100, Ralf Baechle wrote:

Below patch is meant to cure the problem. It's against HEAD but should apply to somewhat older problems as well.

Quoted 7 lines

I appreciate testing asap so I can try to still push this upstream for 2.6.22.

Thanks,

Ralf

Didn't test on 2.6.22 (yet), but 2.6.21.1 works:

# ls -ld /sys/class/net/*{,/device}
drwxr-xr-x 3 root root 0 May 22 18:19 /sys/class/net/eth0/
lrwxrwxrwx 1 root root 0 May 22 18:19 /sys/class/net/eth0/device -> ../../../devices/platform/meth/
drwxr-xr-x 3 root root 0 May 22 18:19 /sys/class/net/lo/

Btw, If we wanted to protect meth from the speculative execution issues of the R10000 processor, what's the right way for that? I believe IP28 used a special type of buffer for protecting Seeq from the DMA wonkiness that occurs, but I got the indication that Meth would need a different approach.

--Kumba

Signature · 3 lines
Gentoo/MIPS Team Lead

"Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere."  --Elrond
#18 lore raw

Re: Cross-Compile difficulties

In reply to [email protected]
Quoted 5 lines · On Tue, 22 May 2007, [email protected] wrote:

I also tried rsyncing the Debian sources over to my Core Duo 2 Debian machine for cross-compiling. I was unable to get past the .config step. Debian's patches must hinder cross-compiling in some manner. For example, make menuconfig seems to refuse to display MIPS as the architecture anymore.

You did add `ARCH=mips' to the make command line?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#25 lore raw
In reply to Kumba
Quoted 1 line · Kumba

Didn't test on 2.6.22 (yet), but 2.6.21.1 works:

That's the only one I care about for purposes of upstream patch submission anyway.

Quoted 4 lines

Btw, If we wanted to protect meth from the speculative execution issues of the R10000 processor, what's the right way for that? I believe IP28 used a special type of buffer for protecting Seeq from the DMA wonkiness that occurs, but I got the indication that Meth would need a different approach.

I don't see why the standard approach would fail for meth.

Ralf

#22 lore raw
In reply to Giuseppe Sacco

Il giorno mar, 22/05/2007 alle 14.13 +0200, Giuseppe Sacco ha scritto:

Quoted 9 lines

Il giorno mar, 22/05/2007 alle 13.41 +0200, Giuseppe Sacco ha scritto:

Quoted 8 lines

Il giorno mar, 22/05/2007 alle 12.09 +0100, Ralf Baechle ha scritto:

Quoted 7 lines · Ralf Baechle

Below patch is meant to cure the problem. It's against HEAD but should apply to somewhat older problems as well.

I appreciate testing asap so I can try to still push this upstream for 2.6.22.

Quoted 7 lines
Quoted 4 lines

[...]

I may test it against 2.6.18, the standard debian kernel for stable; but I will be on the console only in two days :-(

It seems the patch doesn't apply on 2.6.18, so I will recompile 2.6.22-rc2, but I do not know if it works on my SGI. I never tried it.

I got 2.6.21.1 source, then I applied patch-2.6.22-rc2.bz2 and your patch. I compiled everything with this command:

# make-kpkg clean
# time make-kpkg --revision 2:2.6.22~rc2 \
-append-to-version -r5k-ip32 --arch-in-name buildpackage

and got this result:

[...]

  CC [M]  net/ipv6/reassembly.o
  CC [M]  net/ipv6/tcp_ipv6.o
  CC [M]  net/ipv6/exthdrs.o

net/ipv6/exthdrs.c: In function ‘ipv6_rthdr_rcv’:
net/ipv6/exthdrs.c:390: error: ‘struct sk_buff’ has no member named ‘h’ net/ipv6/exthdrs.c:391: error: ‘struct sk_buff’ has no member named ‘h’ net/ipv6/exthdrs.c:391: error: ‘struct sk_buff’ has no member named ‘h’ net/ipv6/exthdrs.c:398: error: ‘struct sk_buff’ has no member named ‘h’ make[4]: *** [net/ipv6/exthdrs.o] Error 1
make[3]: *** [net/ipv6] Error 2
make[2]: *** [net] Error 2
make[2]: Leaving directory `/home/src/linux-2.6.22-rc2' make[1]: *** [debian/stamp-build-kernel] Error 2
make[1]: Leaving directory `/home/src/linux-2.6.22-rc2'
make: *** [stamp-buildpackage] Error 2

real    409m49.142s
user    250m33.296s
sys     15m41.356s
sgi:/usr/local/src/linux-2.6.22-rc2# bc
#17 lore raw

Re: Cross-Compile difficulties

In reply to Kumba
Quoted 72 lines
Quoted 61 lines · [email protected] wrote:
Quoted 10 lines · On Tue, 22 May 2007, [email protected] wrote:
Quoted 2 lines

scripts/basic/fixdep.c:107:23: error: sys/types.h: No such file or directory

You're missing the basic libraries for native compilation.

| apt-get install libc6-dev

Gr{oetje,eeting}s,

Thanks, I feel like a real idiot. Somehow a bunch of development packages
(libc6-dev, ncurses5-dev, and a few others) got uninstalled on that machine.

Anyway... I was somewhat able to cross-compile a kernel.

Shiva:/usr/src/linux-2.6.21.1# file vmlinux
vmlinux: ELF 64-bit MSB executable, MIPS, MIPS-IV version 1 (SYSV),
statically linked, not stripped

However, when I rsync it over to my O2, it does not boot. It panics almost
immediately, like all other kernels I compiled natively (on the O2) from something other than the Debian sources. This is the full panic as displayed from the PROM:

Status register: 0x34010082<CUI,CU0,FR,DE,IPL=8,KX,MODE=KERNEL> Cause register: 0x8014<CE=0,IP8,EXC=WADE>
Exception PC: 0x801da9fc, Exception RA: 0x8047b0ec Write address error exception, bad address: 0xfffff000 Saved user regs in hex (&gpda 0x81061838, &_regs 0x81061a38):
arg: 81070000 50000 8049f510 2
tmp: 81070000 a800 804b5808 fff804d9 ffffffff 81412ef4 a13fab68 8
sve: 81070000 c064d6ca 0 46136478 0 c02b80ce 0 be4acb69 t8 81070000 0 t9 0 at 0 v0 c04936d8 v1 0 k1 fffff000
gp 81070000 fp0 sp 0 ra 0

Just to make sure I'm not doing something stupid. Here are the command in
my kernel build sequence:

make CROSS_COMPILE=mips-linux-gnu- oldconfig
make -j 3 CROSS_COMPILE=mips-linux-gnu- all
make CROSS_COMPILE=mips-linux-gnu- INSTALL_MOD_PATH=~/ modules_install cp vmlinux ~/boot/vmlinux-2.6.21.1
cp System.map ~/boot/System.map-2.6.21.1
cp .config ~/boot/config-2.6.21.1
cd ~/
tar -cf kernel.tar lib boot

CONFIG_CROSSCOMPILE=y in my .config.

I also tried rsyncing the Debian sources over to my Core Duo 2 Debian machine for cross-compiling. I was unable to get past the .config step. Debian's patches must hinder cross-compiling in some manner. For example,
make menuconfig seems to refuse to display MIPS as the architecture anymore.

Quoted 9 lines

I've been mainly using a working Debian 2.6.18 config (i.e. the one from their package which lets me compile working 2.6.18 from the Debian sources), but the default config (set to IP32, RK5, etc.) panics at boot as well. Not sure if the message is 100% identical, I can double check if
anyone thinks that would help.

Thanks again for all the help, it's appreciated.

Quoted 9 lines

One, make sure you're doing "make vmlinux.32", and two, CONFIG_BUILD_ELF64 is
_not_ enabled. For 2.6.20, I had to cram in a patch from Frank to get these
things to not PROM crash (due to the elimination of CPHYSADDY and replacement by
__pa()), but on 2.6.21, this patch was unnecessary. Unsure about 2.6.22-rcX.

I tried the vmlinux.32 I had been generating previously, same response from the PROM.

Didn't see any options something like CONFIG_BUILD_ELF64 in menuconfig (the closest thing was kernel code model which is 64-bit only), so I just manually edited the .config. I think my issue is that Debian's working .config is setting some options contrary to what they need to be for a later kernel or one without Debian's patches. With CONFIG_BUILD_ELF64=n and the Debian .config I got compile errors.

Building from the default make menuconfig, then selecting the appropriate O2 hardware, actually compiled and didn't panic at boot. However, nothing happened after the PROM loaded the kernel. This happens for both the vmlinux and vmlinux.32 kernels produced. The framebuffer (4Mb) didn't start and I couldn't ssh in. This is more or less the same behavior as the 2.6.22-rc test kernel posted.

Anybody have a confirmed working .config for an O2?

Quoted 7 lines

O2's will boot a pure 64bit kernel, but my experience is that they are ridiculously slow at it (the console lags severely). vmlinux.32 is the modern
method of 64bit-code-in-a-32bit-shell, which the O2's and IP22 systems will
swallow much better.

Quoted 6 lines

Also, gbefb must be no greater than 4MB memory in menuconfig.

And what's the MHz of your R5000? 300MHz?, if so, it'll be the RM5200, and
you'll want "RM52xx" for CPU instead.

Its 300 Mhz, but I'm not actually sure as to whether its an R5000 or R5200. hinv and dmesg show it as R5000, though apparently this is normal hinv behavior for the R5200. If I switched R5000 to R5200 in the Debian sources, the resulting kernel won't boot. Is it possible that my compiling woes might be from the necessity to compile for R5200? Or should it be backwards compatible, so I only miss out on optimizations.

Quoted 12 lines

--Kumba

--
Gentoo/MIPS Team Lead

"Such is oft the course of deeds that move the wheels of the world: small hands
do them because they must, while the eyes of the great are elsewhere." --Elrond

#23 lore raw
In reply to Giuseppe Sacco
Quoted 26 lines · Giuseppe Sacco

I got 2.6.21.1 source, then I applied patch-2.6.22-rc2.bz2 and your patch. I compiled everything with this command:

# make-kpkg clean
# time make-kpkg --revision 2:2.6.22~rc2 \
-append-to-version -r5k-ip32 --arch-in-name buildpackage

and got this result:

[...]

  CC [M]  net/ipv6/reassembly.o
  CC [M]  net/ipv6/tcp_ipv6.o
  CC [M]  net/ipv6/exthdrs.o

net/ipv6/exthdrs.c: In function ‘ipv6_rthdr_rcv’:
net/ipv6/exthdrs.c:390: error: ‘struct sk_buff’ has no member named ‘h’ net/ipv6/exthdrs.c:391: error: ‘struct sk_buff’ has no member named ‘h’ net/ipv6/exthdrs.c:391: error: ‘struct sk_buff’ has no member named ‘h’ net/ipv6/exthdrs.c:398: error: ‘struct sk_buff’ has no member named ‘h’ make[4]: *** [net/ipv6/exthdrs.o] Error 1
make[3]: *** [net/ipv6] Error 2
make[2]: *** [net] Error 2
make[2]: Leaving directory `/home/src/linux-2.6.22-rc2' make[1]: *** [debian/stamp-build-kernel] Error 2
make[1]: Leaving directory `/home/src/linux-2.6.22-rc2'
make: *** [stamp-buildpackage] Error 2

Quoted 4 lines
real    409m49.142s
user    250m33.296s
sys     15m41.356s
sgi:/usr/local/src/linux-2.6.22-rc2# bc

Unrelated problem. If you can reproduce it with a vanilla kernel report to [email protected].

Ralf

Ralf