Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1097112lqj; Mon, 3 Jun 2024 10:01:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBexhOwBCmutx/ZlfTN9xEBQ6rF5yFAUMcr5bq6gKWfGgjSQ8uCsbFmqKpS4e/pM8e1zjhaJfSW3M31lE5UkM26j9ze3Yb4M1kNhwmfg== X-Google-Smtp-Source: AGHT+IGZmnPqi/qaM7EV6UY99Wd2peIgI83bOfUPTjfTucsOV0Q/VPSpYVSfWJxaMkrmsAQy4Cfm X-Received: by 2002:a05:622a:14d:b0:43f:ed86:45c2 with SMTP id d75a77b69052e-43ff551ce7cmr141928231cf.56.1717434082596; Mon, 03 Jun 2024 10:01:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717434082; cv=pass; d=google.com; s=arc-20160816; b=L3g2c8NWsK+yXIqMtUrl/YHgaoeMagqwUNtOyUe8sPU8i54OmDi2dQSiWCfRZcamYM oVRSpHBNZEKxzo+JTSGSvivdllFz77XkBIhidUPbFTrWKdkmDt+r70WIMdxkbHIRMAi+ pnV0HH3AHXXKTPsal0/NLB1SOml8sLXFNCUyIpH2tl/aekLO9L8V/pulqOMt7HECRyWd nsu2AoYUTzzCOqPJqvseB4clMjiu7p8jtiPEDdvQxRnqnUvDZxvtO+/9cyj/d2/lHI9z ULZFLulGAG52/ZtsVV/KLDcIoev9Sfs/ABOKBK8kJo67H+kKItN5BURDyADfP8wk845b nJkA== ARC-Message-Signature: i=2; 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=+A4idQcki+8DQq24n70JeycG+uvt3GYwhDMfeVoIFew=; fh=yyGyNE68UCVyoXJTI6pLJi654eZfLnm0N7HajiL3Q3w=; b=XSgpJVt+PfXiSAq7KwTvrEQbpoAlU55cQz6qNqCt3W3SE9rDRtzAGlZGau9InwbqHJ 3pN76XV7NVZbq64az9By/967gkP2i/JpuYswK4LuhQYDyMhUTI7RP26bO/sGmpThmHH7 uZUvJGB46C/AhirU/mZ3+1kcvN1mkA+8a/3YVPMUx0WKTj94t5VFVK2VWr13fuViPl+d 7Qyzot5WNq1vZwAwBbfXwJYALNH4JgwUjc+7HaRN28x7IyWVwTHgPfTj9mv8u4O/7ox0 k1yBqZhC8ioSVBlQkgkngSXULlKNvztMAzbCLjoQM25vnSZna4IRnZW5rpO8Y1LrPRnx TIqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-199474-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199474-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff257ebffsi93324731cf.442.2024.06.03.10.01.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 10:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199474-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-199474-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199474-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EDB601C21C97 for ; Mon, 3 Jun 2024 17:01:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62A861369BE; Mon, 3 Jun 2024 17:01:13 +0000 (UTC) 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 0F3A72562E; Mon, 3 Jun 2024 17:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434072; cv=none; b=M41V+dtogt4HbYLG1dQzm+ed4i/Y/YmxGWzla1zdwTgq3OHwGRiQ5EA/zowjwdmdUbxLnoJIWwYFuz8ibiwn3aM2rtOY9GzPJ4NGIZaBHZ3oH5/wIjLSVPoSHzINDj2D1Q049ftr+sj474gIVTTu+8/S0hSUUM1mjkdOGGrFEzw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434072; c=relaxed/simple; bh=g0urmVYosNcFn5Vrer0s4W3kW7EhZLaLDQ8k8VjSfgw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ILGgXO3r7O752sZP2dYwOyG/S7DIdAfRSHcFsBPKcaXjSKs9qSAVPESCMTMx98I/RPLCuxVgMfF7Lcmyu7RnYQxKTzE4ImRThTpRI29K5iQO1My3Ld6jFnZ3+CsK9C6D37IthM1NU9A1Tk8z83bwZnf1F4cPjL7vF7LnqrnH7SY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 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.97.1) (envelope-from ) id 1sEB3I-000000002Nq-1Sjk; Mon, 03 Jun 2024 17:00:56 +0000 Date: Mon, 3 Jun 2024 18:00:49 +0100 From: Daniel Golle To: "Russell King (Oracle)" Cc: Sky Huang , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Qingfang Deng , Matthias Brugger , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Steven Liu Subject: Re: [PATCH net-next v6 5/5] net: phy: add driver for built-in 2.5G ethernet PHY on MT7988 Message-ID: References: <20240603121834.27433-1-SkyLake.Huang@mediatek.com> <20240603121834.27433-6-SkyLake.Huang@mediatek.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: On Mon, Jun 03, 2024 at 04:47:28PM +0100, Russell King (Oracle) wrote: > On Mon, Jun 03, 2024 at 03:52:19PM +0100, Daniel Golle wrote: > > On Mon, Jun 03, 2024 at 02:41:44PM +0100, Russell King (Oracle) wrote: > > > On Mon, Jun 03, 2024 at 02:31:46PM +0100, Daniel Golle wrote: > > > > On Mon, Jun 03, 2024 at 02:25:01PM +0100, Russell King (Oracle) wrote: > > > > > On Mon, Jun 03, 2024 at 08:18:34PM +0800, Sky Huang wrote: > > > > > > Add support for internal 2.5Gphy on MT7988. This driver will load > > > > > > necessary firmware, add appropriate time delay and figure out LED. > > > > > > Also, certain control registers will be set to fix link-up issues. > > > > > > > > > > Based on our previous discussion, it may be worth checking in the > > > > > .config_init() method whether phydev->interface is one of the > > > > > PHY interface modes that this PHY supports. As I understand from one > > > > > of your previous emails, the possibilities are XGMII, USXGMII or > > > > > INTERNAL. Thus: > > > > > > > > > > > +static int mt798x_2p5ge_phy_config_init(struct phy_device *phydev) > > > > > > +{ > > > > > > + struct pinctrl *pinctrl; > > > > > > + int ret; > > > > > > > > > > /* Check that the PHY interface type is compatible */ > > > > > if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL && > > > > > phydev->interface != PHY_INTERFACE_MODE_XGMII && > > > > > phydev->interface != PHY_INTERFACE_MODE_USXGMII) > > > > > return -ENODEV; > > > > > > > > The PHY is built-into the SoC, and as such the connection type should > > > > always be "internal". The PHY does not exist as dedicated IC, only > > > > as built-in part of the MT7988 SoC. > > > > > > That's not how it was described to me by Sky. > > > > > > If what you say is correct, then the implementation of > > > mt798x_2p5ge_phy_get_rate_matching() which checks for interface modes > > > other than INTERNAL is not correct. Also it means that config_init() > > > should not permit anything but INTERNAL. > > > > The way the PHY is connected to the MAC *inside the chip* is XGMII > > according the MediaTek. So call it "internal" or "xgmii", however, up to > > my knowledge it's a fact that there is **only one way** this PHY is > > connected and used, and that is being an internal part of the MT7988 SoC. > > > > Imho, as there are no actual XGMII signals exposed anywhere I'd use > > "internal" to describe the link between MAC and PHY (which are both > > inside the same chip package). > > I don't care what gets decided about what's acceptable for the PHY to > accept, just that it checks for the acceptable modes in .config_init() > and the .get_rate_matching() method is not checking for interface > modes that are not permitted. What I meant to express is that there is no need for such a check, also not in config_init. There is only one way and one MAC-side interface mode to operate that PHY, so the value will anyway not be considered anywhere in the driver.