Skip to content

Commit

Permalink
net: phy: c45: use "supported_eee" instead of supported for access va…
Browse files Browse the repository at this point in the history
…lidation

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 <yujie.liu@intel.com>
Link: https://lore.kernel.org/oe-lkp/202302211644.c12d19de-yujie.liu@intel.com
Fixes: 022c3f8 ("net: phy: add genphy_c45_ethtool_get/set_eee() support")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Oleksij Rempel authored and Paolo Abeni committed Feb 23, 2023
1 parent c749e3f commit e209519
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/phy/phy-c45.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ int genphy_c45_write_eee_adv(struct phy_device *phydev, unsigned long *adv)
{
int val, changed;

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

/* In eee_broken_modes are stored MDIO_AN_EEE_ADV specific raw
Expand Down Expand Up @@ -726,7 +726,7 @@ static int genphy_c45_read_eee_adv(struct phy_device *phydev,
{
int val;

if (linkmode_intersects(phydev->supported, PHY_EEE_CAP1_FEATURES)) {
if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) {
/* IEEE 802.3-2018 45.2.7.13 EEE advertisement 1
* (Register 7.60)
*/
Expand Down Expand Up @@ -762,7 +762,7 @@ static int genphy_c45_read_eee_lpa(struct phy_device *phydev,
{
int val;

if (linkmode_intersects(phydev->supported, PHY_EEE_CAP1_FEATURES)) {
if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) {
/* IEEE 802.3-2018 45.2.7.14 EEE link partner ability 1
* (Register 7.61)
*/
Expand Down

0 comments on commit e209519

Please sign in to comment.