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);
 };
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to