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 24CFDC433DF for ; Wed, 17 Jun 2020 18:57:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3C0C206DB for ; Wed, 17 Jun 2020 18:57:10 +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="Yrm1nGR5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727903AbgFQS5J (ORCPT ); Wed, 17 Jun 2020 14:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbgFQS5J (ORCPT ); Wed, 17 Jun 2020 14:57:09 -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 B1AAEC06174E for ; Wed, 17 Jun 2020 11:57:08 -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=9c/5XO2ZSjpjTcoNNpDqagMS/8PcdrjvAPEHJItnGRk=; b=Yrm1nGR5xKE/tYzc3aP2CplHN X0HuV1xPWIjpMeF+LHwvLmii8kqsmMBbwrjMy0xLRnLEJP1XwQwc0An09T2hTCr6RhE9e+9fDhG7x ErXDQ5GOEAzHbADXoZICn/9OQjZxQJGPn/pmyq2QkVBz2P1I+Bko+flxoGQ4fW9vM0BfVYVVnfEs7 uKt98QTYbBlT1O4Jzri8fgmmSpLlH/ZrfSWVwJbsFKWuhIYvPTsMIUWTITVua9Hthl6MbE3MV261k SDWDaOD3fbJjVUFASL9pi/yQZw/qTp/7e9egOG28YVStWCezxyEdXK4pfeNlLlvZ/z9MZ77CvzAiz IICTd63+A==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58596) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jldFA-00040N-MO; Wed, 17 Jun 2020 19:57:04 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jldF9-0003xv-Ng; Wed, 17 Jun 2020 19:57:03 +0100 Date: Wed, 17 Jun 2020 19:57:03 +0100 From: Russell King - ARM Linux admin To: Andrew Lunn Cc: Calvin Johnson , Jeremy Linton , Jon , Cristi Sovaiala , Ioana Ciornei , Andy Shevchenko , Florian Fainelli , Madalin Bucur , netdev@vger.kernel.org, linux.cj@gmail.com Subject: Re: [PATCH v1 1/3] net: phy: Allow mdio buses to auto-probe c45 devices Message-ID: <20200617185703.GW1551@shell.armlinux.org.uk> References: <20200617171536.12014-1-calvin.johnson@oss.nxp.com> <20200617171536.12014-2-calvin.johnson@oss.nxp.com> <20200617174451.GT1551@shell.armlinux.org.uk> <20200617185120.GB240559@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200617185120.GB240559@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 Wed, Jun 17, 2020 at 08:51:20PM +0200, Andrew Lunn wrote: > > > + /* bus capabilities, used for probing */ > > > + enum { > > > + MDIOBUS_C22 = 0, > > > + MDIOBUS_C45, > > > + MDIOBUS_C22_C45, > > > + } probe_capabilities; > > > > I think it would be better to reserve "0" to mean that no capabilities > > have been declared. We hae the situation where we have mii_bus that > > exist which do support C45, but as they stand, probe_capabilities will > > be zero, and with your definitions above, that means MDIOBUS_C22. > > > > It seems this could lock in some potential issues later down the line > > if we want to use this elsewhere. > > Hi Russell > > Actually, this patch already causes issues, i think. > > drivers/net/ethernet/marvell/mvmdio.c contains two MDIO bus master > drivers. "marvell,orion-mdio" is C22 only. "marvell,xmdio" is C45 > only. Because the capabilites is not initialized, it will default to > 0, aka MDIOBUS_C22, for the C45 only bus master, and i expect bad > things will happen. > > We need the value of 0 to cause existing behaviour. Or all MDIO bus > drivers need reviewing, and the correct capabilities set. Yes, that's basically what I was trying to say, thanks for putting it more clearly. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!