Skip to content

Commit 9dcc8f4

Browse files
repkgregkh
authored andcommitted
net: stmmac: remove unneeded stmmac_poll_controller
[ Upstream commit 3eef855 ] Using netconsole netpoll_poll_dev could be called from interrupt context, thus using disable_irq() would cause the following kernel warning with CONFIG_DEBUG_ATOMIC_SLEEP enabled: BUG: sleeping function called from invalid context at kernel/irq/manage.c:137 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 10, name: ksoftirqd/0 CPU: 0 PID: 10 Comm: ksoftirqd/0 Tainted: G W 5.15.42-00075-g816b502b2298-dirty #117 Hardware name: aml (r1) (DT) Call trace: dump_backtrace+0x0/0x270 show_stack+0x14/0x20 dump_stack_lvl+0x8c/0xac dump_stack+0x18/0x30 ___might_sleep+0x150/0x194 __might_sleep+0x64/0xbc synchronize_irq+0x8c/0x150 disable_irq+0x2c/0x40 stmmac_poll_controller+0x140/0x1a0 netpoll_poll_dev+0x6c/0x220 netpoll_send_skb+0x308/0x390 netpoll_send_udp+0x418/0x760 write_msg+0x118/0x140 [netconsole] console_unlock+0x404/0x500 vprintk_emit+0x118/0x250 dev_vprintk_emit+0x19c/0x1cc dev_printk_emit+0x90/0xa8 __dev_printk+0x78/0x9c _dev_warn+0xa4/0xbc ath10k_warn+0xe8/0xf0 [ath10k_core] ath10k_htt_txrx_compl_task+0x790/0x7fc [ath10k_core] ath10k_pci_napi_poll+0x98/0x1f4 [ath10k_pci] __napi_poll+0x58/0x1f4 net_rx_action+0x504/0x590 _stext+0x1b8/0x418 run_ksoftirqd+0x74/0xa4 smpboot_thread_fn+0x210/0x3c0 kthread+0x1fc/0x210 ret_from_fork+0x10/0x20 Since [0] .ndo_poll_controller is only needed if driver doesn't or partially use NAPI. Because stmmac does so, stmmac_poll_controller can be removed fixing the above warning. [0] commit ac3d9dd ("netpoll: make ndo_poll_controller() optional") Cc: <[email protected]> # 5.15.x Fixes: 47dd7a5 ("net: add support for STMicroelectronics Ethernet controllers") Signed-off-by: Remi Pommarel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/1c156a6d8c9170bd6a17825f2277115525b4d50f.1696429960.git.repk@triplefau.lt Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 121c6ad commit 9dcc8f4

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5940,33 +5940,6 @@ static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
59405940
return IRQ_HANDLED;
59415941
}
59425942

5943-
#ifdef CONFIG_NET_POLL_CONTROLLER
5944-
/* Polling receive - used by NETCONSOLE and other diagnostic tools
5945-
* to allow network I/O with interrupts disabled.
5946-
*/
5947-
static void stmmac_poll_controller(struct net_device *dev)
5948-
{
5949-
struct stmmac_priv *priv = netdev_priv(dev);
5950-
int i;
5951-
5952-
/* If adapter is down, do nothing */
5953-
if (test_bit(STMMAC_DOWN, &priv->state))
5954-
return;
5955-
5956-
if (priv->plat->multi_msi_en) {
5957-
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
5958-
stmmac_msi_intr_rx(0, &priv->dma_conf.rx_queue[i]);
5959-
5960-
for (i = 0; i < priv->plat->tx_queues_to_use; i++)
5961-
stmmac_msi_intr_tx(0, &priv->dma_conf.tx_queue[i]);
5962-
} else {
5963-
disable_irq(dev->irq);
5964-
stmmac_interrupt(dev->irq, dev);
5965-
enable_irq(dev->irq);
5966-
}
5967-
}
5968-
#endif
5969-
59705943
/**
59715944
* stmmac_ioctl - Entry point for the Ioctl
59725945
* @dev: Device pointer.
@@ -6802,9 +6775,6 @@ static const struct net_device_ops stmmac_netdev_ops = {
68026775
.ndo_eth_ioctl = stmmac_ioctl,
68036776
.ndo_setup_tc = stmmac_setup_tc,
68046777
.ndo_select_queue = stmmac_select_queue,
6805-
#ifdef CONFIG_NET_POLL_CONTROLLER
6806-
.ndo_poll_controller = stmmac_poll_controller,
6807-
#endif
68086778
.ndo_set_mac_address = stmmac_set_mac_address,
68096779
.ndo_vlan_rx_add_vid = stmmac_vlan_rx_add_vid,
68106780
.ndo_vlan_rx_kill_vid = stmmac_vlan_rx_kill_vid,

0 commit comments

Comments
 (0)