net: hibmcge: fix wrong ndo.open() after reset fail issue.
authorJijie Shao <shaojijie@huawei.com>
Sat, 17 May 2025 09:58:28 +0000 (17:58 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 May 2025 22:53:51 +0000 (15:53 -0700)
commit1b45443b84872c010b36dfc2681413bb1a10011a
treed854553657e801e6e769f7bf6c2fbf0fc76ea694
parent009970506c92816c857e1705cf6db68c9147d39f
net: hibmcge: fix wrong ndo.open() after reset fail issue.

If the driver reset fails, it may not work properly.
Therefore, the ndo.open() operation should be rejected.

In this patch, the driver calls netif_device_detach()
before the reset and calls netif_device_attach()
after the reset succeeds. If the reset fails,
netif_device_attach() is not called. Therefore,
netdev does not present and cannot be opened.

If reset fails, only the PCI reset (via sysfs)
can be used to attempt recovery.

Fixes: 3f5a61f6d504 ("net: hibmcge: Add reset supported in this module")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250517095828.1763126-3-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c