net: hibmcge: Add support for mac link exception handling feature
authorJijie Shao <shaojijie@huawei.com>
Fri, 28 Feb 2025 11:54:09 +0000 (19:54 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 4 Mar 2025 12:45:33 +0000 (13:45 +0100)
commite0306637e85da84a0695452f42dc29a552051402
tree283913ec5e399144896a842883b005cb5f6ce5ad
parentfd394a334b1c29caeae45f15d8b99b77c881bc63
net: hibmcge: Add support for mac link exception handling feature

If the rate changed frequently, the PHY link ok,
but the MAC link maybe fails.
As a result, the network port is unavailable.

According to the documents of the chip,
core_reset needs to do to fix the fault.

In hw_adjus_link(), the core_reset is added to try to
ensure that MAC link status is normal.
In addition, MAC link failure detection is added.
If the MAC link fails after core_reset, driver invokes
the phy_stop() and phy_start() to re-link.

Due to phydev->lock, re-link cannot be triggered
in adjust_link(). Therefore, this operation
is invoked in a scheduled task.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.h
drivers/net/ethernet/hisilicon/hibmcge/hbg_reg.h