svn commit: r327665 - head/sys/dev/extres/syscon
Emmanuel Vadot
manu at bidouilliste.com
Sun Jan 7 09:55:48 UTC 2018
On 2018-01-07 03:19, Kyle Evans wrote:
> 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.
> + */
I think that the comment should be more generic, syscon_generic will
only be match for the "syscon" compatible, if a driver needs to attach
at a specific pass, it should be subclassed and use the other compatible
in the node. All the syscon node I've seen always have a specific
compatible and a fallback to "syscon".
> 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);
--
Emmanuel Vadot <manu at bidouilliste.com> <manu at freebsd.org>
More information about the svn-src-head
mailing list