]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
octeon_ep: Fix host hang issue during device reboot
authorSathesh B Edara <sedara@marvell.com>
Tue, 29 Apr 2025 11:46:24 +0000 (04:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:44:02 +0000 (09:44 +0200)
[ Upstream commit 34f42736b325287a7b2ce37e415838f539767bda ]

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")
Signed-off-by: Sathesh B Edara <sedara@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250429114624.19104-1-sedara@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeon_ep/octep_main.c

index 6f1fe7e283d4eba45b4e1e8796e8a79521974761..7a30095b3486f3d22ee9c7d3c90cbf3a9189b355 100644 (file)
@@ -917,7 +917,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();
 }