Skip to content

Commit 3be98b2

Browse files
lunndavem330
authored andcommitted
net: dsa: Down cpu/dsa ports phylink will control
DSA and CPU ports can be configured in two ways. By default, the driver should configure such ports to there maximum bandwidth. For most use cases, this is sufficient. When this default is insufficient, a phylink instance can be bound to such ports, and phylink will configure the port, e.g. based on fixed-link properties. phylink assumes the port is initially down. Given that the driver should have already configured it to its maximum speed, ask the driver to down the port before instantiating the phylink instance. Fixes: 30c4a5b ("net: mv88e6xxx: use resolved link config in mac_link_up()") Signed-off-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 34b5e6a commit 3be98b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/dsa/port.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,11 +670,16 @@ int dsa_port_link_register_of(struct dsa_port *dp)
670670
{
671671
struct dsa_switch *ds = dp->ds;
672672
struct device_node *phy_np;
673+
int port = dp->index;
673674

674675
if (!ds->ops->adjust_link) {
675676
phy_np = of_parse_phandle(dp->dn, "phy-handle", 0);
676-
if (of_phy_is_fixed_link(dp->dn) || phy_np)
677+
if (of_phy_is_fixed_link(dp->dn) || phy_np) {
678+
if (ds->ops->phylink_mac_link_down)
679+
ds->ops->phylink_mac_link_down(ds, port,
680+
MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
677681
return dsa_port_phylink_register(dp);
682+
}
678683
return 0;
679684
}
680685

0 commit comments

Comments
 (0)