Date: Sun, 8 Aug 2021 09:17:30 +0200 From: Marcin Wojtas <mw@semihalf.com> To: John Baldwin <jhb@freebsd.org> Cc: Marcin Wojtas <mw@freebsd.org>, src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5ad6d28cbe6b - main - enetc: Support building the driver as a loadable module. Message-ID: <CAPv3WKfosqfBg9zjKvKvobXWCZexdaWqc=xAx=XvqreZqQ=3-g@mail.gmail.com> In-Reply-To: <f6e8065a-47fb-f055-1d14-f65fc739c09d@FreeBSD.org> References: <202108031008.173A83HA096670@gitrepo.freebsd.org> <f6e8065a-47fb-f055-1d14-f65fc739c09d@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
=C5=9Br., 4 sie 2021 o 20:18 John Baldwin <jhb@freebsd.org> napisa=C5=82(a)= : > > On 8/3/21 3:08 AM, Marcin Wojtas wrote: > > The branch main has been updated by mw: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5ad6d28cbe6b3ff85e49607a= 7e04cb68db3ed6df > > > > commit 5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df > > Author: Kornel Duleba <mindal@semihalf.com> > > AuthorDate: 2021-07-28 09:23:23 +0000 > > Commit: Marcin Wojtas <mw@FreeBSD.org> > > CommitDate: 2021-08-03 10:07:49 +0000 > > > > enetc: Support building the driver as a loadable module. > > > > Function level reset has to be done in attach in order to put the > > hardware in a known state before configuring it. > > The order of DRIVER_MODULEs was changed to ensure that the miibus = driver > > is loaded when mii_attach is called. > > > > Obtained from: Semihalf > > Sponsored by: Alstom Group > > --- > > sys/dev/enetc/if_enetc.c | 6 +++++- > > sys/modules/Makefile | 2 ++ > > sys/modules/enetc/Makefile | 8 ++++++++ > > 3 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c > > index 54cdc6ea9ad4..46327eb419bf 100644 > > --- a/sys/dev/enetc/if_enetc.c > > +++ b/sys/dev/enetc/if_enetc.c > > @@ -158,8 +158,8 @@ static driver_t enetc_driver =3D { > > }; > > > > static devclass_t enetc_devclass; > > -DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); > > DRIVER_MODULE(miibus, enetc, miibus_driver, miibus_devclass, NULL, NU= LL); > > +DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); > > MODULE_VERSION(enetc, 1); > > This is not the right way to fix this as the toolchain is free to reorder > symbols. You should instead use 'DRIVER_MODULE_ORDERED(..., SI_ORDER_LAS= T)' > for enetc so that the miibus driver is registered first. > Thank you for the remark - I will submit a fix for that. Best regards, Marcin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPv3WKfosqfBg9zjKvKvobXWCZexdaWqc=xAx=XvqreZqQ=3-g>