Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6825343rdb; Tue, 2 Jan 2024 15:14:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8qZBT+Zs6KIHZLOFfvSgvPuM3rK7kuSZBNSJJtzq9dsBHlEWfW9SBfjGfOmqEdeQhvpdg X-Received: by 2002:a17:902:ba81:b0:1d0:c986:8aae with SMTP id k1-20020a170902ba8100b001d0c9868aaemr7831651pls.97.1704237251937; Tue, 02 Jan 2024 15:14:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704237251; cv=none; d=google.com; s=arc-20160816; b=zdjnJB+sxxhumIkvHQA5f+k7G1Qw+vujy57uSHcYs14QFiofvnnP/Ej9Rxx4xJNYNR W7OhRr2dLlfdWOVOwXbccIEBh8xi81O3FM6DTj4UHR6oq/ZHdOp9z2FO0k/sHyGgiKZO FKXt9Yd7OZ+jJN3wIZ38gl8BCBw2Z2dsuEsUUT9SvoD0dcOvP8ADmXWIagN73b2KvhO2 fRMOIrOuvdmKjAu/uSlRIptZWiHvnh6TwAibiFKDkEM6Ap4Lf7wrq6tO3ASzpcu0Orii RzrxM3uwKHkq7cTdl7/t+bROWhRyrevOTp73DbSEcIXy/uKWbwcpYrB4Ko8UtQSw7pBg 2PZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=xTWK/uZV1kkx8JdNSuAByCvLyhYTn0JHSMyI9KBhW58=; fh=wjzr5rRi4MtkWTMnnW3EjdZSpncIazyqZGzW5u9d+lQ=; b=CUZh5DACMSKUZXd4CWAIAs2d+1RRCAA8E9VDIsqA8zKU3cz4qtFGxZfpy8u0xGgGxh irKXM7Nriubdjo4yha2lFB+IoOdxXB/ZnNDFki6YFZOLx+dhiBrKnSOva2OGrU7C0Dmo bMgiJIfhP8DgNQxnWrN8WmseubgIm+/IIOLQ59XX5yyC8W5+V6uBTNxOLVP7P2vTEjQw 4s2zV6z819k48AGixXCl9wCCpbiO/cWmo8VGepDv3uAxMbBkltNQuxG01jVzCd1v7xqd 8Asu7VU2QzE6dCKMvrpSzAOa82AGR3CnBdad5r7Ia7Ebauj/OeXhGwxjYE8xeT0E0uq1 7Tpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14966-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z20-20020a170902ee1400b001d08c079196si8515070plb.36.2024.01.02.15.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 15:14:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14966-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2DC72B225E6 for ; Tue, 2 Jan 2024 23:14:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 462571774D; Tue, 2 Jan 2024 23:13:56 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C8C81772C; Tue, 2 Jan 2024 23:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rKnx0-0001EK-1z; Tue, 02 Jan 2024 23:13:35 +0000 Date: Wed, 3 Jan 2024 00:10:54 +0100 From: Daniel Golle To: Eric Woudstra Cc: "Russell King (Oracle)" , Alexander Couzens , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Frank Wunderlich , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH RFC net-next] net: pcs: pcs-mtk-lynxi fix mtk_pcs_lynxi_get_state() for 2500base-x Message-ID: References: <20240102074408.1049203-1-ericwouds@gmail.com> <92190426-3614-4774-9E9F-18F121622788@gmail.com> <74223164-ab50-4d6d-a4f4-561b0a70d396@gmail.com> <6666EB36-984E-4898-A41A-2D9713DE4DB0@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6666EB36-984E-4898-A41A-2D9713DE4DB0@gmail.com> On Tue, Jan 02, 2024 at 11:13:58PM +0100, Eric Woudstra wrote: > I believe the general idea is that phylink should be aware wether to use inband or outband negotiation in order to setup the hardware correctly. Speaking of a situation where there is a PHY attached. Well, SGMII speed/duplex AN is not defined for 2500Base-X by any standard and not supported by the hardware (unlike e.g. RealTek which came up with their own proprietary extension called HiSGMII). So we should simply never set the SGMII_SPEED_DUPLEX_AN bit if using 2500Base-X on MediaTek LynxI PCS -- in-band link status will still work, and as 2500Base-X anyway only supports 2500M speed at full duplex it is not a problem that speed and duplex are hard-coded in the driver in this case imho. And that works fine for SFPs with and without present/discoverable/accessible PHY. Surely, having phylink take care whether SGMII_SPEED_DUPLEX_AN should be set would be even nicer. I believe that source of confusion here is simply that in-band-status != SGMII_SPEED_DUPLEX_AN We *do* have in-band-status even without having SGMII_SPEED_DUPLEX_AN set with 2500Base-X link mode (as in: link being up or down and link, duplex and speed is fixed anyway for 2500Base-X). > > On January 2, 2024 9:01:23 PM GMT+01:00, Daniel Golle wrote: > >On Tue, Jan 02, 2024 at 08:33:32PM +0100, Eric Woudstra wrote: > >> [...] > >> > >> So if phylink_mii_c22_pcs_decode_state() should not set the speed, then it is not correctly set somewhere else. > > > >Yes, but the fix should go to pcs-mtk-lynxi.c and you don't need to > >change phylink for it to work. > >This should be enough: > >https://patchwork.kernel.org/project/netdevbpf/patch/091e466912f1333bb76d23e95dc6019c9b71645f.1699565880.git.daniel@makrotopia.org/ > >