Skip to content

Commit 047c730

Browse files
committed
Merge branch 'mv88e6xxx-fixed-link-fixes'
Andrew Lunn says: ==================== mv88e6xxx fixed link fixes Recent changes for how the MAC is configured broke fixed links, as used by CPU/DSA ports, and for SFPs when phylink cannot be used. The first fix is unchanged from v1. The second fix takes a different solution than v1. If a CPU or DSA port is known to have a PHYLINK instance, configure the port down before instantiating the PHYLINK, so it is in the down state as expected by PHYLINK. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents bec8141 + 3be98b2 commit 047c730

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port,
709709
ops = chip->info->ops;
710710

711711
mv88e6xxx_reg_lock(chip);
712-
if (!mv88e6xxx_port_ppu_updates(chip, port) && ops->port_set_link)
712+
if ((!mv88e6xxx_port_ppu_updates(chip, port) ||
713+
mode == MLO_AN_FIXED) && ops->port_set_link)
713714
err = ops->port_set_link(chip, port, LINK_FORCED_DOWN);
714715
mv88e6xxx_reg_unlock(chip);
715716

@@ -731,7 +732,7 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
731732
ops = chip->info->ops;
732733

733734
mv88e6xxx_reg_lock(chip);
734-
if (!mv88e6xxx_port_ppu_updates(chip, port)) {
735+
if (!mv88e6xxx_port_ppu_updates(chip, port) || mode == MLO_AN_FIXED) {
735736
/* FIXME: for an automedia port, should we force the link
736737
* down here - what if the link comes up due to "other" media
737738
* while we're bringing the port up, how is the exclusivity

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)