Skip to contentSkip to conversation

octeon_ep: Fix host hang issue during device reboot

PATCH Applied Sathesh B Edara 3 participants 3 messages Apr 29, 2025 – May 1, 2025

Subsystems (3)
lore
Share & tools
lore

Sathesh B Edara

author maintainer
#0 lore raw

PATCH 1/1 octeon_ep: Fix host hang issue during device reboot

When the host loses heartbeat messages from the device, the driver calls the device-specific ndo_stop function, which frees the resources. If the driver is unloaded in this scenario, it calls ndo_stop again, attempting to free resources that have already been freed, leading to a host hang issue. To resolve this, dev_close should be called instead of the device-specific stop function.dev_close internally calls ndo_stop to stop the network interface and performs additional cleanup tasks. During the driver unload process, if the device is already down, ndo_stop is not called.

Fixes 5cb96c29aa0e ("octeon_ep: add heartbeat monitor")
---
 drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeon_ep/octep_main.c +1 -1
index 0a679e95196f..24499bb36c00 100644
@@ -1223,7 +1223,7 @@ static void octep_hb_timeout_task(struct work_struct *work)
 		miss_cnt);
 	rtnl_lock();
 	if (netif_running(oct->netdev))
-		octep_stop(oct->netdev);
+		dev_close(oct->netdev);
 	rtnl_unlock();
 }
 
Signature · 1 line
2.36.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Sathesh B Edara

When the host loses heartbeat messages from the device, the driver calls the device-specific ndo_stop function, which frees the resources. If the driver is unloaded in this scenario, it calls ndo_stop again, attempting to free resources that have already been freed, leading to a host hang issue. To resolve this, dev_close should be called instead of the device-specific stop function.dev_close internally calls ndo_stop to stop the network interface and performs additional cleanup tasks. During the driver unload process, if the device is already down, ndo_stop is not called.

Quoted 2 lines
Fixes 5cb96c29aa0e ("octeon_ep: add heartbeat monitor")
#2 lore raw
In reply to Sathesh B Edara
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 12 lines · On Tue, 29 Apr 2025 04:46:24 -0700 you wrote:

When the host loses heartbeat messages from the device, the driver calls the device-specific ndo_stop function, which frees the resources. If the driver is unloaded in this scenario, it calls ndo_stop again, attempting to free resources that have already been freed, leading to a host hang issue. To resolve this, dev_close should be called instead of the device-specific stop function.dev_close internally calls ndo_stop to stop the network interface and performs additional cleanup tasks. During the driver unload process, if the device is already down, ndo_stop is not called.

Quoted 1 line

[...]

Here is the summary with links:
- [net] octeon_ep: Fix host hang issue during device reboot

    https://git.kernel.org/netdev/net/c/34f42736b325

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html