ngbe_resume() declares err as u32 and unconditionally returns 0, so failures of wx_init_interrupt_scheme() or ngbe_open() are silently swallowed. The device stays in netif_device_detach() state with a broken interrupt scheme, the PM core is told the resume succeeded, and the netdev never appears in the networking stack again: the reset task also bails out early on the missing netif_device_present() check, so the device cannot self-heal. Fix the type to int and return err, making the tail of the resume path consistent with the pci_enable_device_mem() failure path at the top, which already propagates its error. A failed resume then becomes visible to the PM core and the device can be re-probed. Fixes: 6963e463256e ("net: ngbe: add Wake on Lan support") Cc: stable@vger.kernel.org Signed-off-by: Zhang Yunfei --- drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c index 855dc963c610..6d8289e2532d 100644 --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c @@ -954,7 +954,7 @@ static int ngbe_resume(struct pci_dev *pdev) { struct net_device *netdev; struct wx *wx; - u32 err; + int err; wx = pci_get_drvdata(pdev); netdev = wx->netdev; @@ -977,7 +977,7 @@ static int ngbe_resume(struct pci_dev *pdev) netif_device_attach(netdev); rtnl_unlock(); - return 0; + return err; } static struct pci_driver ngbe_driver = { -- 2.25.1 ngbe_open() sets the WX_CFG_PORT_CTL_DRV_LOAD bit via wx_control_hw(wx, true) to tell the management firmware that the host driver has taken over the port (NCSI/OOB firmware stops using its management channel). Every error path of ngbe_open() returns without clearing it, leaving rings, IRQs and the PHY torn down while the firmware still believes the host owns the port, an inconsistent driver-firmware handshake state that persists until the next successful ifup. Roll the bit back on all open error paths, matching ngbe_close() and ngbe_dev_shutdown(), which already clear it. Fixes: e7956139a6cf ("net: ngbe: Add irqs request flow") Cc: stable@vger.kernel.org Signed-off-by: Zhang Yunfei --- drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c index 6d8289e2532d..88f00b72a512 100644 --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c @@ -494,7 +494,7 @@ static int ngbe_open(struct net_device *netdev) err = wx_setup_resources(wx); if (err) - return err; + goto err_control_hw; wx_configure(wx); @@ -526,6 +526,8 @@ static int ngbe_open(struct net_device *netdev) err_free_resources: wx_free_isb_resources(wx); wx_free_resources(wx); +err_control_hw: + wx_control_hw(wx, false); return err; } -- 2.25.1