[PATCH] [2.6.16] powerpc: Fix OOPS in lparcfg on G5
Olof Johansson
olof at lixom.net
Thu Feb 16 02:02:09 EST 2006
Hi,
Bugfix, so please consider for 2.6.16:
Hit the following with LTP with a ppc64_defconfig kernel on a G5:
Unable to handle kernel paging request for data at address 0x00000030
Faulting instruction address: 0xc00000000001f6d0
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=32 POWERMAC
Modules linked in:
NIP: C00000000001F6D0 LR: C00000000001F6CC CTR: 0000000000000000
REGS: c000000054853790 TRAP: 0300 Not tainted (2.6.16-rc3-mm1)
MSR: 9000000000009032 <EE,ME,IR,DR> CR: 24000444 XER: 00000000
DAR: 0000000000000030, DSISR: 0000000040000000
TASK = c00000005fb65810[4820] 'proc01' THREAD: c000000054850000 CPU: 1
GPR00: C00000000001F6CC C000000054853A10 C00000000079FBB0 C0000000007A32E8
GPR04: C0000000004AE220 0000000000000000 0000000000000020 0000000000000000
GPR08: C000000000610178 0000000000000072 C00000005FFFEE62 0000000000000092
GPR12: 0000000000000002 C0000000005BA100 00000000100D0000 0000000010116C88
GPR16: 00000000100D0000 00000000FFFF9008 0000000000000000 0000000000000000
GPR20: 000000001001B5D8 000000000FF58224 C000000054853E08 C00000000F44A330
GPR24: C00000005E47B700 0000000010016FB4 0000000000000000 C00000000F44A300
GPR28: 0000000000000000 0000000000000000 C0000000004AE220 0000000000000000
NIP [C00000000001F6D0] .of_find_property+0x30/0xa8
LR [C00000000001F6CC] .of_find_property+0x2c/0xa8
Call Trace:
[C000000054853A10] [C00000000001F6CC] .of_find_property+0x2c/0xa8 (unreliable)
[C000000054853AA0] [C00000000001F758] .get_property+0x10/0x34
[C000000054853B10] [C00000000001D3C8] .lparcfg_data+0x11c/0x6c8
[C000000054853C20] [C0000000000DC78C] .seq_read+0x198/0x418
[C000000054853CF0] [C0000000000B2634] .vfs_read+0xd0/0x1b0
[C000000054853D90] [C0000000000B32FC] .sys_read+0x4c/0x8c
[C000000054853E30] [C0000000000086F8] syscall_exit+0x0/0x40
It happens since the lookup of the /rtas device node is never checked for
success and just passed into get_property.
It doesn't make sense to create the lparcfg proc entry on non-LPAR
systems at all. On LPAR systems, there will always be an RTAS so the
lookup will always succeed.
Signed-off-by: Olof Johansson <olof at lixom.net>
Index: linux/arch/powerpc/kernel/lparcfg.c
===================================================================
--- linux.orig/arch/powerpc/kernel/lparcfg.c
+++ linux/arch/powerpc/kernel/lparcfg.c
@@ -565,6 +565,9 @@ int __init lparcfg_init(void)
struct proc_dir_entry *ent;
mode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
+ if (!platform_is_lpar())
+ return 0;
+
/* Allow writing if we have FW_FEATURE_SPLPAR */
if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
lparcfg_fops.write = lparcfg_write;
More information about the Linuxppc64-dev
mailing list