From owner-dev-commits-src-all@freebsd.org Wed Aug 4 18:18:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E21F653305; Wed, 4 Aug 2021 18:18:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg0NH2W9mz4gwY; Wed, 4 Aug 2021 18:18:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5F6AA27660; Wed, 4 Aug 2021 18:18:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Marcin Wojtas , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108031008.173A83HA096670@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: 5ad6d28cbe6b - main - enetc: Support building the driver as a loadable module. Message-ID: Date: Wed, 4 Aug 2021 11:18:02 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <202108031008.173A83HA096670@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:18:07 -0000 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=5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df > > commit 5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df > Author: Kornel Duleba > AuthorDate: 2021-07-28 09:23:23 +0000 > Commit: Marcin Wojtas > 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 = { > }; > > static devclass_t enetc_devclass; > -DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); > DRIVER_MODULE(miibus, enetc, miibus_driver, miibus_devclass, NULL, NULL); > +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_LAST)' for enetc so that the miibus driver is registered first. -- John Baldwin