Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3170450imu; Fri, 23 Nov 2018 23:13:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/XAUssFaKcbFn4iBNnm8NQoC75G8Ib/+Cu3gWl9mIiZ0ii5vs3wxXn8y156eZ8xu+iYBWBx X-Received: by 2002:a62:69c4:: with SMTP id e187mr12620611pfc.50.1543043636783; Fri, 23 Nov 2018 23:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543043636; cv=none; d=google.com; s=arc-20160816; b=LK9IhPjVU2VKyc0y68wQIqaSJ9Bi29XNBBpXI7DOEYD3WWuy4Z5VU9nBpi4icJMhwJ y/4OYYYYK4oCyrZDlGi3xeKyWyW8uLcWTI6zg0HMIA4BQcU3fgdNZGlkb98YFxrx8DI7 iQkKjqk0gECBx/2hEc2JTmdb5a41T5Nl+mNCWicMdzVNpoiMzKLr5qr8JSPT182mWqPZ HdJ9W9NeFI9nvLD0ynKyuuTOu5VbFm5GcKY3GLndaHV+8hPor8YFIjcRvxRCVR/UEdVG wqQc9IEpO2mDxjZ2Odw2c2pFEQ1WI8xa1WxO9kLYA2AvV12n9mDAWNIwIc++nGwl2ppT ogwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jjm+431tIGbdobUrHCBXJNkRTtcLnDUFDYoMp02qVnE=; b=ElQNwcdIGt9JNoR52Tm/HixgsYuG0YIipxLOBnXsnBDnYYVYDDPZ8VbTfFbXzg49Nn sAD1WLk09JOCE0Ge7s0xp6uLK1eVgpOb/REjM540lYGuG4Toyv+9Qa4xWSJazeW3iX1o 3IXPawyLEaq2jkn0ZgrFsdXaPsWklRsrwbuhuvVvLqSZv/MBQq6DvjaGGs+uYLhtbl9S U8RYZDIjr1x2ZAcFKroPL5ZvtYhd0XOAv2rNqtAr+jVzUKFdax4MbAIVptni8zEJQxKQ yfZh5hDnmQy7U8z8uSFJW7vbS6Bui6r/OioWAyH5T9zTrFTbZSJ4xK0Yp3xaWTxBDb9A aPpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=zGi2+GQp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si23802746pfh.138.2018.11.23.23.13.42; Fri, 23 Nov 2018 23:13:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=zGi2+GQp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406593AbeKWFhv (ORCPT + 99 others); Fri, 23 Nov 2018 00:37:51 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:45985 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730830AbeKWFhv (ORCPT ); Fri, 23 Nov 2018 00:37:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=jjm+431tIGbdobUrHCBXJNkRTtcLnDUFDYoMp02qVnE=; b=zGi2+GQpa1OGTO3OeltAhBhMWcv/ww2t9pYRoghywRg7Sdd0buxVKYIQCcUYka4woaDou1dlyxuLi5FV2L7PHwuHh3Z/TUUbDTuxmwnunChVxN2bz6HDmfxuLx4iiulhrlhvIvKnx0Z+S1CMJV0WNJQC5Oe6cjnuEX6KfOTkY8Q=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gPu9x-0002gp-32; Thu, 22 Nov 2018 19:57:05 +0100 Date: Thu, 22 Nov 2018 19:57:05 +0100 From: Andrew Lunn To: Heiner Kallweit Cc: Marc Dionne , norbert.jurkeit@web.de, nic_swsd@realtek.com, Florian Fainelli , David Miller , netdev , Linux Kernel Mailing List , michael.wiktowy@gmail.com, jcline@redhat.com Subject: Re: Issue with RTL8111 NIC after upgrade to kernel 4.19 Message-ID: <20181122185705.GG10697@lunn.ch> References: <38dad61b-bc7f-7038-6d1b-f5c4afe3841c@gmail.com> <20181121202034.GA10697@lunn.ch> <6aeba3d6-2292-1221-9be7-1c0bb7cbc203@gmail.com> <7d6362e1-e197-d338-d6b0-9036c3802e2c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Thanks a lot for testing. Could you please test also the following > as an alternative to the delay? > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > index 55202a0ac..aeccb2323 100644 > --- a/drivers/net/phy/phy_device.c > +++ b/drivers/net/phy/phy_device.c > @@ -2254,6 +2254,7 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner) > new_driver->mdiodrv.driver.probe = phy_probe; > new_driver->mdiodrv.driver.remove = phy_remove; > new_driver->mdiodrv.driver.owner = owner; > + new_driver->mdiodrv.driver.probe_type = PROBE_FORCE_SYNCHRONOUS; > > retval = driver_register(&new_driver->mdiodrv.driver); > if (retval) { Humm, maybe i don't understand the issue correctly. When the MDIO bus is registered, we scan the bus looking for PHYs. When we find a PHY, we call phy_device_create(). That will then trigger the loading of the kernel module which should driver this phy. Sometime later, the PHY driver module gets loaded and calls phy_drivers_register() to register the list of IDs it supports. The driver core will then call phy_bus_match() to see if the newly loaded driver matches to a device we have created. If so, the driver will be associated to the device. Sometime later, the MAC tries to attach to the phy using phy_attach_direct(). If there is no driver associated to the device, we use the generic PHY driver. I thought the issue was the race condition between loading the module and the MAC attaching to it? We are getting the generic driver because the specific driver is still loading? If that really is the issue, i think phy_attach_direct() should try loading the module again, doing it synchronously. Only when it fails should the generic driver be associated to the device. Andrew