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.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=unavailable 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 50AF1C48BD4 for ; Tue, 25 Jun 2019 10:34:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 296D0214DA for ; Tue, 25 Jun 2019 10:34:26 +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="00ewTRfj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729375AbfFYKeW (ORCPT ); Tue, 25 Jun 2019 06:34:22 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:50294 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728911AbfFYKeW (ORCPT ); Tue, 25 Jun 2019 06:34:22 -0400 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=9JfX7iQmjBDo3pDtoFcbOTAp5d7caPSzcHl2kcohZp4=; b=00ewTRfjhB5xcHkCaHSWrzlCs UmJq6O4dLdpKSXHs6+W+cNlWJuRUZ12vZ96fvGFdSpBcp34N5bj2xPlgqP/Lwd6C7aNb6JATsxAMJ v2JKKzd9SgPjiB8tylyltZS9ONzOV7mA5ZuqPcTP6DF1VUbKK6JSZqTXXp/i5EXcpKbnmfVeDGP58 x5rQ7NT2Ax+fWzWWrfjznzz9XWOnTcBq6eAF1Gvvo7cRhO85j3RTp2joBahATc2faZP2D6a/yMm7u AwF+z0rE5xT2ridICk/hVCJESkHYwc8lQkHzGKliFhfDwMm29THuhbp0HJ847L18Htxz2SbrZFUFd YCCP+RwjQ==; Received: from shell.armlinux.org.uk ([2001:4d48:ad52:3201:5054:ff:fe00:4ec]:58982) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hfimC-0005pp-Ny; Tue, 25 Jun 2019 11:34:12 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1hfim8-00078r-VN; Tue, 25 Jun 2019 11:34:08 +0100 Date: Tue, 25 Jun 2019 11:34:08 +0100 From: Russell King - ARM Linux admin To: Parshuram Raju Thombare Cc: "andrew@lunn.ch" , "nicolas.ferre@microchip.com" , "davem@davemloft.net" , "f.fainelli@gmail.com" , "netdev@vger.kernel.org" , "hkallweit1@gmail.com" , "linux-kernel@vger.kernel.org" , Rafal Ciepiela , Anil Joy Varughese , Piotr Sroka Subject: Re: [PATCH v5 2/5] net: macb: add support for sgmii MAC-PHY interface Message-ID: <20190625103408.5rh2slqobruavyju@shell.armlinux.org.uk> References: <1561378210-11033-1-git-send-email-pthombar@cadence.com> <1561378274-12357-1-git-send-email-pthombar@cadence.com> <20190624134233.suowuortj5dcbxdg@shell.armlinux.org.uk> <20190625092930.ootk5nvbkqqvfbtd@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jun 25, 2019 at 09:38:37AM +0000, Parshuram Raju Thombare wrote: > > >> >In which case, gem_phylink_validate() must clear the support mask when > >> >SGMII mode is requested to indicate that the interface mode is not > >> >supported. > >> >The same goes for _all_ other PHY link modes that the hardware does not > >> >actually support, such as PHY_INTERFACE_MODE_10GKR... > >> If interface is not supported by hardware probe returns with error, so we don't > >> net interface is not registered at all. > >That does not negate my comment above. > Sorry if I misunderstood your question, but hardware supports interfaces and based > on that link modes are supported. So if interface is not supported by hardware, > net device is not registered and there will be no phylink_validate call. > If hardware support particular interface, link modes supported by interface > are added to (not cleared from) supported mask, provided configs is not trying to limit > data rate using GIGABIT_ENABLE* macro. Why do you want to use phylink? If you are only interested in supporting 10G PHYs, you don't need phylink for that. If you are interested in supporting SFPs as well, then using phylink makes sense, but you need to implement your phylink conversion properly, and that means supporting dynamic switching of the PHY interface mode, and allowing phylink to determine whether a PHY interface mode is supported or not. However, with what you've indicated through our discussion, your MAC does not support BASE-X modes, nor does it support 10GBASE-R, both of which are required for direct connection of SFP or SFP+ modules. The only phy link mode that you support which SFPs can make use of is SGMII, and that will only be useful for copper SFPs configured for SGMII mode. It basically means you can not use any fiber SFPs. The only other way SFPs can be supported is via an intermediary PHY to convert the MAC interface to BASE-X, SGMII or 10GBASE-R, and we don't yet have support for that in mainline. So, given that you seem unwilling to take on board my comments, and your hardware does not appear support SFPs, I'm wondering what the point of this conversion actually is. As a result of our reviews, I've been improving the documentation for phylink, so there has been some positives coming out of this - which will hopefully help others to avoid the same mistakes. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up