Thread (21 messages) flat view 21 messages, 3 authors, 2026-06-03

RE: [PATCH net-next v4 5/5] net: wangxun: implement pci_error_handlers ops

From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: 2026-06-02 02:29:18

quoted
+static void wx_io_resume(struct pci_dev *pdev)
+{
+	struct wx *wx = pci_get_drvdata(pdev);
+	struct net_device *netdev;
+	int err;
+
+	netdev = wx->netdev;
+	rtnl_lock();
+	if (netif_running(netdev)) {
+		err = netdev->netdev_ops->ndo_open(netdev);
+		if (err) {
+			wx_err(wx, "Failed to open netdev after
reset\n");
If you jump over the netif_device_attach(netdev);
I'm afraid the interface probably will be UP (IFF_UP set, because netif_running() returned true)
but permanently "detached" - the kernel's watchdog, TX queue wakeups,
and carrier-change notifications all check netif_device_present() and
will silently no-op.
If .ndo_open() fails during recovery, the device has not been successfully
reinitialized and therefore should remain detached. 
Calling netif_device_attach() unconditionally would expose an interface whose
queues, interrupts or other resources may not have been restored successfully.

 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help