[PATCH net 0/5] net: hns3: fix configuration deadlocks and refactor link setup
From: Jijie Shao
Date: Wed Jun 17 2026 - 07:43:52 EST
This patch series addresses a sequence of link configuration deadlocks
and parameter contamination issues in the hns3 network driver, which
typically occur during hardware resets or driver initialization under
specific user-configured scenarios.
The bugs root from asynchronous discrepancies between the MAC state machine
and cached user requests during sudden hardware resets, leading to invalid
parameter combos or frozen registers.
The series is organized as follows:
- Patch 1 refactors the ethtool link settings entry path to unify copper
port handling (both native kernel PHY_LIB and firmware-controlled PHY)
and ensures req_xxx configurations are uniformly saved across all modes.
- Patch 2 refactors the MAC initialization by extracting the autoneg and
speed configuration logic out of hclge_mac_init() into a dedicated
helper function.
- Patch 3 fixes a permanent link-down deadlock after a reset by
ensuring that the driver caches and uses the user's intended autoneg
/speed settings (req_***) rather than un-synchronized runtime states
or SPEED_UNKNOWN tokens.
- Patch 4 fixes a link loss issue on optical ports during
initialization by differentiating autoneg default values between
copper and fiber media types.
- Patch 5 fixes an initialization (probe) failure caused by lane_num
contamination from previous active lifecycle by introducing
req_lane_num=0, which leverages firmware automatic lane matching.
Shuaisong Yang (5):
net: hns3: unify copper port ksettings configuration path
net: hns3: refactor MAC autoneg and speed configuration
net: hns3: fix permanent link down deadlock after reset
net: hns3: differentiate autoneg default values between copper and
fiber
net: hns3: fix init failure caused by lane_num contamination
.../ethernet/hisilicon/hns3/hns3_ethtool.c | 26 ++---
.../hisilicon/hns3/hns3pf/hclge_main.c | 100 ++++++++++++++----
.../hisilicon/hns3/hns3pf/hclge_main.h | 1 +
3 files changed, 90 insertions(+), 37 deletions(-)
base-commit: 406e8a651a7b854c41fecd5117bb282b3a6c2c6b
--
2.33.0