aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy/microchip.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-12-12 14:49:35 +0100
committerTakashi Iwai <tiwai@suse.de>2024-12-12 14:49:35 +0100
commit7b26bc6582b13a52a42a4a9765e8f30d58a81198 (patch)
tree80737d9bb4abf42b8e2061a5edacdfbe5ac9b7d6 /drivers/net/phy/microchip.c
parentb2e538a9827dd04ab5273bf4be8eb2edb84357b0 (diff)
parent255cc582e6e16191a20d54bcdbca6c91d3e90c5e (diff)
downloadlinux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.tar.gz
linux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.tar.bz2
linux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.zip
Merge tag 'asoc-fix-v6.12-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.13 A small pile of driver specific fixes, all quite small and not particularly major.
Diffstat (limited to 'drivers/net/phy/microchip.c')
-rw-r--r--drivers/net/phy/microchip.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c
index d3273bc0da4a..691969a4910f 100644
--- a/drivers/net/phy/microchip.c
+++ b/drivers/net/phy/microchip.c
@@ -351,6 +351,22 @@ static int lan88xx_config_aneg(struct phy_device *phydev)
static void lan88xx_link_change_notify(struct phy_device *phydev)
{
int temp;
+ int ret;
+
+ /* Reset PHY to ensure MII_LPA provides up-to-date information. This
+ * issue is reproducible only after parallel detection, as described
+ * in IEEE 802.3-2022, Section 28.2.3.1 ("Parallel detection function"),
+ * where the link partner does not support auto-negotiation.
+ */
+ if (phydev->state == PHY_NOLINK) {
+ ret = phy_init_hw(phydev);
+ if (ret < 0)
+ goto link_change_notify_failed;
+
+ ret = _phy_start_aneg(phydev);
+ if (ret < 0)
+ goto link_change_notify_failed;
+ }
/* At forced 100 F/H mode, chip may fail to set mode correctly
* when cable is switched between long(~50+m) and short one.
@@ -377,6 +393,11 @@ static void lan88xx_link_change_notify(struct phy_device *phydev)
temp |= LAN88XX_INT_MASK_MDINTPIN_EN_;
phy_write(phydev, LAN88XX_INT_MASK, temp);
}
+
+ return;
+
+link_change_notify_failed:
+ phydev_err(phydev, "Link change process failed %pe\n", ERR_PTR(ret));
}
/**