Date: Sun, 8 Aug 2021 20:27:44 GMT From: Marcin Wojtas <mw@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 4b64193bed12 - main - enetc: Force correct order with DRIVER_MODULE_ORDERED Message-ID: <202108082027.178KRiZq075010@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=4b64193bed12f604c1aba348472c98f7f8e64316 commit 4b64193bed12f604c1aba348472c98f7f8e64316 Author: Kornel Duleba <mindal@semihalf.com> AuthorDate: 2021-08-05 12:09:08 +0000 Commit: Marcin Wojtas <mw@FreeBSD.org> CommitDate: 2021-08-08 20:27:15 +0000 enetc: Force correct order with DRIVER_MODULE_ORDERED The toolchain can reorder symbols, meaning that changing the order of DRIVER_MODULE macros is not enough to ensure that miibus gets registered first. Use DRIVER_MODULE_ORDERED instead to fix the problem properly. Fixes: 5ad6d28cbe6b ("enetc: Support building the driver as a loadable module.") Reported by: jhb --- sys/dev/enetc/if_enetc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c index 46327eb419bf..2a72f807acd7 100644 --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -159,7 +159,9 @@ static driver_t enetc_driver = { static devclass_t enetc_devclass; DRIVER_MODULE(miibus, enetc, miibus_driver, miibus_devclass, NULL, NULL); -DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); +/* Make sure miibus gets procesed first. */ +DRIVER_MODULE_ORDERED(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL, + SI_ORDER_ANY); MODULE_VERSION(enetc, 1); IFLIB_PNP_INFO(pci, enetc, enetc_vendor_info_array);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108082027.178KRiZq075010>