Skip to content

Commit e209519

Browse files
oleremPaolo Abeni
authored andcommitted
net: phy: c45: use "supported_eee" instead of supported for access validation
Make sure we use proper variable to validate access to potentially not supported registers. Otherwise we will get false read/write errors. Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/oe-lkp/[email protected] Fixes: 022c3f8 ("net: phy: add genphy_c45_ethtool_get/set_eee() support") Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent c749e3f commit e209519

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/phy/phy-c45.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ int genphy_c45_write_eee_adv(struct phy_device *phydev, unsigned long *adv)
674674
{
675675
int val, changed;
676676

677-
if (linkmode_intersects(phydev->supported, PHY_EEE_CAP1_FEATURES)) {
677+
if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) {
678678
val = linkmode_to_mii_eee_cap1_t(adv);
679679

680680
/* In eee_broken_modes are stored MDIO_AN_EEE_ADV specific raw
@@ -726,7 +726,7 @@ static int genphy_c45_read_eee_adv(struct phy_device *phydev,
726726
{
727727
int val;
728728

729-
if (linkmode_intersects(phydev->supported, PHY_EEE_CAP1_FEATURES)) {
729+
if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) {
730730
/* IEEE 802.3-2018 45.2.7.13 EEE advertisement 1
731731
* (Register 7.60)
732732
*/
@@ -762,7 +762,7 @@ static int genphy_c45_read_eee_lpa(struct phy_device *phydev,
762762
{
763763
int val;
764764

765-
if (linkmode_intersects(phydev->supported, PHY_EEE_CAP1_FEATURES)) {
765+
if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) {
766766
/* IEEE 802.3-2018 45.2.7.14 EEE link partner ability 1
767767
* (Register 7.61)
768768
*/

0 commit comments

Comments
 (0)