diff options
| author | Zhang Yunfei <zhangyunfei1@kylinos.cn> | 2026-09-30 17:47:47 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-05 17:40:00 -0700 |
| commit | 6986ff35f5bb2acf994468d40af5b9494c5b6c3e (patch) | |
| tree | de760922026fb22b8b81179bd9beac7b61eb265d /include/linux/debugobjects.h | |
| parent | 6451576b53961f620de641c0ab3bfa8eabc7184b (diff) | |
net: ngbe: propagate resume errors to the PM core
After a failed resume from suspend, the device stays detached from
the networking stack: every attempt to bring the interface up fails
the netif_device_present() check in __dev_open() with -ENODEV,
while the PM core is told that resume succeeded.
ngbe_resume() declares err as u32 and unconditionally returns 0:
the return value of ngbe_reset_hw() is ignored entirely, and
failures of wx_init_interrupt_scheme() and ngbe_open() are silently
swallowed. The interrupt scheme torn down at suspend is never
rebuilt, so the device cannot self-heal.
Fix the type to int and propagate the errors, making the whole tail
of the resume path consistent with the pci_enable_device_mem()
failure path at the top. If the hardware reset fails, return early:
the remaining resume steps cannot succeed. The suspend path may
already have torn the interface down (ngbe_close() and
wx_clear_interrupt_scheme()), leaving freed rings and IRQs behind
while netif_running() still reports true, so set WX_STATE_RES_FREED
on every failing return, the same mark ngbe_down_suspend() uses for
the PCI error recovery path: a later ngbe_close() skips the
teardown of the already-freed state, and ngbe_up_complete() clears
the bit again so later opens are unaffected. This is safe on the
wx_init_interrupt_scheme() failure path too, as it cleans up after
itself.
Found by manual code inspection of the PM error paths; the missing
ngbe_reset_hw() propagation was reported by Sashiko in its review
of v1. The failure paths are unreachable without fault injection:
a loadable test module injects failures into ngbe_reset_hw(),
wx_init_interrupt_scheme() and ngbe_open(). In a QEMU VM the
unfixed driver hits the kernel "Trying to free already-free IRQ"
warning on the post-suspend close; with the fix, the error is
reported and no warning appears. No physical ngbe device is
involved.
Cc: stable+noautosel@kernel.org # LLM fix, not seen in real life
Fixes: 6963e463256e ("net: ngbe: add Wake on Lan support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260917090050.1927999-1-zhangyunfei1%40kylinos.cn
Signed-off-by: Zhang Yunfei <zhangyunfei1@kylinos.cn>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260930094748.1198085-2-zhangyunfei1@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
