From owner-dev-commits-src-main@freebsd.org Sun Aug 8 07:17:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2B0B665111C for ; Sun, 8 Aug 2021 07:17:42 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gj9XP0t5Jz3mt5 for ; Sun, 8 Aug 2021 07:17:41 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-qk1-x72b.google.com with SMTP id t66so14958640qkb.0 for ; Sun, 08 Aug 2021 00:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=K5BjvU0YYByF4fQPqKPaL+V6x37LVgrwi04mXqRd4Ao=; b=HRLoqW0oEM728pmgCDVYDxRbrsvJfkJKUgIrrfmcdLWdgPnR3s0Dva1vOoq3TdKSGm KByooceui46udZ8t18U8T4N69cZ4I0L0I8PLD3Nc3zzOsyXe7z99omxrkclfC3grSWoa yQGddqXJJXr4mWMlU95jGgRrXmQe3vY10lEatjKSpV/6ic7XfTIsPPI82L/JBgN7tbso g5CRh1C0ouiFKUgP1K8hz77I0Zfcdjm3uUQ3lsaMyUds9xZIEhSrxORIkA+sz85Nowmu OKHPl2TiyXpSRM8PT0cHeJSn9i2BrgHiErw8mAdiZ2o+Tkz1UoGtMgnN3G5RBIQMzO2J +UKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=K5BjvU0YYByF4fQPqKPaL+V6x37LVgrwi04mXqRd4Ao=; b=lNMtvFtInNxeLrLB/4B7HxQN3xFEDcHroOtvHffUfVm24Npp/d2DCvIOAPR/uhmLuQ CzcAOUZinB/ayyklmN29r5+6arc7UU3VEyKDiVfO4l3cVAys7zJ4YMckTRNQWNk7gVZb XTcEBYhPL/pwROEptUD4OP21uDXchZU2+50p7Ks1xY1IyjwoIFZFVWj6gYvCNcYR0Vch wTn+x87mhatNDMCyekJ08HLe/qSsNvjnlhNj11UyiLYhnNccOrB+nVCh6WsyHrU1AbyG tNHWEbmpm/BtTmyTeruWCXm6v3+vFOUJK8BZt8egqTk/mdooNZ03mtzcC57e95wL3OiV cOwQ== X-Gm-Message-State: AOAM532hF+g3gJtuL3HI9+qH0WteMShp1Reuv0r6q4OrWLTXssmUJv3n 6489DvmANSsYKA3e6g6FwR8NZxw35T0T3aY+7bCXGA== X-Google-Smtp-Source: ABdhPJxr00GaJ+QRRiXFUCo0UnU9KlX36UwaP+e1XDA3QBfaE+qaV94aMnIfsx7tZXn8HG15c1Bi10gDBrzQJ8IFaqg= X-Received: by 2002:a05:620a:12af:: with SMTP id x15mr10793769qki.300.1628407060679; Sun, 08 Aug 2021 00:17:40 -0700 (PDT) MIME-Version: 1.0 References: <202108031008.173A83HA096670@gitrepo.freebsd.org> In-Reply-To: From: Marcin Wojtas Date: Sun, 8 Aug 2021 09:17:30 +0200 Message-ID: Subject: Re: git: 5ad6d28cbe6b - main - enetc: Support building the driver as a loadable module. To: John Baldwin Cc: Marcin Wojtas , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Gj9XP0t5Jz3mt5 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=HRLoqW0o; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2607:f8b0:4864:20::72b) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[semihalf-com.20150623.gappssmtp.com:s=20150623]; FREEFALL_USER(0.00)[mw]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72b:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 07:17:42 -0000 =C5=9Br., 4 sie 2021 o 20:18 John Baldwin 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 > > 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 =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