Skip to content

Commit a6da83f

Browse files
committed
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fix from Ben Herrenschmidt: "Here's one regression fix for 3.13 that I would appreciate if you could still pull in. It was an "interesting" one to debug, basically it's an old bug that got somewhat "exposed" by new code breaking the boot on PA Semi boards (yes, it does appear that some people are still using these!)" * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc: Check return value of instance-to-package OF call
2 parents 061f49e + 10348f5 commit a6da83f

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

arch/powerpc/kernel/prom_init.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,19 +1986,23 @@ static void __init prom_init_stdout(void)
19861986
/* Get the full OF pathname of the stdout device */
19871987
memset(path, 0, 256);
19881988
call_prom("instance-to-path", 3, 1, prom.stdout, path, 255);
1989-
stdout_node = call_prom("instance-to-package", 1, 1, prom.stdout);
1990-
val = cpu_to_be32(stdout_node);
1991-
prom_setprop(prom.chosen, "/chosen", "linux,stdout-package",
1992-
&val, sizeof(val));
19931989
prom_printf("OF stdout device is: %s\n", of_stdout_device);
19941990
prom_setprop(prom.chosen, "/chosen", "linux,stdout-path",
19951991
path, strlen(path) + 1);
19961992

1997-
/* If it's a display, note it */
1998-
memset(type, 0, sizeof(type));
1999-
prom_getprop(stdout_node, "device_type", type, sizeof(type));
2000-
if (strcmp(type, "display") == 0)
2001-
prom_setprop(stdout_node, path, "linux,boot-display", NULL, 0);
1993+
/* instance-to-package fails on PA-Semi */
1994+
stdout_node = call_prom("instance-to-package", 1, 1, prom.stdout);
1995+
if (stdout_node != PROM_ERROR) {
1996+
val = cpu_to_be32(stdout_node);
1997+
prom_setprop(prom.chosen, "/chosen", "linux,stdout-package",
1998+
&val, sizeof(val));
1999+
2000+
/* If it's a display, note it */
2001+
memset(type, 0, sizeof(type));
2002+
prom_getprop(stdout_node, "device_type", type, sizeof(type));
2003+
if (strcmp(type, "display") == 0)
2004+
prom_setprop(stdout_node, path, "linux,boot-display", NULL, 0);
2005+
}
20022006
}
20032007

20042008
static int __init prom_find_machine_type(void)

0 commit comments

Comments
 (0)