[PATCH net v3] octeon_ep_vf: Resolve netdevice usage count issue

From: Sathesh B Edara
Date: Wed Apr 16 2025 - 06:26:22 EST


The netdevice usage count increases during transmit queue timeouts
because netdev_hold is called in ndo_tx_timeout, scheduling a task
to reinitialize the card. Although netdev_put is called at the end
of the scheduled work, rtnl_unlock checks the reference count during
cleanup. This could cause issues if transmit timeout is called on
multiple queues. Therefore, netdev_hold and netdev_put have been removed.

Fixes: cb7dd712189f ("octeon_ep_vf: Add driver framework and device initialization")
Signed-off-by: Sathesh B Edara <sedara@xxxxxxxxxxx>
---
Changes:
V3:
- Added more description to commit message
V2:
- Removed redundant call

drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
index 18c922dd5fc6..5d033bc66bdf 100644
--- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
@@ -819,7 +819,6 @@ static void octep_vf_tx_timeout_task(struct work_struct *work)
octep_vf_open(netdev);
}
rtnl_unlock();
- netdev_put(netdev, NULL);
}

/**
@@ -834,7 +833,6 @@ static void octep_vf_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{
struct octep_vf_device *oct = netdev_priv(netdev);

- netdev_hold(netdev, NULL, GFP_ATOMIC);
schedule_work(&oct->tx_timeout_task);
}

--
2.36.0