[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4d4c0c85-ec27-4707-9613-2146aa68bf8c@lunn.ch>
Date: Fri, 4 Oct 2024 20:42:42 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org,
Christophe Leroy <christophe.leroy@...roup.eu>,
Herve Codina <herve.codina@...tlin.com>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Marek Behún <kabel@...nel.org>,
Köry Maincent <kory.maincent@...tlin.com>,
Oleksij Rempel <o.rempel@...gutronix.de>
Subject: Re: [PATCH net-next v2 7/9] net: phy: introduce ethtool_phy_ops to
get and set phy configuration
> +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.
Andrew
Powered by blists - more mailing lists