Skip to content

Commit b3f1a16

Browse files
Greg Ungererdavem330
authored andcommitted
net: dsa: mv88e6xxx: fix marvell 6350 switch probing
As of commit de5c9bf ("net: phylink: require supported_interfaces to be filled") Marvell 88e6350 switches fail to be probed: ... mv88e6085 d0072004.mdio-mii:11: switch 0x3710 detected: Marvell 88E6350, revision 2 mv88e6085 d0072004.mdio-mii:11: phylink: error: empty supported_interfaces error creating PHYLINK: -22 mv88e6085: probe of d0072004.mdio-mii:11 failed with error -22 ... The problem stems from the use of mv88e6185_phylink_get_caps() to get the device capabilities. Create a new dedicated phylink_get_caps for the 6351 family (which the 6350 is one of) to properly support their set of capabilities. According to chip.h the 6351 switch family includes the 6171, 6175, 6350 and 6351 switches, so update each of these to use the correct phylink_get_caps. Fixes: de5c9bf ("net: phylink: require supported_interfaces to be filled") Signed-off-by: Greg Ungerer <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e2b706c commit b3f1a16

File tree

1 file changed

+16
-4
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+16
-4
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,18 @@ static void mv88e6250_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
577577
config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100;
578578
}
579579

580+
static void mv88e6351_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
581+
struct phylink_config *config)
582+
{
583+
unsigned long *supported = config->supported_interfaces;
584+
585+
/* Translate the default cmode */
586+
mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported);
587+
588+
config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 |
589+
MAC_1000FD;
590+
}
591+
580592
static int mv88e6352_get_port4_serdes_cmode(struct mv88e6xxx_chip *chip)
581593
{
582594
u16 reg, val;
@@ -4340,7 +4352,7 @@ static const struct mv88e6xxx_ops mv88e6171_ops = {
43404352
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
43414353
.stu_getnext = mv88e6352_g1_stu_getnext,
43424354
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
4343-
.phylink_get_caps = mv88e6185_phylink_get_caps,
4355+
.phylink_get_caps = mv88e6351_phylink_get_caps,
43444356
};
43454357

43464358
static const struct mv88e6xxx_ops mv88e6172_ops = {
@@ -4440,7 +4452,7 @@ static const struct mv88e6xxx_ops mv88e6175_ops = {
44404452
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
44414453
.stu_getnext = mv88e6352_g1_stu_getnext,
44424454
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
4443-
.phylink_get_caps = mv88e6185_phylink_get_caps,
4455+
.phylink_get_caps = mv88e6351_phylink_get_caps,
44444456
};
44454457

44464458
static const struct mv88e6xxx_ops mv88e6176_ops = {
@@ -5069,7 +5081,7 @@ static const struct mv88e6xxx_ops mv88e6350_ops = {
50695081
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
50705082
.stu_getnext = mv88e6352_g1_stu_getnext,
50715083
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
5072-
.phylink_get_caps = mv88e6185_phylink_get_caps,
5084+
.phylink_get_caps = mv88e6351_phylink_get_caps,
50735085
};
50745086

50755087
static const struct mv88e6xxx_ops mv88e6351_ops = {
@@ -5117,7 +5129,7 @@ static const struct mv88e6xxx_ops mv88e6351_ops = {
51175129
.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
51185130
.avb_ops = &mv88e6352_avb_ops,
51195131
.ptp_ops = &mv88e6352_ptp_ops,
5120-
.phylink_get_caps = mv88e6185_phylink_get_caps,
5132+
.phylink_get_caps = mv88e6351_phylink_get_caps,
51215133
};
51225134

51235135
static const struct mv88e6xxx_ops mv88e6352_ops = {

0 commit comments

Comments
 (0)