“12f5fbd77c70b35d9e62bcb7ea57e50b5126a805”上不存在“test/javax/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 a08928db 编写于 作者: A Andre Edich 提交者: Zheng Zengkai

net: phy: lan87xx: fix access to wrong register of LAN87xx

stable inclusion
from stable-5.10.37
commit c45cb22a5500c6f45fa6e966400f6afd51e685ad
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit fdb5cc6a ]

The function lan87xx_config_aneg_ext was introduced to configure
LAN95xxA but as well writes to undocumented register of LAN87xx.
This fix prevents that access.

The function lan87xx_config_aneg_ext gets more suitable for the new
behavior name.
Reported-by: NMåns Rullgård <mans@mansr.com>
Fixes: 05b35e7e ("smsc95xx: add phylib support")
Signed-off-by: NAndre Edich <andre.edich@microchip.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 ea31ed26
...@@ -152,10 +152,13 @@ static int lan87xx_config_aneg(struct phy_device *phydev) ...@@ -152,10 +152,13 @@ static int lan87xx_config_aneg(struct phy_device *phydev)
return genphy_config_aneg(phydev); return genphy_config_aneg(phydev);
} }
static int lan87xx_config_aneg_ext(struct phy_device *phydev) static int lan95xx_config_aneg_ext(struct phy_device *phydev)
{ {
int rc; int rc;
if (phydev->phy_id != 0x0007c0f0) /* not (LAN9500A or LAN9505A) */
return lan87xx_config_aneg(phydev);
/* Extend Manual AutoMDIX timer */ /* Extend Manual AutoMDIX timer */
rc = phy_read(phydev, PHY_EDPD_CONFIG); rc = phy_read(phydev, PHY_EDPD_CONFIG);
if (rc < 0) if (rc < 0)
...@@ -408,7 +411,7 @@ static struct phy_driver smsc_phy_driver[] = { ...@@ -408,7 +411,7 @@ static struct phy_driver smsc_phy_driver[] = {
.read_status = lan87xx_read_status, .read_status = lan87xx_read_status,
.config_init = smsc_phy_config_init, .config_init = smsc_phy_config_init,
.soft_reset = smsc_phy_reset, .soft_reset = smsc_phy_reset,
.config_aneg = lan87xx_config_aneg_ext, .config_aneg = lan95xx_config_aneg_ext,
/* IRQ related */ /* IRQ related */
.ack_interrupt = smsc_phy_ack_interrupt, .ack_interrupt = smsc_phy_ack_interrupt,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册