1 From 3f911800613a3417101563b488c51a9b310ba7fa Mon Sep 17 00:00:00 2001
2 From: Vladimir Oltean <vladimir.oltean@nxp.com>
3 Date: Fri, 27 Dec 2019 20:14:57 +0200
4 Subject: [PATCH] net: dsa: Pass pcs_poll flag from driver to PHYLINK
6 The DSA drivers that implement .phylink_mac_link_state should normally
7 register an interrupt for the PCS, from which they should call
8 phylink_mac_change(). However not all switches implement this, and those
9 who don't should set this flag in dsa_switch in the .setup callback, so
10 that PHYLINK will poll for a few ms until the in-band AN link timer
11 expires and the PCS state settles.
13 Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
18 trivially with upstream commit 05f294a85235 ("net: dsa: allocate ports
19 on touch") which was merged in v5.4-rc3.
21 include/net/dsa.h | 5 +++++
23 2 files changed, 6 insertions(+)
25 --- a/include/net/dsa.h
26 +++ b/include/net/dsa.h
27 @@ -291,6 +291,11 @@ struct dsa_switch {
31 + /* MAC PCS does not provide link state change interrupt, and requires
32 + * polling. Flag passed on to PHYLINK.
36 /* Dynamically allocated ports, keep last */
38 struct dsa_port ports[];
41 @@ -639,6 +639,7 @@ static int dsa_port_phylink_register(str
43 dp->pl_config.dev = ds->dev;
44 dp->pl_config.type = PHYLINK_DEV;
45 + dp->pl_config.pcs_poll = ds->pcs_poll;
47 dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn),
48 mode, &dsa_port_phylink_mac_ops);