Thread (39 messages) 39 messages, 4 authors, 2025-08-22

Re: [PATCH net-next v10 04/15] net: phy: Introduce PHY ports representation

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: 2025-08-04 13:42:04
Also in: linux-arm-kernel, linux-arm-msm, linux-devicetree, lkml

On Sat, 26 Jul 2025 22:38:32 +0200
Andrew Lunn [off-list ref] wrote:
quoted
+static int phy_default_setup_single_port(struct phy_device *phydev)
+{
+	struct phy_port *port = phy_port_alloc();
+
+	if (!port)
+		return -ENOMEM;
+
+	port->parent_type = PHY_PORT_PHY;
+	port->phy = phydev;
+
+	/* Let the PHY driver know that this port was never described anywhere.
+	 * This is the usual case, where we assume single-port PHY devices with
+	 * no SFP. In that case, the port supports exactly the same thing as
+	 * the PHY itself.  
I wounder if you should hook into __set_phy_supported() so that DT
max-speed, and the MAC driver calling phy_set_max_speed() are covered?
This code runs after of_set_phy_supported(), so any speed limitation
enforced through the max-speed DT property will also apply to the
ports's supported field. Hopefully, now that we have a port
representation in DT we can get rid of some of the max-speed use-cases,
such as a 1G PHY connected to a Fast Ethernet port :)

For phy_set_max_speed(), the phy device's supported field will be
update, but not the port's. So indeed, I think we should update the
port's supported upon calling phy_set_max_speed(), I'll add and test
that for the next iteration.

Thanks,

Maxime
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help