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.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 1902AC3A59F for ; Mon, 26 Aug 2019 18:54:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E27E22070B for ; Mon, 26 Aug 2019 18:54:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="erZ8mhBu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387444AbfHZSyW (ORCPT ); Mon, 26 Aug 2019 14:54:22 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:60540 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727559AbfHZSyV (ORCPT ); Mon, 26 Aug 2019 14:54:21 -0400 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:Sender: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=kMg9jo2+aYpxinBPCrA/TYwqW4S7g/A5UlAFqVagOUQ=; b=erZ8mhBubPFIsVncmO3w8aNL9C gMrNs54KZCvWdnlFzAoUCXAHWwEjQD/W641MZwGGJ9Q1c1Dv7Mws7xEav867mwI7CVSXrlQgeaqZR kEVzsGlKb7jfke5duLuKGPYlub3KK1QrZbwqwO1hgl41tLqC8viu5Gx6jA+5pJvCzJdg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1i2K8A-0006Av-Tr; Mon, 26 Aug 2019 20:54:18 +0200 Date: Mon, 26 Aug 2019 20:54:18 +0200 From: Andrew Lunn To: Florian Fainelli Cc: Voon Weifeng , "David S. Miller" , Maxime Coquelin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jose Abreu , Heiner Kallweit , Ong Boon Leong Subject: Re: [PATCH v1 net-next] net: phy: mdio_bus: make mdiobus_scan also cover PHY that only talks C45 Message-ID: <20190826185418.GG2168@lunn.ch> References: <1566870769-9967-1-git-send-email-weifeng.voon@intel.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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Aug 26, 2019 at 11:27:53AM -0700, Florian Fainelli wrote: > On 8/26/19 6:52 PM, Voon Weifeng wrote: > > From: Ong Boon Leong > > > > Make mdiobus_scan() to try harder to look for any PHY that only talks C45. > If you are not using Device Tree or ACPI, and you are letting the MDIO > bus be scanned, it sounds like there should be a way for you to provide > a hint as to which addresses should be scanned (that's > mii_bus::phy_mask) and possibly enhance that with a mask of possible C45 > devices? Yes, i don't like this unconditional c45 scanning. A lot of MDIO bus drivers don't look for the MII_ADDR_C45. They are going to do a C22 transfer, and maybe not mask out the MII_ADDR_C45 from reg, causing an invalid register write. Bad things can then happen. With DT and ACPI, we have an explicit indication that C45 should be used, so we know on this platform C45 is safe to use. We need something similar when not using DT or ACPI. Andrew