From owner-freebsd-current@freebsd.org Tue Nov 20 04:38:40 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13489113DE26 for ; Tue, 20 Nov 2018 04:38:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x144.google.com (mail-it1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C40DA795B8 for ; Tue, 20 Nov 2018 04:38:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x144.google.com with SMTP id a205-v6so1521495itd.4 for ; Mon, 19 Nov 2018 20:38:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5nimj0+CzVFdbJeiV68dVrGvRVlsN5+cCQYPFrkPnek=; b=0rY313dbRkIE5yb16+1DW3t4qa/hoGmjcgEA5eBwFUwSwnClHL+LAB962XsVw4/ymb wOWiOxPLCXrfmEvmRp6tDYAI+uiue5A0rj8Lgdkhg+M+0kkwVJsOMC1rbMf8AAVqfGEd B0sU3U9FxS7dqSKTmrk8VVAzrWcluym+z6Wq1Kkqszhl62Fz6GUFmjzD3MCHmW9+lCnP gVCqPakKsBzX9utTT5qzVfhf9u6Ycee8+uNCrpMp2Mk8sd7SZwZvoIjjbB6lM4OMzwdP 2VSnIjmrSMXyFiXzYFoVHe04LcYc0fgaMY/vSPEngRkyyvpvrjPN9NdcyEsKsLQ4gXJM oWuA== 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; bh=5nimj0+CzVFdbJeiV68dVrGvRVlsN5+cCQYPFrkPnek=; b=taHdEQsaG7Izo3Ah2pRl1VnPwJZUVJlDn2lLWfJJJElOG+L2s/mRIx4ZaJu4kJv9ZG 54FgfHx5PlhYX8fpIIeA7gy/KTMgwBfxKfz+t5LrY9vXTY8WmJJvhdDD+NUEaQrsXIxu m8hi4DWFh4+TAJxThEnM6bdaGrpSWz/xuicXt4WcztEMPTh98EosZRCYL06LaEJKIBAw 7n1kwMYwqe/FOFWBOy6DtMxX7i3YSsZpOLAo3AdBsmg8y6Ye2yBIzf0akZQcMGlYKr/G rqTNbQPBGdhVOSNt1AtREDgcK70w9svSP5L1EeZ6mAL7ayYTiJTnSuSwOqsv/DgeQhoU Dd6A== X-Gm-Message-State: AGRZ1gKuWAAf0IC9Z4wLbfE+aa4cJpYF9Kwl9geJkiLKe8oj24af7O0r 5HUHVTC60xJSTpVqK8lYG4omnIWtmTCcUqZlEMQjiP/7 X-Google-Smtp-Source: AJdET5clrE+iWLKCcLVupx9jZ4Fy7Sao+aIsG6oeT6cWeHTb1p6zt+Vu/SquhbruqMJv1xns7iUPWCDfMb3AVA8v3vw= X-Received: by 2002:a24:3796:: with SMTP id r144-v6mr836129itr.79.1542688717749; Mon, 19 Nov 2018 20:38:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Mon, 19 Nov 2018 21:38:26 -0700 Message-ID: Subject: Re: Devd / devmatch(8) -- netif race 12-RC1 To: dan_partelly Cc: FreeBSD Current X-Rspamd-Queue-Id: C40DA795B8 X-Spamd-Result: default: False [-2.28 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.922,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.87)[-0.865,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.04)[-0.041,0]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.44)[ip: (1.97), ipnet: 2607:f8b0::/32(-2.45), asn: 15169(-1.65), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 04:38:40 -0000 On Mon, Nov 19, 2018 at 7:48 PM Dan Partelly wrote: > Hello, > > Today I tried a simple wireless failover on a machine running free-bsd. > After reboot the system cannot complete the initialization sequence OK wi= th > devmatcher. > The devd/devmatch(8) combo correctly identified the wireless card and > loaded required drivers and firmware. rcorder(8) reports that devd(8) ru= ns > after netif. As far as I gather, devd (8) runs devmatch(8) on nomatch cla= ss > events. This results in the situation in which the interfaces are created > before =E2=80=9Cplug and play=E2=80=9D initialization of the wireless dev= ice is complete > (no driver no firmware yet ) , wlan0 creation is impossible and so on and > so forth. > No, that's not what's happening. wlan0 isn't racing anything, because it's no longer listed in ifconfig. > More so, I believe the runs of devmatch(8) are async in this scenario, so > even if you moved devd(8) before netif service, this would not solve the > issue, there will be race conditions. I know this can be solved by loadi= ng > the drivers manually, but still rising some issue is in order: > Network configuration happens asynchronously. devmatch gets run in response to NOMATCH events which then causes the driver to load which then causes the pccard_ether script to run which causes the device to be configured. At least that's how it's supposed to work. > 1) Why does devd(8) service runs after netif ? I believe it should run > before netif service, probably after kld service. Is there anything which > prevents changing this order ? > Because it doesn't matter? And because if devd is run too eary, too few services are available. Getting the ordering right was... a somewhat tricky and frustrating experience when I first committed devd. > 2.) In the scenario in which devd(8) is started before netif, what can be > done to ensure that a barier exists such that an arbitrary devmatch(8) ru= n > is guaranteed to finish loading required drivers before netif ? Ignore th= is > if Im wrong about asyc nature of devmatch(8) run. > Nothing. No such barrier is necessary. It should all happen asynchronously. Maybe there's a config problem? > 3 In what state is devmatcher now ? A lot of modules seems to be loaded > ok, but some do not yet. coretemp(4) hwpmc(4) , intel serie 9 smbus drive= r > seems not. > All of USB is done, part of PCI is done, all of the really old PC Card (since it was easy), parts of FDT for embedded and parts of ACPI are done. The drivers you've called out I think are PCI drivers that haven't been updated. They should all be in GENERIC, but none are in MINIMAL or perhaps a custom kernel. coretemp is a CPU device, and so I'm not sure we have the right PNP information for the CPU bus for it to even load. Warner