Commit 704438dd authored by Maksym Glubokiy's avatar Maksym Glubokiy Committed by David S. Miller

net: prestera: cache port state for non-phylink ports too

Port event data must stored to port-state cache regardless of whether
the port uses phylink or not since this data is used by ethtool.

Fixes: 52323ef7 ("net: marvell: prestera: add phylink support")
Signed-off-by: default avatarOleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: default avatarMaksym Glubokiy <maksym.glubokiy@plvision.eu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 105b0468
...@@ -797,32 +797,30 @@ static void prestera_port_handle_event(struct prestera_switch *sw, ...@@ -797,32 +797,30 @@ static void prestera_port_handle_event(struct prestera_switch *sw,
caching_dw = &port->cached_hw_stats.caching_dw; caching_dw = &port->cached_hw_stats.caching_dw;
if (port->phy_link) { memset(&smac, 0, sizeof(smac));
memset(&smac, 0, sizeof(smac)); smac.valid = true;
smac.valid = true; smac.oper = pevt->data.mac.oper;
smac.oper = pevt->data.mac.oper; if (smac.oper) {
if (smac.oper) { smac.mode = pevt->data.mac.mode;
smac.mode = pevt->data.mac.mode; smac.speed = pevt->data.mac.speed;
smac.speed = pevt->data.mac.speed; smac.duplex = pevt->data.mac.duplex;
smac.duplex = pevt->data.mac.duplex; smac.fc = pevt->data.mac.fc;
smac.fc = pevt->data.mac.fc; smac.fec = pevt->data.mac.fec;
smac.fec = pevt->data.mac.fec;
phylink_mac_change(port->phy_link, true);
} else {
phylink_mac_change(port->phy_link, false);
}
prestera_port_mac_state_cache_write(port, &smac);
} }
prestera_port_mac_state_cache_write(port, &smac);
if (port->state_mac.oper) { if (port->state_mac.oper) {
if (!port->phy_link) if (port->phy_link)
phylink_mac_change(port->phy_link, true);
else
netif_carrier_on(port->dev); netif_carrier_on(port->dev);
if (!delayed_work_pending(caching_dw)) if (!delayed_work_pending(caching_dw))
queue_delayed_work(prestera_wq, caching_dw, 0); queue_delayed_work(prestera_wq, caching_dw, 0);
} else if (netif_running(port->dev) && } else {
netif_carrier_ok(port->dev)) { if (port->phy_link)
if (!port->phy_link) phylink_mac_change(port->phy_link, false);
else if (netif_running(port->dev) && netif_carrier_ok(port->dev))
netif_carrier_off(port->dev); netif_carrier_off(port->dev);
if (delayed_work_pending(caching_dw)) if (delayed_work_pending(caching_dw))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment