Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 30c4a5b0aad8 ("net: mv88e6xxx: use resolved link config in mac_link_up()")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andrew Lunn and committed by
David S. Miller
3be98b2d 34b5e6a3

+6 -1
+6 -1
net/dsa/port.c
··· 670 670 { 671 671 struct dsa_switch *ds = dp->ds; 672 672 struct device_node *phy_np; 673 + int port = dp->index; 673 674 674 675 if (!ds->ops->adjust_link) { 675 676 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); 677 681 return dsa_port_phylink_register(dp); 682 + } 678 683 return 0; 679 684 } 680 685