From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DADF9C05027 for ; Wed, 8 Feb 2023 13:34:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AKegVtFC+Bush2HAdjxZRgW/H6fbPOcm20mmw3jue7Y=; b=w7KMStO0zDig7J 9R+jlmHyV0aGU+uHVG9m8a0MIxuU9Ph77FaRPogRi01ijQ9lx7btcztOcnDlkxGkwBMJW28WuHwsO bf+sECrXU2/ps6qNFohVD+vFHaBCTM6OV/nNJg8SZGaBDE/i0jZCWzXdBqz4/z/eJWFNr9uvA2eXE 8XUyRpiT0liL0M2atx/FFdG+C+uAynqgWDRxWwngm0C0wgJR4D3m+1BGrSEQec2cStp0VF+uQdzrz l1iLibPqM9CpoxKzvEZDlkmVeMKWhjXniEhNmOTln8yfoPkQVX3avDFmSCwOIBMTbN8zQqiSBfDwp NArahB+3JimbcrREe5jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPkZF-00Fkyy-2Y; Wed, 08 Feb 2023 13:32:57 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPkZB-00FkxO-CU for linux-arm-kernel@lists.infradead.org; Wed, 08 Feb 2023 13:32:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MvQdLI3Bfs8SWdCC/a8nzWKrc1dNg1a+wGdZBOHt6sg=; b=OItGhxR3lLxTOyRv+U0uXdgJUF Z7W1PlBU+mC4ndecMyjVziWedj1A5rwSplaIeOTLz0LiAgpx6CQI9PzkWM+ubjHSunHwOMN3rx9+d qCHgmAPXycuGOxPkSUYsu8pogyO3g15U/3OSDDYrlM9AMZ5zct8wjzdFS2BmO4AD/17TOQoYjcyWm Df/MkZYje+UStD8rT/6aZdeyyY4CUNDQqbibs7e2tx3jYx89nIwX/1vcJmbXuXDMdNK54jAMjybII +Y63I7mkvaMITjAUlIrU+tFONmijjQTE6kV44e1hgp/D71D5YA7AAB0KzavbtQrtFUzH0Y4woGTsV CVsuAWYA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36466) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pPkYg-0005hW-Km; Wed, 08 Feb 2023 13:32:22 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pPkYU-0003i8-Fw; Wed, 08 Feb 2023 13:32:10 +0000 Date: Wed, 8 Feb 2023 13:32:10 +0000 From: "Russell King (Oracle)" To: Guan Wentao Cc: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init Message-ID: References: <20230208124025.5828-1-guanwentao@uniontech.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230208124025.5828-1-guanwentao@uniontech.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230208_053253_716565_40117F4A X-CRM114-Status: GOOD ( 19.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [Not fully over covid but I spotted this and don't agree with this change] On Wed, Feb 08, 2023 at 08:40:25PM +0800, Guan Wentao wrote: > The phy->interface from mdiobus_get_phy is default from phy_device_create. > In some phy devices like at803x, use phy->interface to init rgmii delay. > Use plat->phy_interface to init if know from stmmac_probe_config_dt. > > Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic") > Signed-off-by: Guan Wentao > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index 1a5b8dab5e9b..debfcb045c22 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev) > return -ENODEV; > } > > + /* If we know the interface, it defines which PHY interface */ > + if (priv->plat->phy_interface > 0) { > + phydev->interface = priv->plat->phy_interface; > + netdev_dbg(priv->dev, "Override default phy interface\n"); > + } > + Why do you need to do this? You call phylink_create() with ->phy_interface, which tells phylink which interface you want to use. Then, phylink_connect_phy(). phylink will then call phylink_attach_phy() and then phy_attach_direct() with the interface you asked for (which was ->phy_interface). phy_attach_direct() will then set phydev->interface to that interface mode. So, I think what you have above is a hack rather than a proper fix, and the real problem is elsewhere. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel