Date: Wed, 14 Mar 2018 03:45:33 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330904 - in stable/11/sys: dev/ofw powerpc/ofw Message-ID: <201803140345.w2E3jXK1051429@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Wed Mar 14 03:45:33 2018 New Revision: 330904 URL: https://svnweb.freebsd.org/changeset/base/330904 Log: MFC r326310: Back out OF module installation in the event of failure. PS3 firmware gives some ancient FDT version (2) that fails the init check in OFW_FDT. It is still possible to make progress, but not while the OF layer is going crazy. Modified: stable/11/sys/dev/ofw/openfirm.c stable/11/sys/powerpc/ofw/ofw_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ofw/openfirm.c ============================================================================== --- stable/11/sys/dev/ofw/openfirm.c Wed Mar 14 03:43:49 2018 (r330903) +++ stable/11/sys/dev/ofw/openfirm.c Wed Mar 14 03:45:33 2018 (r330904) @@ -201,6 +201,12 @@ OF_install(char *name, int prio) ofw_def_t *ofwp, **ofwpp; static int curr_prio = 0; + /* Allow OF layer to be uninstalled */ + if (name == NULL) { + ofw_def_impl = NULL; + return (FALSE); + } + /* * Try and locate the OFW kobj corresponding to the name. */ Modified: stable/11/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- stable/11/sys/powerpc/ofw/ofw_machdep.c Wed Mar 14 03:43:49 2018 (r330903) +++ stable/11/sys/powerpc/ofw/ofw_machdep.c Wed Mar 14 03:45:33 2018 (r330904) @@ -389,6 +389,7 @@ boolean_t OF_bootstrap() { boolean_t status = FALSE; + int err = 0; #ifdef AIM if (openfirmware_entry != NULL) { @@ -405,7 +406,7 @@ OF_bootstrap() if (status != TRUE) return status; - OF_init(openfirmware); + err = OF_init(openfirmware); } else #endif if (fdt != NULL) { @@ -414,9 +415,15 @@ OF_bootstrap() if (status != TRUE) return status; - OF_init(fdt); - OF_interpret("perform-fixup", 0); + err = OF_init(fdt); + if (err == 0) + OF_interpret("perform-fixup", 0); } + + if (err != 0) { + OF_install(NULL, 0); + status = FALSE; + } return (status); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803140345.w2E3jXK1051429>