svn commit: r327665 - head/sys/dev/extres/syscon

Kyle Evans kevans at FreeBSD.org
Sun Jan 7 02:19:55 UTC 2018


Author: kevans
Date: Sun Jan  7 02:19:54 2018
New Revision: 327665
URL: https://svnweb.freebsd.org/changeset/base/327665

Log:
  Fix bogus pass for syscon_generic introduced in r327621
  
  ian@ pointed out that BUS_PASS_DEFAULT + $anything is bogus, given that
  BUS_PASS_DEFAULT is defined as __INT_MAX. Instead, we take a page out of
  imx6_usbphy's book and use BUS_PASS_DEFAULT - 1000 to achieve the desired
  effect of syscon_generic attaching before if_awg and other potential
  consumers, but late enough that more specialized implementations should have
  no problem attaching instead.
  
  Reported by:	ian

Modified:
  head/sys/dev/extres/syscon/syscon_generic.c

Modified: head/sys/dev/extres/syscon/syscon_generic.c
==============================================================================
--- head/sys/dev/extres/syscon/syscon_generic.c	Sun Jan  7 01:08:10 2018	(r327664)
+++ head/sys/dev/extres/syscon/syscon_generic.c	Sun Jan  7 02:19:54 2018	(r327665)
@@ -206,6 +206,11 @@ static device_method_t syscon_generic_dmethods[] = {
 DEFINE_CLASS_0(syscon_generic, syscon_generic_driver, syscon_generic_dmethods,
     sizeof(struct syscon_generic_softc));
 static devclass_t syscon_generic_devclass;
+/*
+ * syscon_generic needs to attach before other devices that may require it, such
+ * as if_awg, but later than others to give way for more specialized syscon
+ * implementations.
+ */
 EARLY_DRIVER_MODULE(syscon_generic, simplebus, syscon_generic_driver,
-    syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT + BUS_PASS_ORDER_FIRST);
+    syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT - 1000);
 MODULE_VERSION(syscon_generic, 1);


More information about the svn-src-all mailing list