NVIDIA: SAUCE: net: phy: fix data corruption

BugLink: https://bugs.launchpad.net/bugs/2072591

Data corruption is happening in aqr107_config_init().
It's accessing address offset across struct phy_device boundary.
This is caused by misuse of SUPPORTED_* to linkmode_*_bit() api.
Change SUPPORTED_* to ETHTOOL_LINK_MODE_*_BIT for correct usage.

http://nvbugs/200781153
http://nvbugs/4088909
http://nvbugs/4090066

Signed-off-by: David Yu <davyu@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Abhilash G <abhilashg@nvidia.com>
Tested-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jacob Martin <jacob.martin@canonical.com>
Acked-by: Noah Wager <noah.wager@canonical.com>
Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
David Yu
2021-10-08 02:29:25 +00:00
committed by Noah Wager
parent 874a28a4f9
commit fac7eee999
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -800,8 +800,8 @@ static int aqr107_config_init(struct phy_device *phydev)
aqr107_chip_info(phydev);
/* Advertize flow control */
linkmode_set_bit(SUPPORTED_Pause, phydev->supported);
linkmode_set_bit(SUPPORTED_Asym_Pause, phydev->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, phydev->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, phydev->supported);
linkmode_copy(phydev->advertising, phydev->supported);
/* Configure flow control */
+2 -2
View File
@@ -543,8 +543,8 @@ static int rtl8211f_config_init(struct phy_device *phydev)
}
/* Advertise Flow Control */
linkmode_set_bit(SUPPORTED_Pause, phydev->supported);
linkmode_set_bit(SUPPORTED_Asym_Pause, phydev->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, phydev->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, phydev->supported);
linkmode_copy(phydev->advertising, phydev->supported);
ret = phy_modify_paged_changed(phydev, RTL8211F_WOL_MAC_PAGE, RTL8211F_WOL_REG_MAC_WORD_0, 0x0,