Skip to content

Commit 787cac3

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: Pass pcs_poll flag from driver to PHYLINK
The DSA drivers that implement .phylink_mac_link_state should normally register an interrupt for the PCS, from which they should call phylink_mac_change(). However not all switches implement this, and those who don't should set this flag in dsa_switch in the .setup callback, so that PHYLINK will poll for a few ms until the in-band AN link timer expires and the PCS state settles. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1511ed0 commit 787cac3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/net/dsa.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ struct dsa_switch {
279279
*/
280280
bool vlan_filtering;
281281

282+
/* MAC PCS does not provide link state change interrupt, and requires
283+
* polling. Flag passed on to PHYLINK.
284+
*/
285+
bool pcs_poll;
286+
282287
size_t num_ports;
283288
};
284289

net/dsa/port.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ static int dsa_port_phylink_register(struct dsa_port *dp)
599599

600600
dp->pl_config.dev = ds->dev;
601601
dp->pl_config.type = PHYLINK_DEV;
602+
dp->pl_config.pcs_poll = ds->pcs_poll;
602603

603604
dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn),
604605
mode, &dsa_port_phylink_mac_ops);

0 commit comments

Comments
 (0)