netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: phy: broadcom: hook up soft_reset for BCM54616S
@ 2022-01-18 21:52 Robert Hancock
  2022-01-18 22:03 ` Florian Fainelli
  2022-01-20 11:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Hancock @ 2022-01-18 21:52 UTC (permalink / raw)
  To: netdev
  Cc: f.fainelli, andrew, hkallweit1, linux, davem, kuba,
	bcm-kernel-feedback-list, Robert Hancock

A problem was encountered with the Bel-Fuse 1GBT-SFP05 SFP module (which
is a 1 Gbps copper module operating in SGMII mode with an internal
BCM54616S PHY device) using the Xilinx AXI Ethernet MAC core, where the
module would work properly on the initial insertion or boot of the
device, but after the device was rebooted, the link would either only
come up at 100 Mbps speeds or go up and down erratically.

I found no meaningful changes in the PHY configuration registers between
the working and non-working boots, but the status registers seemed to
have a lot of error indications set on the SERDES side of the device on
the non-working boot. I suspect the problem is that whatever happens on
the SGMII link when the device is rebooted and the FPGA logic gets
reloaded ends up putting the module's onboard PHY into a bad state.

Since commit 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")
the genphy_soft_reset call is not made automatically by the PHY core
unless the callback is explicitly specified in the driver structure. For
most of these Broadcom devices, there is probably a hardware reset that
gets asserted to reset the PHY during boot, however for SFP modules
(where the BCM54616S is commonly found) no such reset line exists, so if
the board keeps the SFP cage powered up across a reboot, it will end up
with no reset occurring during reboots.

Hook up the genphy_soft_reset callback for BCM54616S to ensure that a
PHY reset is performed before the device is initialized. This appears to
fix the issue with erratic operation after a reboot with this SFP
module.

Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 drivers/net/phy/broadcom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index bb5104ae4610..3c683e0e40e9 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -854,6 +854,7 @@ static struct phy_driver broadcom_drivers[] = {
 	.phy_id_mask	= 0xfffffff0,
 	.name		= "Broadcom BCM54616S",
 	/* PHY_GBIT_FEATURES */
+	.soft_reset     = genphy_soft_reset,
 	.config_init	= bcm54xx_config_init,
 	.config_aneg	= bcm54616s_config_aneg,
 	.config_intr	= bcm_phy_config_intr,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phy: broadcom: hook up soft_reset for BCM54616S
  2022-01-18 21:52 [PATCH net] net: phy: broadcom: hook up soft_reset for BCM54616S Robert Hancock
@ 2022-01-18 22:03 ` Florian Fainelli
  2022-01-20 11:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2022-01-18 22:03 UTC (permalink / raw)
  To: Robert Hancock, netdev
  Cc: andrew, hkallweit1, linux, davem, kuba, bcm-kernel-feedback-list

On 1/18/22 1:52 PM, Robert Hancock wrote:
> A problem was encountered with the Bel-Fuse 1GBT-SFP05 SFP module (which
> is a 1 Gbps copper module operating in SGMII mode with an internal
> BCM54616S PHY device) using the Xilinx AXI Ethernet MAC core, where the
> module would work properly on the initial insertion or boot of the
> device, but after the device was rebooted, the link would either only
> come up at 100 Mbps speeds or go up and down erratically.
> 
> I found no meaningful changes in the PHY configuration registers between
> the working and non-working boots, but the status registers seemed to
> have a lot of error indications set on the SERDES side of the device on
> the non-working boot. I suspect the problem is that whatever happens on
> the SGMII link when the device is rebooted and the FPGA logic gets
> reloaded ends up putting the module's onboard PHY into a bad state.
> 
> Since commit 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")
> the genphy_soft_reset call is not made automatically by the PHY core
> unless the callback is explicitly specified in the driver structure. For
> most of these Broadcom devices, there is probably a hardware reset that
> gets asserted to reset the PHY during boot, however for SFP modules
> (where the BCM54616S is commonly found) no such reset line exists, so if
> the board keeps the SFP cage powered up across a reboot, it will end up
> with no reset occurring during reboots.
> 
> Hook up the genphy_soft_reset callback for BCM54616S to ensure that a
> PHY reset is performed before the device is initialized. This appears to
> fix the issue with erratic operation after a reboot with this SFP
> module.
> 
> Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phy: broadcom: hook up soft_reset for BCM54616S
  2022-01-18 21:52 [PATCH net] net: phy: broadcom: hook up soft_reset for BCM54616S Robert Hancock
  2022-01-18 22:03 ` Florian Fainelli
@ 2022-01-20 11:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-20 11:30 UTC (permalink / raw)
  To: Robert Hancock
  Cc: netdev, f.fainelli, andrew, hkallweit1, linux, davem, kuba,
	bcm-kernel-feedback-list

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 18 Jan 2022 15:52:43 -0600 you wrote:
> A problem was encountered with the Bel-Fuse 1GBT-SFP05 SFP module (which
> is a 1 Gbps copper module operating in SGMII mode with an internal
> BCM54616S PHY device) using the Xilinx AXI Ethernet MAC core, where the
> module would work properly on the initial insertion or boot of the
> device, but after the device was rebooted, the link would either only
> come up at 100 Mbps speeds or go up and down erratically.
> 
> [...]

Here is the summary with links:
  - [net] net: phy: broadcom: hook up soft_reset for BCM54616S
    https://git.kernel.org/netdev/net/c/d15c7e875d44

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-20 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 21:52 [PATCH net] net: phy: broadcom: hook up soft_reset for BCM54616S Robert Hancock
2022-01-18 22:03 ` Florian Fainelli
2022-01-20 11:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).