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 3BCBCCF885A for ; Fri, 4 Oct 2024 20:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id: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-Owner; bh=LUJZilgqaYxyl2cKJ0toBOmC6GOF/ktiyVJOdIywIxo=; b=nbm3Q9gLGLVgnjWOoK02szHE6O oXKExU6h9MGX7XE5y2WsrftM8w/yHjEQ8fH98PAQBAOvkMMUduVHmtlcc+7huqZAbZGkepPxYzWBt k7mtafHtJCCIoc/Fmj6MNPhLQum+Ur9009fAw+P4RAemJX7zrQfj/VPRPPwIT6pgYe+KWM5cvIuQ5 Ww1fq7w47x0Nn5IMWrH4UAXoqw4XNaKT3Xi29j325wJT4enbZcUIzszOCxGmXuqhjA+0yOMayG9TD Tk5v8J/OsDFWV0Kg0shoXt3vX7jl8SnOGkhxn6vK6FWwMu9hY+bAWwDbzYoXKYbPVECFcDqNIfnDD KffxjCRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swojZ-0000000E66w-2srm; Fri, 04 Oct 2024 20:17:05 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swnbN-0000000Dove-3fbi for linux-arm-kernel@bombadil.infradead.org; Fri, 04 Oct 2024 19:04:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=LUJZilgqaYxyl2cKJ0toBOmC6GOF/ktiyVJOdIywIxo=; b=HJESx7d373DFjhJPWZUeMzxpMY Ulh2nF9pjXiMm1jTJ7NhySjsdbp7jZt80P07BSFehpZP6bTdq3wdvsa/IBr0h98Clvu/X5LfP40KX aZlESUmB7ptOk4Q5Rycj6dBtEVNjQRosKSXygFgq9yq+NX86klRVPOj4enDqVvVRGXrW9HGIotfOV XoODBx3wTqt2bQ6xm6g90HyjEp6JScYkiEUxdHg54+S109u8yJ5iYz6K9+6MdpM/5T/fT5yMjDzY1 Jcspj1jke87OpNmXsDMvlV+KG7OTwkibhXZ2bns2eyS0/pLYXSwj7i/TuUqxhSfYNEHjtiWyv28Jq 1xWeYTJw==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swnbI-00000003u7j-359g for linux-arm-kernel@lists.infradead.org; Fri, 04 Oct 2024 19:04:32 +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=LUJZilgqaYxyl2cKJ0toBOmC6GOF/ktiyVJOdIywIxo=; b=YGrzVP+85uGEvI8mFy8QFV94Ji 0eGsA8DcZXpk3IERbh52eXU7BuqbgoFkPBUVh0mYXcjlti/SMDaBMNl+L3i3HchBkcdxm85SZDHJy qU185f9QfB+0+yP4denXtr0kQg17ElOgaP8X25DEc3VJcXRmjOEMDSPaMLAC6LSQhUVmwMmz8sgk9 MprXS/39x2796zTQruklCKo1/UFocwZIXGYeiGaJSAYE/yAU3DwajKSm+daz4ldg3+N5LkNZApCeq 87X6F08ARWjwNc2+Hzy9KEnDEWr9IDBK9UnYzenGPk78rkrAmvZTPRXuIwf0ynWJRzdUBXk66rCTJ 9Pl8Gb4w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:38292) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1swnZ4-0002ar-2v; Fri, 04 Oct 2024 20:02:10 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.96) (envelope-from ) id 1swnYz-0001Ox-13; Fri, 04 Oct 2024 20:02:05 +0100 Date: Fri, 4 Oct 2024 20:02:05 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Maxime Chevallier , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Jakub Kicinski , Eric Dumazet , Paolo Abeni , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , Marek =?iso-8859-1?Q?Beh=FAn?= , =?iso-8859-1?Q?K=F6ry?= Maincent , Oleksij Rempel Subject: Re: [PATCH net-next v2 7/9] net: phy: introduce ethtool_phy_ops to get and set phy configuration Message-ID: References: <20241004161601.2932901-1-maxime.chevallier@bootlin.com> <20241004161601.2932901-8-maxime.chevallier@bootlin.com> <4d4c0c85-ec27-4707-9613-2146aa68bf8c@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d4c0c85-ec27-4707-9613-2146aa68bf8c@lunn.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241004_200429_728337_F777764C X-CRM114-Status: GOOD ( 23.60 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 04, 2024 at 08:42:42PM +0200, Andrew Lunn wrote: > > +int phy_set_config(struct phy_device *phydev, > > + const struct phy_device_config *phy_cfg, > > + struct netlink_ext_ack *extack) > > +{ > > + bool isolate_change; > > + int ret; > > + > > + mutex_lock(&phydev->lock); > > + isolate_change = (phy_cfg->isolate != phydev->isolated); > > + mutex_unlock(&phydev->lock); > > + > > + if (!isolate_change) > > + return 0; > > + > > + ret = phy_isolate(phydev, phy_cfg->isolate); > > + if (ret) > > + NL_SET_ERR_MSG(extack, "Error while configuring PHY isolation"); > > This seems overly simplistic to me. Don't you need to iterate over all > the other PHYs attached to this MAC and ensure they are isolated? Only > one can be unisolated at once. > > It is also not clear to me how this is going to work from a MAC > perspective. Does the MAC call phy_connect() multiple times? How does > ndev->phydev work? Who is responsible for the initial configuration, > such that all but one PHY is isolated? > > I assume you have a real board that needs this. So i think we need to > see a bit more of the complete solution, including the MAC changes and > the device tree for the board, so we can see the big picture. Also what the ethernet driver looks like too! One way around the ndev->phydev problem, assuming that we decide that isolate is a good idea, would be to isolate the current PHY, disconnect it from the net_device, connect the new PHY, and then clear the isolate on the new PHY. Essentially, ndev->phydev becomes the currently-active PHY. However, I still want to hear whether multiple PHYs can be on the same MII bus from a functional electrical perspective. I know that on the Macchiatobin, where the 10G serdes signals go to the 88X3310 on doubleshot boards and to the SFP cage on singleshot boards, this is controlled by the placement of zero ohm resistors to route the serdes signals to the appropriate device, thus minimising the unused stub lengths. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!