Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2344344pxb; Sun, 15 Nov 2020 01:01:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzy+12yJ/jAZU/jp62iw09SLRfEW6yXuSDY2BgG1ZxwICoJgSxV0JxNtPhCFNSTDjDnbD+B X-Received: by 2002:a05:6402:17c2:: with SMTP id s2mr11046091edy.40.1605430891023; Sun, 15 Nov 2020 01:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605430891; cv=none; d=google.com; s=arc-20160816; b=aTuSwYDIq4Esj+ccju0PChszaCp8DEKw53MRqtODXMVBQvg0/y2FZoEa2FS71WRofb ZkfHMGZ54QA8m/aHcsPerO9RxIw4gM3fkM9OHMk3KeQido24aWAS6zWpevl6Pu9qqXE0 IRtnDiVNYMJgkhe5PQvKbZRWwvvIxci5Cw+yBTs+D2ZR4UrLsHMSs1VwcBGKt0Pd3ANn K5vvE1t9NwYKcLylTXD15S42CZu8WGoMTbyy8fwpK5jjMxAC5nXB9iZoPRAJ35gq32Sw kNIMLxG2DPxjT4/7qI+OrXE3mLJkvMLoRAzFfE1CL/GtdVFDEW3JEKu+b9pVRTK4StDM oOrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=g8RCqTKkuoxvSSBp2uoHnEa3A0lQk0EoNItG6TV9hm4=; b=O6BXvP0IJmRInetSaGolDO9tqjQK9gwkZ88QCISoRj6YqLPL7fOUuE9Xn8RvW44w3Q LJLZlo1LMd/KItTXuNdO0Xd9jIzm4ntyo+6WPPe2SCRn4QaSjXhUFOuzOWS3UlmJSri3 EkZR46xQvFrqnDLOCoyZoDxhtJ7s+7fdFz4M4K5h3ElbBhb/c3/ry91eDLW6woZZcOlZ XOAKF9tawcj2NCbFSE1II/OmyYSLG9Tu9TRcjRxBD7D+NodzO0v+Fv9/4kJtQEMjKsKR vsbFqBIoxRlRlB29+QVFGVRYurYBa1nnzPq9KOm7f9vikHbagaF1FA9fn5iHFpqBYIXZ Sq6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UPt0zKKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si9374370ejk.518.2020.11.15.01.01.08; Sun, 15 Nov 2020 01:01:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UPt0zKKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726773AbgKOI44 (ORCPT + 99 others); Sun, 15 Nov 2020 03:56:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:36232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbgKOI44 (ORCPT ); Sun, 15 Nov 2020 03:56:56 -0500 Received: from localhost (otava-0257.koleje.cuni.cz [78.128.181.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 073752242E; Sun, 15 Nov 2020 08:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605430615; bh=XlDHcdsl532SN92xdtOqleWanacVK4C5l0LGG518skA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UPt0zKKVOB17S0lL9O3/xZIsjZwBnd/ahSRgC/zVMdLWyUKOvrj3fRsbxYY9Wc1HB SQgiN8oXcpOvNgITU/tJPLgkCbr4EOWs8urM8GSOzPD3YiSRAAR+I4P5hkIAe13dKv pCYIIWoMwG3FqXtixZkMDjNOT9GtqrD7xDD583dU= Date: Sun, 15 Nov 2020 09:56:48 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: Russell King - ARM Linux admin , "David S . Miller" , Thomas Petazzoni , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Michal Hrusecki , Sascha Hauer , Andrew Lunn , Jason Cooper , Gregory CLEMENT , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring Subject: Re: [PATCH net-next] net: mvneta: Fix validation of 2.5G HSGMII without comphy Message-ID: <20201115095648.0af1c42b@kernel.org> In-Reply-To: <4bf5376c-a7d1-17bf-1034-b793113b101e@suse.de> References: <20201115004151.12899-1-afaerber@suse.de> <20201115010241.GF1551@shell.armlinux.org.uk> <4bf5376c-a7d1-17bf-1034-b793113b101e@suse.de> 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=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 15 Nov 2020 03:26:01 +0100 Andreas F=C3=A4rber wrote: > Hi Russell, >=20 > On 15.11.20 02:02, Russell King - ARM Linux admin wrote: > > On Sun, Nov 15, 2020 at 01:41:51AM +0100, Andreas F=C3=A4rber wrote: =20 > >> Commit 1a642ca7f38992b086101fe204a1ae3c90ed8016 (net: ethernet: mvneta: > >> Add 2500BaseX support for SoCs without comphy) added support for 2500B= aseX. > >> > >> In case a comphy is not provided, mvneta_validate()'s check > >> state->interface =3D=3D PHY_INTERFACE_MODE_2500BASEX > >> could never be true (it would've returned with empty bitmask before), > >> so that 2500baseT_Full and 2500baseX_Full do net get added to the mask= . =20 > >=20 > > This makes me nervous. It was intentional that if there is no comphy > > configured in DT for SoCs such as Armada 388, then there is no support > > to switch between 1G and 2.5G speed. Unfortunately, the configuration > > of the comphy is up to the board to do, not the SoC .dtsi, so we can't > > rely on there being a comphy on Armada 388 systems. =20 >=20 > Please note that the if clause at the beginning of the validate function > does not check for comphy at all. So even with comphy, if there is a > code path that attempts to validate state 2500BASEX, it is broken, too. >=20 > Do you consider the modification of both ifs (validate and power_up) as > correct? Should they be split off from my main _NA change you discuss? >=20 > > So, one of the side effects of this patch is it incorrectly opens up > > the possibility of allowing 2.5G support on Armada 388 without a comphy > > configured. > >=20 > > We really need a better way to solve this; just relying on the lack of > > comphy and poking at a register that has no effect on Armada 388 to > > select 2.5G speed while allowing 1G and 2.5G to be arbitarily chosen > > doesn't sound like a good idea to me. =20 > [snip] >=20 > May I add that the comphy needs better documentation? >=20 > Marek and I independently came up with <&comphy5 2> in the end, but the > DT binding doesn't explain what the index is supposed to be and how I > might figure it out. It cost me days of reading U-Boot and kernel > sources and playing around with values until I had the working one. >=20 > Might be helpful to have a symbolic dt-bindings #define for this 2. >=20 The gbe mux number is described in Armada 385 documentation. Yes, maybe we should add these defines somewhere, but certainly we should not declare ability of 2500baseX if comphy is not present and the interface is not configured to 2500baseX by default. I propose putting this just into the dt binding documentation. No need for macros IMO, especially since these muxes may be different on each SOC. Marek