Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932531AbcKIRHM (ORCPT ); Wed, 9 Nov 2016 12:07:12 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33790 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754490AbcKIRHK (ORCPT ); Wed, 9 Nov 2016 12:07:10 -0500 Subject: Re: Is Documentation/networking/phy.txt still up-to-date? To: Sebastian Frias , afleming@freescale.com, jgarzik@pobox.com, =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= References: <582323A8.20706@laposte.net> Cc: netdev , LKML , "David S. Miller" From: Florian Fainelli Message-ID: <24676d24-5b07-7d26-6ffa-14e857960a52@gmail.com> Date: Wed, 9 Nov 2016 09:07:08 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <582323A8.20706@laposte.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1620 Lines: 42 On 11/09/2016 05:24 AM, Sebastian Frias wrote: > Hi, > > Documentation/networking/phy.txt discusses phy_connect and states that: > > "... > > interface is a u32 which specifies the connection type used > between the controller and the PHY. Examples are GMII, MII, > RGMII, and SGMII. For a full list, see include/linux/phy.h > > Now just make sure that phydev->supported and phydev->advertising have any > values pruned from them which don't make sense for your controller (a 10/100 > controller may be connected to a gigabit capable PHY, so you would need to > mask off SUPPORTED_1000baseT*). See include/linux/ethtool.h for definitions > for these bitfields. Note that you should not SET any bits, or the PHY may > get put into an unsupported state. > > ..." > > However, 'drivers/net/ethernet/aurora/nb8800.c' for example, does SETs some > bits (in function 'nb8800_pause_adv'). All pause/flow control related bits should be set by the Ethernet MAC driver because this is an Ethernet MAC, not PHY, thing. See this discussion for some details: https://www.mail-archive.com/netdev@vger.kernel.org/msg135347.html So the nb8800 drivers does the correct thing here, but the documentation should be updated to reflect that this applies to all bits, except the Pause capabilities because these need to come from the Ethernet MAC. > > I checked 'drivers/net/ethernet/broadcom/genet/bcmmii.c' and that one CLEARs > bits (as per the documentation). > > Does anybody knows what is the correct/recommended approach? Both drivers do correct things, they just don't set the same things here. -- Florian