Skip to content

Commit b5d007e

Browse files
robhancockseddavem330
authored andcommitted
net: phy: broadcom: Do not modify LED configuration for SFP module PHYs
bcm54xx_config_init was modifying the PHY LED configuration to enable link and activity indications. However, some SFP modules (such as Bel-Fuse SFP-1GBT-06) have no LEDs but use the LED outputs to control the SFP LOS signal, and modifying the LED settings will cause the LOS output to malfunction. Skip this configuration for PHYs which are bound to an SFP bus. Signed-off-by: Robert Hancock <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b834489 commit b5d007e

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

drivers/net/phy/broadcom.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,18 +366,24 @@ static int bcm54xx_config_init(struct phy_device *phydev)
366366

367367
bcm54xx_phydsp_config(phydev);
368368

369-
/* Encode link speed into LED1 and LED3 pair (green/amber).
369+
/* For non-SFP setups, encode link speed into LED1 and LED3 pair
370+
* (green/amber).
370371
* Also flash these two LEDs on activity. This means configuring
371372
* them for MULTICOLOR and encoding link/activity into them.
373+
* Don't do this for devices on an SFP module, since some of these
374+
* use the LED outputs to control the SFP LOS signal, and changing
375+
* these settings will cause LOS to malfunction.
372376
*/
373-
val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1) |
374-
BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
375-
bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val);
376-
377-
val = BCM_LED_MULTICOLOR_IN_PHASE |
378-
BCM5482_SHD_LEDS1_LED1(BCM_LED_MULTICOLOR_LINK_ACT) |
379-
BCM5482_SHD_LEDS1_LED3(BCM_LED_MULTICOLOR_LINK_ACT);
380-
bcm_phy_write_exp(phydev, BCM_EXP_MULTICOLOR, val);
377+
if (!phy_on_sfp(phydev)) {
378+
val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1) |
379+
BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
380+
bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val);
381+
382+
val = BCM_LED_MULTICOLOR_IN_PHASE |
383+
BCM5482_SHD_LEDS1_LED1(BCM_LED_MULTICOLOR_LINK_ACT) |
384+
BCM5482_SHD_LEDS1_LED3(BCM_LED_MULTICOLOR_LINK_ACT);
385+
bcm_phy_write_exp(phydev, BCM_EXP_MULTICOLOR, val);
386+
}
381387

382388
return 0;
383389
}

0 commit comments

Comments
 (0)