aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ofw
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2018-06-12 20:03:00 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2018-06-12 20:03:00 +0000
commit25f0326aea0294b8793778fcbb0342dab3a099eb (patch)
tree11ff4e58ba1e2a14803d00e3a0bd5f9b9f5b6831 /sys/dev/ofw
parent5ecc8c20771da197dec4f868fb021691226b0d58 (diff)
downloadsrc-25f0326aea0294b8793778fcbb0342dab3a099eb.tar.gz
src-25f0326aea0294b8793778fcbb0342dab3a099eb.zip
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
Notes
Notes: svn path=/head/; revision=335014
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r--sys/dev/ofw/ofw_bus_subr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index 9908a3f84ccc..fda4a94e02f5 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -91,6 +91,9 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t child, char *buf,
{
*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 child, char *buf,
strlcat(buf, " compat=", buflen);
strlcat(buf, ofw_bus_get_compat(child), buflen);
}
+
return (0);
};