From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiner Kallweit Subject: Re: [PATCH net] net: phy: replace preliminary fix for PHY driver sometimes not binding to the device Date: Sat, 29 Dec 2018 10:33:18 +0100 Message-ID: <36786fc5-c34d-2847-edbb-71e49302ef80@gmail.com> References: <1bafaa75-18a2-87a2-a9cb-01b951c1d1f7@gmail.com> <8b4f48b1-dc97-1f8d-c9a8-d67b41591d07@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "netdev@vger.kernel.org" , Norbert Jurkeit , Frank Crawford To: Florian Fainelli , Andrew Lunn , David Miller , Greg Kroah-Hartman , "Rafael J. Wysocki" Return-path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:37909 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbeL2JqG (ORCPT ); Sat, 29 Dec 2018 04:46:06 -0500 Received: by mail-wr1-f65.google.com with SMTP id v13so22785469wrw.5 for ; Sat, 29 Dec 2018 01:46:05 -0800 (PST) In-Reply-To: <8b4f48b1-dc97-1f8d-c9a8-d67b41591d07@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 29.12.2018 03:42, Florian Fainelli wrote: > Le 12/24/18 à 3:21 AM, Heiner Kallweit a écrit : >> phy_device_create() uses request_module() to load the PHY driver module >> based on the PHY ID of the device. There is some timing issue which >> sometimes prevents the PHY driver to bind to the device. In such cases >> the genphy driver is used what can cause problems if genphy isn't >> compatible with the respective PHY. >> It turned out that the first fix can fix the issue in some but not all >> cases. Moving the call to device_initialize() before the call to >> request_module() was reported to fix the issue. >> I can't explain where the root cause of the issue is and why this fix >> works. AFAICS device_initialize() just initializes the device struct >> w/o doing anything that could interfere with e.g. bus_add_driver(). >> This patch removes the first preliminary fix attempt. > > Humm but phy_device is comprised of a mdio_device on which the actual > matching is done, so you do have to call device_initialize() first in > order for the phy_device instance to have its companion mdio_device's > kobject to be properly initialized. > > Out of curiosity, do any of the people who tested that change have the > ability to run a kernel with list/kobject debugging enabled so we can > learn a bit more about the problematic code path? >> One or two can build a kernel and test if they are given a patch and instructions. The other option is to ask Hans from Redhat to build a test kernel and distribute it as rpm to users who want to test. See also history of the bug ticket. Last status is that I provided a patch which creates some debug output and Hans built a test kernel. However most likely we will get feedback only beginning of January when more people are back from holidays. >> Reference: >> https://bugzilla.redhat.com/show_bug.cgi?id=1650984 >>