kernel: bump 5.10 to 5.10.178
[openwrt/staging/stintel.git] / target / linux / realtek / patches-5.10 / 710-net-phy-sfp-re-probe-modules-on-DEV_UP-event.patch
1 From a381ac0aa281fdb0b41a39d8a2bc08fd88f6db92 Mon Sep 17 00:00:00 2001
2 From: Antoine Tenart <antoine.tenart@bootlin.com>
3 Date: Tue, 25 Feb 2020 16:32:37 +0100
4 Subject: [PATCH 1/3] net: phy: sfp: re-probe modules on DEV_UP event
5
6 Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
7 ---
8 drivers/net/phy/sfp.c | 7 +++++++
9 1 file changed, 7 insertions(+)
10
11 --- a/drivers/net/phy/sfp.c
12 +++ b/drivers/net/phy/sfp.c
13 @@ -1968,6 +1968,13 @@ static void sfp_sm_module(struct sfp *sf
14 return;
15 }
16
17 + /* Re-probe the SFP modules when an interface is brought up, as the MAC
18 + * do not report its link status (This means Phylink wouldn't be
19 + * triggered if the PHY had a link before a MAC is brought up).
20 + */
21 + if (event == SFP_E_DEV_UP && sfp->sm_mod_state == SFP_MOD_PRESENT)
22 + sfp_sm_mod_next(sfp, SFP_MOD_PROBE, T_SERIAL);
23 +
24 switch (sfp->sm_mod_state) {
25 default:
26 if (event == SFP_E_INSERT) {