From owner-svn-src-head@freebsd.org Tue Jun 12 20:03:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2484210188A7; Tue, 12 Jun 2018 20:03:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB3FF77367; Tue, 12 Jun 2018 20:03:00 +0000 (UTC) (envelope-from manu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC06E755F; Tue, 12 Jun 2018 20:03:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CK30IM001654; Tue, 12 Jun 2018 20:03:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CK30Lx001653; Tue, 12 Jun 2018 20:03:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806122003.w5CK30Lx001653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 12 Jun 2018 20:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335014 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 335014 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.26 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, 12 Jun 2018 20:03:01 -0000 Author: manu Date: Tue Jun 12 20:03:00 2018 New Revision: 335014 URL: https://svnweb.freebsd.org/changeset/base/335014 Log: simplebus pnp: Do not generate pnp info is the bus status is not okay Generating the pnp info have the side effect to include all nodes even if the status isn't "okay". That means that loading the module will load but not attach as it checks the status in the probe function. On pine64 before : root@pine64-lts:~ # devmatch -u unattached on ofwbus pnpinfo name=memory unattached on ofwbus pnpinfo name=chosen unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit unattached on simplebus pnpinfo name=dma-controller@1c02000 compat=allwinner,sun50i-a64-dma unattached on simplebus pnpinfo name=mmc@1c10000 compat=allwinner,sun50i-a64-mmc unattached on simplebus pnpinfo name=usb@1c19000 compat=allwinner,sun8i-a33-musb unattached on simplebus pnpinfo name=spdif@1c21000 compat=allwinner,sun50i-a64-spdif unattached on simplebus pnpinfo name=i2s@1c22000 compat=allwinner,sun50i-a64-i2s unattached on simplebus pnpinfo name=i2s@1c22400 compat=allwinner,sun50i-a64-i2s unattached on simplebus pnpinfo name=serial@1c28400 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c28800 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c28c00 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c29000 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=i2c@1c2ac00 compat=allwinner,sun6i-a31-i2c unattached on simplebus pnpinfo name=i2c@1c2b000 compat=allwinner,sun6i-a31-i2c unattached on simplebus pnpinfo name=i2c@1c2b400 compat=allwinner,sun6i-a31-i2c unattached on ofwbus pnpinfo name=aliases unattached on ofwbus pnpinfo name=symbols All simplebus node are disabled After : root@pine64-lts:~ # devmatch -u unattached on ofwbus pnpinfo name=memory unattached on ofwbus pnpinfo name=chosen unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit unattached on simplebus pnpinfo name=dma-controller@1c02000 compat=allwinner,sun50i-a64-dma unattached on simplebus pnpinfo name=usb@1c19000 compat=allwinner,sun8i-a33-musb unattached on ofwbus pnpinfo name=aliases unattached on ofwbus pnpinfo name=symbols Reviewed by: imp (with some objection) Differential Revision: https://reviews.freebsd.org/D15770 Modified: head/sys/dev/ofw/ofw_bus_subr.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Tue Jun 12 19:50:33 2018 (r335013) +++ head/sys/dev/ofw/ofw_bus_subr.c Tue Jun 12 20:03:00 2018 (r335014) @@ -91,6 +91,9 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t { *buf = '\0'; + if (!ofw_bus_status_okay(child)) + return (0); + if (ofw_bus_get_name(child) != NULL) { strlcat(buf, "name=", buflen); strlcat(buf, ofw_bus_get_name(child), buflen); @@ -100,6 +103,7 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t strlcat(buf, " compat=", buflen); strlcat(buf, ofw_bus_get_compat(child), buflen); } + return (0); };