Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp449081imj; Thu, 7 Feb 2019 06:49:50 -0800 (PST) X-Google-Smtp-Source: AHgI3Iab194tyN+h0D5C/fS8zST8BHiT3ZMSnCuOdw/er2eO1qRWeHEDeNcdSjFuvRPVekNkqvCB X-Received: by 2002:aa7:8608:: with SMTP id p8mr16694319pfn.125.1549550990704; Thu, 07 Feb 2019 06:49:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549550990; cv=none; d=google.com; s=arc-20160816; b=jJlyxU3EAVBFXaW+jMsPOO+t4OaaKZ/wMbCHbtWLXA9OyzJqYhxBi0cc+FEeMoVU55 GK++lSGEoJln3iQV1+GvO7UDsjrX7J5eHsqJcHmTRzMO5M9nx05y1qwOqpT2haT2MlH+ likXe0fwPBjkSGBV7TbOQEYBrAbTrxcbmFCvBkooAc32cq8QRyVigqQcG2QEu739IP+9 WLnkKd8tf1rObOOiSpNssT/I1gs2bDhRQ80irPVvJlGvGThrpJdirvMRBdWzDlwqEQy0 rVCgmMyr3T6C5ZsowwBcF01eosBa+3i6ZKcT+9s24UR97kuK6g3h8ujTG87Ji/mmfhZc Z2KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=5XLmaGEakXCuy2WH03y/b/9EdkYut7yENgx+J7uwykU=; b=PYU7LQcFeg6130z1Nzm4ejueeko5GP3pdBuin6Qibidvh74ifjZ+ZgpOD7JuKsM/Rh bvIZBTeFcxlvxr94U7PmCQVl30zMB1s3Ww8GYY6q9YaW5g8Akte1/hma0wf0nIJDRC+K 3iRWm6esiVuUoQtkR1iI1Uf4dx843oDD+D7F+1Go8CyuiIJUS6NS5JAnkTKQbCcVkEIl YeqdZnUUh3o84+a9CWbxqbY6FqJvwAzCXT2bKL4q6GVqUznClQyPUQht1c6l742uFzW+ Vj2jPIlCPICEtts9Dm7nlFiaVuvfCbxTN8pchiLIdXTtcEB0d8qLZ+6L4DiAHV22xzEw bhKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10si7634124pgd.57.2019.02.07.06.49.34; Thu, 07 Feb 2019 06:49:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbfBGOtP (ORCPT + 99 others); Thu, 7 Feb 2019 09:49:15 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:40707 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbfBGOtP (ORCPT ); Thu, 7 Feb 2019 09:49:15 -0500 X-Originating-IP: 90.88.22.177 Received: from bootlin.com (aaubervilliers-681-1-80-177.w90-88.abo.wanadoo.fr [90.88.22.177]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 6EB971BF20A; Thu, 7 Feb 2019 14:49:11 +0000 (UTC) Date: Thu, 7 Feb 2019 15:49:10 +0100 From: Maxime Chevallier To: Andrew Lunn Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com Subject: Re: [PATCH net-next v2 04/10] net: phy: Automatically fill the generic TP, FIBRE and Backplane modes Message-ID: <20190207154910.697a8761@bootlin.com> In-Reply-To: <20190207140939.GI32483@lunn.ch> References: <20190207094939.27369-1-maxime.chevallier@bootlin.com> <20190207094939.27369-5-maxime.chevallier@bootlin.com> <20190207140939.GI32483@lunn.ch> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andrew, On Thu, 7 Feb 2019 15:09:39 +0100 Andrew Lunn wrote: >On Thu, Feb 07, 2019 at 10:49:33AM +0100, Maxime Chevallier wrote: >> PHY advertised and supported linkmodes contain both specific modes such >> as 1000BASET Half/Full and generic ones such as TP that represent a >> class of modes. >> >> Since some modes such as Fibre, TP or Backplane match a wide range of >> specific modes, we can automatically set these bits if one of the >> specific modes it corresponds to is present in the list. >> >> The 'TP' bit is set whenever there's a BaseT linkmode in >> phydev->supported. >> >> The 'FIBRE' bit is set for BaseL, BaseS and BaseE linkmodes. >> >> Finally, the 'Backplane' is set whenever a BaseK mode is supported. > >Hi Maxime > >Interesting idea. > >But what exactly are we supposed to be representing here? That PHY >can do these modes, or that the port exists on the device? The >marvell10g can do fibre, but do all boards have an SFP/SFF, or do some >only have an RJ-45 for TP? Are there boards without TP and just >SFP/SFF? My understanding is that this would represent what the PHY is capable of, at least when set in the supported field, but I agree that this doesn't reflect what's on the device. I extrapolated this logic from the ability detection in marvell10g, that would set these bits according to the abilities reported by the PHY. This was done based on the PHY register values, instead of the linkmodes in the 'supported' field. >Is there documentation in ethtool which gives a clue as to what is >expected? Not really, at least to my knowledge. I think this would be used by "ethtool -s ethX port tp|fibre|aui|etc". Maybe this could be useful if we decide to implement port selection with ethtool on the MCBin, but I'm getting a bit ahead of myself. Thanks, Maxime