mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-31 22:23:05 +00:00

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>
15 lines
338 B
C
15 lines
338 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/* Copyright (c) 2024 Hisilicon Limited. */
|
|
|
|
#ifndef __HBG_MDIO_H
|
|
#define __HBG_MDIO_H
|
|
|
|
#include "hbg_common.h"
|
|
|
|
int hbg_mdio_init(struct hbg_priv *priv);
|
|
void hbg_phy_start(struct hbg_priv *priv);
|
|
void hbg_phy_stop(struct hbg_priv *priv);
|
|
void hbg_fix_np_link_fail(struct hbg_priv *priv);
|
|
|
|
#endif
|