From owner-svn-src-head@freebsd.org Tue Nov 28 06:31:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7766BDFB6A3; Tue, 28 Nov 2017 06:31:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4222C78813; Tue, 28 Nov 2017 06:31:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAS6Vdat012328; Tue, 28 Nov 2017 06:31:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAS6VdkV012326; Tue, 28 Nov 2017 06:31:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711280631.vAS6VdkV012326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 28 Nov 2017 06:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326310 - in head/sys: dev/ofw powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys: dev/ofw powerpc/ofw X-SVN-Commit-Revision: 326310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2017 06:31:40 -0000 Author: nwhitehorn Date: Tue Nov 28 06:31:39 2017 New Revision: 326310 URL: https://svnweb.freebsd.org/changeset/base/326310 Log: 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: head/sys/dev/ofw/openfirm.c head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Nov 28 06:21:37 2017 (r326309) +++ head/sys/dev/ofw/openfirm.c Tue Nov 28 06:31:39 2017 (r326310) @@ -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: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Tue Nov 28 06:21:37 2017 (r326309) +++ head/sys/powerpc/ofw/ofw_machdep.c Tue Nov 28 06:31:39 2017 (r326310) @@ -393,6 +393,7 @@ boolean_t OF_bootstrap() { boolean_t status = FALSE; + int err = 0; #ifdef AIM if (openfirmware_entry != NULL) { @@ -409,7 +410,7 @@ OF_bootstrap() if (status != TRUE) return status; - OF_init(openfirmware); + err = OF_init(openfirmware); } else #endif if (fdt != NULL) { @@ -418,9 +419,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); }