Skip to content

Commit c2e0c58

Browse files
Wei Fangkuba-moo
authored andcommitted
net: fec: remove .ndo_poll_controller to avoid deadlocks
There is a deadlock issue found in sungem driver, please refer to the commit ac0a230 ("eth: sungem: remove .ndo_poll_controller to avoid deadlocks"). The root cause of the issue is that netpoll is in atomic context and disable_irq() is called by .ndo_poll_controller interface of sungem driver, however, disable_irq() might sleep. After analyzing the implementation of fec_poll_controller(), the fec driver should have the same issue. Due to the fec driver uses NAPI for TX completions, the .ndo_poll_controller is unnecessary to be implemented in the fec driver, so fec_poll_controller() can be safely removed. Fixes: 7f5c6ad ("net/fec: add poll controller function for fec nic") Signed-off-by: Wei Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ad50658 commit c2e0c58

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,29 +3674,6 @@ fec_set_mac_address(struct net_device *ndev, void *p)
36743674
return 0;
36753675
}
36763676

3677-
#ifdef CONFIG_NET_POLL_CONTROLLER
3678-
/**
3679-
* fec_poll_controller - FEC Poll controller function
3680-
* @dev: The FEC network adapter
3681-
*
3682-
* Polled functionality used by netconsole and others in non interrupt mode
3683-
*
3684-
*/
3685-
static void fec_poll_controller(struct net_device *dev)
3686-
{
3687-
int i;
3688-
struct fec_enet_private *fep = netdev_priv(dev);
3689-
3690-
for (i = 0; i < FEC_IRQ_NUM; i++) {
3691-
if (fep->irq[i] > 0) {
3692-
disable_irq(fep->irq[i]);
3693-
fec_enet_interrupt(fep->irq[i], dev);
3694-
enable_irq(fep->irq[i]);
3695-
}
3696-
}
3697-
}
3698-
#endif
3699-
37003677
static inline void fec_enet_set_netdev_features(struct net_device *netdev,
37013678
netdev_features_t features)
37023679
{
@@ -4003,9 +3980,6 @@ static const struct net_device_ops fec_netdev_ops = {
40033980
.ndo_tx_timeout = fec_timeout,
40043981
.ndo_set_mac_address = fec_set_mac_address,
40053982
.ndo_eth_ioctl = phy_do_ioctl_running,
4006-
#ifdef CONFIG_NET_POLL_CONTROLLER
4007-
.ndo_poll_controller = fec_poll_controller,
4008-
#endif
40093983
.ndo_set_features = fec_set_features,
40103984
.ndo_bpf = fec_enet_bpf,
40113985
.ndo_xdp_xmit = fec_enet_xdp_xmit,

0 commit comments

Comments
 (0)