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=-10.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham 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 C5177C433E0 for ; Wed, 12 Aug 2020 15:37:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EA50207F7 for ; Wed, 12 Aug 2020 15:37:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nic.cz header.i=@nic.cz header.b="nmi6iMkt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbgHLPhU (ORCPT ); Wed, 12 Aug 2020 11:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbgHLPhU (ORCPT ); Wed, 12 Aug 2020 11:37:20 -0400 Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B39CAC061383 for ; Wed, 12 Aug 2020 08:37:19 -0700 (PDT) Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTPSA id B245A140A4F; Wed, 12 Aug 2020 17:37:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1597246636; bh=/nOgTDVQ+MktfrBYUYdXfJiJG11VL46fwX2R6Mx/JoQ=; h=Date:From:To; b=nmi6iMktucgLlGX8OMEObtf/oLzF+FarxG8qDW4MUsdrgs0PUVgBjkT41dW5S/0sT GM0FQDh278AM2LnTdikY6u7DyP9olmC83IE6MEZkHmy7rnGHz0NyoAOukCiQPnBcI1 TiFVMzMPs7mNyb5ZhOqBGBBJ6PHlilK4amEu4Wno= Date: Wed, 12 Aug 2020 17:37:16 +0200 From: Marek =?ISO-8859-1?Q?Beh=FAn?= To: Russell King - ARM Linux admin Cc: Andrew Lunn , Maxime Chevallier , Baruch Siach , Chris Healy , Florian Fainelli , netdev@vger.kernel.org Subject: Re: [PATCH RFC russell-king 3/4] net: phy: marvell10g: change MACTYPE according to phydev->interface Message-ID: <20200812173716.140bed4d@dellmb.labs.office.nic.cz> In-Reply-To: <20200812150054.GP1551@shell.armlinux.org.uk> References: <20200810220645.19326-1-marek.behun@nic.cz> <20200810220645.19326-4-marek.behun@nic.cz> <20200811152144.GN1551@shell.armlinux.org.uk> <20200812164431.34cf569f@dellmb.labs.office.nic.cz> <20200812150054.GP1551@shell.armlinux.org.uk> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 12 Aug 2020 16:00:54 +0100 Russell King - ARM Linux admin wrote: > On Wed, Aug 12, 2020 at 04:44:31PM +0200, Marek Beh=FAn wrote: > > There is another problem though: I think the PHY driver, when > > deciding whether to set MACTYPE from the XFI with rate matching > > mode to the 10GBASE-R/5GBASE-R/2500BASE-X/SGMII with AN mode, > > should check which modes the underlying MAC support. =20 >=20 > I'm aware of that problem. I have some experimental patches which add > PHY interface mode bitmaps to the MAC, PHY, and SFP module parsing > functions. I have stumbled on some problems though - it's going to be > another API change (and people are already whinging about the phylink > API changing "too quickly", were too quickly seems to be defined as > once in three years), and in some cases, DSA, it's extremely hard to > work out how to properly set such a bitmap due to DSA's layered > approach. >=20 If by your experimental patches you mean net: mvneta: fill in phy interface mode bitmap net: mvpp2: fill in phy interface mode bitmap found here http://git.arm.linux.org.uk/cgit/linux-arm.git/log/?h=3Dclearfog I am currently working on top of them. > Having bitmaps means that we can take the union of what the MAC and > PHY supports, and decide which MACTYPE setting would be most suitable. > However, to do that we're into also changing phylib's interfaces as > well. >=20 > > driver to phylink in the call to phylink_create. But there is no way > > for the PHY driver to get this information from phylink currently, > > and even if phylink exposed a function to return the config member > > of struct phylink, the problem is that at the time when > > mv3310_power_up is called, the phydev->phylink is not yet set (this > > is done in phylink_bringup_phy, and mv3310_power_up is called > > sometime in the phylink_attach_phy). =20 >=20 > We _really_ do not want phylib calling back into phylink functions. > That would tie phylink functionality into phylib and cause problems > when phylink is not being used. >=20 > I would prefer phylib to be passed "the MAC can use these interface > types, and would prefer to use this interface type" and have the > phylib layer (along with the phylib driver) make the decision about > which mode should be used. That also means that non-phylink MACs > can also use it. >=20 I may try to propose something, but in the meantime do you think the current version of the patch net: phy: marvell10g: change MACTYPE according to phydev->interface is acceptable? Marek