From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B1C3C433E1 for ; Fri, 19 Jun 2020 13:31:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A7DF207FC for ; Fri, 19 Jun 2020 13:31:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="Uc7SmMk5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732450AbgFSNa7 (ORCPT ); Fri, 19 Jun 2020 09:30:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728851AbgFSNa6 (ORCPT ); Fri, 19 Jun 2020 09:30:58 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85353C06174E; Fri, 19 Jun 2020 06:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=azXx+i4S6hGMFy3RKW3uS2B0gRoR0Q1Z9mL5C3k3bY0=; b=Uc7SmMk5/u0wACt4N71eioHY8 RjMnWJC2yICgwohM9JvfHLNjWjh0qB10LKq8KjSqsLn/sw/kX/rD2+WTwy8z0p+drXmr60KVn7OQv yPHpXeqGVRhakbNEs1i4PZPGu3zfRwyhRwJWXqmK7J3lJiUPPjZB1rKMYpocq9mXMFVfode+0L7zd sYzU4Oo/VxX/Q9a7jJo98OGRiPSLE4SVUZlzvNJ8FtSX34aIqF2hnTWuYSsbeLlWQWjK+J5jPu14V bGDujoYbyNmjFyXu0TDoKEfYQV5cQZY6kLwFK4tntgcZmi+sIPlTqU8zzc5kdB3SDwpao1qKI8OI0 1BDlZFTlA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58832) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmH6R-0006V0-1q; Fri, 19 Jun 2020 14:30:43 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jmH6O-0005gb-H4; Fri, 19 Jun 2020 14:30:40 +0100 Date: Fri, 19 Jun 2020 14:30:40 +0100 From: Russell King - ARM Linux admin To: Andrew Lunn Cc: Florian Fainelli , netdev@vger.kernel.org, Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Rob Herring , Frank Rowand , Dajun Jin , Alexandre Belloni , open list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" Subject: Re: [PATCH net 2/2] net: phy: Check harder for errors in get_phy_id() Message-ID: <20200619133040.GO1551@shell.armlinux.org.uk> References: <20200619044759.11387-1-f.fainelli@gmail.com> <20200619044759.11387-3-f.fainelli@gmail.com> <20200619132659.GB304147@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200619132659.GB304147@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Jun 19, 2020 at 03:26:59PM +0200, Andrew Lunn wrote: > On Thu, Jun 18, 2020 at 09:47:59PM -0700, Florian Fainelli wrote: > > Commit 02a6efcab675 ("net: phy: allow scanning busses with missing > > phys") added a special condition to return -ENODEV in case -ENODEV or > > -EIO was returned from the first read of the MII_PHYSID1 register. > > > > In case the MDIO bus data line pull-up is not strong enough, the MDIO > > bus controller will not flag this as a read error. This can happen when > > a pluggable daughter card is not connected and weak internal pull-ups > > are used (since that is the only option, otherwise the pins are > > floating). > > > > The second read of MII_PHYSID2 will be correctly flagged an error > > though, but now we will return -EIO which will be treated as a hard > > error, thus preventing MDIO bus scanning loops to continue succesfully. > > > > Apply the same logic to both register reads, thus allowing the scanning > > logic to proceed. > > Hi Florian > > Maybe extend the kerneldoc for this function to document the return > values and there special meanings? You mean like the patch I sent yesterday? > BTW: Did you look at get_phy_c45_ids()? Is it using the correct return > value? Given the current work being done to extend scanning to C45, > maybe it needs reviewing for issues like this. And the updates I sent for this yesterday? ;) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!