]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: hibmcge: fix the inappropriate netif_device_detach()
authorJijie Shao <shaojijie@huawei.com>
Sat, 25 Oct 2025 01:46:42 +0000 (09:46 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 29 Oct 2025 02:11:04 +0000 (19:11 -0700)
commit7e2958aee59ceb30ef153387741d12385b712250
treee46eeffa3cf8fd07a1298da2543e983321f229af
parent71eb8d1e07562b43bebc0c2721699814b43fd83d
net: hibmcge: fix the inappropriate netif_device_detach()

current, driver will call netif_device_detach() in
pci_error_handlers.error_detected() and do reset in
pci_error_handlers.slot_reset().
However, if pci_error_handlers.slot_reset() is not called
after pci_error_handlers.error_detected(),
driver will be detached and unable to recover.

drivers/pci/pcie/err.c/report_error_detected() says:
  If any device in the subtree does not have an error_detected
  callback, PCI_ERS_RESULT_NO_AER_DRIVER prevents subsequent
  error callbacks of any device in the subtree, and will
  exit in the disconnected error state.

Therefore, when the hibmcge device and other devices that do not
support the error_detected callback are under the same subtree,
hibmcge will be unable to do slot_reset even for non-fatal errors.

This path move netif_device_detach() from error_detected() to slot_reset(),
ensuring that detach and reset are always executed together.

Fixes: fd394a334b1c ("net: hibmcge: Add support for abnormal irq handling feature")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20251025014642.265259-4-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c