Thread (9 messages) 9 messages, 3 authors, 6d ago

Re: [PATCH net 1/2] net: ngbe: propagate resume errors to the PM core

From: "mengyuanlou@net-swift.com" <mengyuanlou@net-swift.com>
Date: 2026-09-18 03:57:24
Also in: lkml, stable

2026年9月17日 17:00,Zhang Yunfei [off-list ref] 写道:

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 <redacted>
Reviewed-by: Mengyuan Lou <mengyuanlou@net-swift.com>
quoted hunk ↗ jump to hunk
---
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
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help