Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753555AbbGKJPp (ORCPT ); Sat, 11 Jul 2015 05:15:45 -0400 Received: from smtp14.mail.ru ([94.100.181.95]:45030 "EHLO smtp14.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753371AbbGKJPn (ORCPT ); Sat, 11 Jul 2015 05:15:43 -0400 Subject: Re: [PATCH 2/3] of_mdio: add new DT property 'autoneg' for fixed-link To: Florian Fainelli , netdev References: <559FF511.5080102@list.ru> <559FF63E.8020209@list.ru> <55A010F9.7030808@gmail.com> <55A02656.7020508@list.ru> <55A02D90.8090903@gmail.com> <55A032F5.8020801@list.ru> <55A061CC.8060504@gmail.com> Cc: Linux kernel , Sebastien Rannou , Arnaud Ebalard , Stas Sergeev , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Grant Likely , "devicetree@vger.kernel.org" From: Stas Sergeev Message-ID: <55A0DEAC.3020801@list.ru> Date: Sat, 11 Jul 2015 12:15:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <55A061CC.8060504@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam: Not detected X-Mras: Ok Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3932 Lines: 75 11.07.2015 03:22, Florian Fainelli пишет: > On 10/07/15 14:02, Stas Sergeev wrote: >> 10.07.2015 23:39, Florian Fainelli пишет: >>>> - in-band status is an implementation delail, and it is >>>> specific to a particular protocols. If you request the >>>> in-band status for some protocol that doesn't support >>>> it, perhaps you should get -EINVAL, because such a >>>> config makes no sense. With autonegotiation, the rules >>>> are not that strict: it can be "unimplemented", which doesn't >>>> necessary mean nonsense in the config. >>> So by specifying "autoneg", you are not specific about the kind of >>> auto-negotiation protocol available, which is precisely my point: you >>> need to go down to that level of detail for this to be useful. So maybe >>> something like: >>> >>> autoneg = "in-band-status" would actually be a better thing in terms of >>> description because then you would tell what can be made >>> available/working? >> I would agree with this if your argument below is true (see below). >> >>>> - autonegotiation is a wider term, and may be implemented >>>> by some other means than the in-band status (which is >>>> probably impossible for a fixed-link though). >>>> >>>> - In the terms that the driver uses, it is autonegotiation, eg >>>> MVNETA_GMAC_AUTONEG_CONFIG. And when you go down >>>> the implementation details, you see MVNETA_GMAC_INBAND_AN_ENABLE, >>>> which is just one AN bit of many. >>> But arguably, there could be another auto-negotiation method, which is >>> not in-band status related, which means that you would need a way to >>> distinguish between using in-band status, or using something else or >>> nothing, would not you? >> "something else" is a big question here. >> Can you think of _any_ other way that is both not an MDIO >> (suits to fixed-link) and not an in-band? > Yes, I could think about I2C or SPI PHYs that you could use alongside an > Ethernet controller that would qualify for out-of-band, not in-band, yet > could still provide auto-negotiation. You may have special hardware with > such a SPI or I2C controller which provides automatic decoding of the > auto-neg registers. Have not looked at e.g: SFP form factors or fiber > links, but they could also have additional out-of-band type of > auto-negotiation available. > >> If the answer is yes (even theoretically), then >> autoneg = "in-band" | "off" >> may make sense. Otherwise boolean just looks enough. > I think the answer is yes. > >> If we would implement autoneg outside of the fixed-link, >> then its semantic would likely be >> autoneg = "mdio" | "in-band" | "off" >> But the fact that we put it under fixed-link where only a >> single AN possibility exist, may probably be underlined by >> a semantic specific to fixed-link. > Right, if auto-negotiation was defined outside of fixed-link, that is > indeed how I would also specify this. Hmm, okey. But then this all doesn't fit into a fixed-link. The inband autoneg is a very small xtension, it only allows to notify MAC about some changes on the other end, but never control such changes, so from some POV it is still pretty much fixed. And it also built into the protocols that fixed-link already use, so that looked like a natural xtension to me. But if there are so many possible ways to abuse fixed-link making it _fully managed_, I am really starting to think about the possibility of defining the autoneg outside of it, and leave the poor fixed-link alone. The patch will be bigger, but... what do you think? This will of course first require defining the fixed-link in the docs more strictly, as currently it is (vaguely) defined as "non-MDIO", which leaves a lot to speculate and abuse. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/