From owner-freebsd-current@freebsd.org Sat Dec 26 16:37:24 2020 Return-Path: Delivered-To: freebsd-current@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 3C8B44BD1FB; Sat, 26 Dec 2020 16:37:24 +0000 (UTC) (envelope-from ali.abdallah@suse.com) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.suse.de", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D38c24GHzz4RMv; Sat, 26 Dec 2020 16:37:22 +0000 (UTC) (envelope-from ali.abdallah@suse.com) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 32CE6ADE2; Sat, 26 Dec 2020 16:37:21 +0000 (UTC) Date: Sat, 26 Dec 2020 17:37:20 +0100 From: Ali Abdallah To: freebsd-stable@freebsd.org Cc: freebsd-current@freebsd.org Subject: MII media status race condition causing fictitious link down Message-ID: <20201226163720.zok6km7b7hyze56f@frix230> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: 4D38c24GHzz4RMv X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.19 / 15.00]; MID_RHS_NOT_FQDN(0.50)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[suse.com:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.135.220.15]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[195.135.220.15:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_TRACE(0.00)[suse.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[suse.com,quarantine]; RCVD_IN_DNSWL_MED(-0.20)[195.135.220.15:from]; NEURAL_HAM_SHORT(-0.99)[-0.989]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:29298, ipnet:195.135.220.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-current,freebsd-stable] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 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: Sat, 26 Dec 2020 16:37:24 -0000 Hello, As I've sent a couple of patches to add support for Thinkpad USB-C gen2 to if_ure(4), I came across a very strange link random state change, causing dhclient to think the link went effectively down, which is not the case. First I thought that if_ure(4) doesn't play well with the new chip of the dock, but after lot of debugging, it turns out to be a nasty race condition in mii bus code [1]. I'm sending this mail to raise awareness about this issue. Apparently it exists since long time (I even remember having had this issue in the past on my older Thinkpad). [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252165 Regards, -- Ali Abdallah | SUSE L3 Engineer GPG fingerprint: 51A0 F4A0 C8CF C98F 842E A9A8 B945 56F8 1C85 D0D5