When CONFIG_OF_MDIO is not set, the cfg_dac_minus and cfg_dac_plus are
not set in dp83826_of_init(). This leads to a bad behavior in
dp83826_config_init: the phy initialization fails, after
MII_DP83826_VOD_CFG1 and MII_DP83826_VOD_CFG2 are set.
Fix it by setting the default value for both variables.
Fixes: d1d77120bc28 ("net: phy: dp83826: support TX data voltage tuning")
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
---
drivers/net/phy/dp83822.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
index 6599feca1967d705331d6e354205a2485ea962f2..88c49e8fe13e20e97191cddcd0885a6e075ae326 100644
--- a/drivers/net/phy/dp83822.c
+++ b/drivers/net/phy/dp83822.c
@@ -854,6 +854,10 @@ static int dp83822_of_init(struct phy_device *phydev)
static void dp83826_of_init(struct phy_device *phydev)
{
+ struct dp83822_private *dp83822 = phydev->priv;
+
+ dp83822->cfg_dac_minus = DP83826_CFG_DAC_MINUS_DEFAULT;
+ dp83822->cfg_dac_plus = DP83826_CFG_DAC_PLUS_DEFAULT;
}
#endif /* CONFIG_OF_MDIO */
--
2.39.5
Hi there !
On 3/3/25 6:05 PM, Jean-Michel Hautbois wrote:
> When CONFIG_OF_MDIO is not set, the cfg_dac_minus and cfg_dac_plus are
> not set in dp83826_of_init(). This leads to a bad behavior in
> dp83826_config_init: the phy initialization fails, after
> MII_DP83826_VOD_CFG1 and MII_DP83826_VOD_CFG2 are set.
>
> Fix it by setting the default value for both variables.
>
> Fixes: d1d77120bc28 ("net: phy: dp83826: support TX data voltage tuning")
>
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
> ---
> drivers/net/phy/dp83822.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
> index 6599feca1967d705331d6e354205a2485ea962f2..88c49e8fe13e20e97191cddcd0885a6e075ae326 100644
> --- a/drivers/net/phy/dp83822.c
> +++ b/drivers/net/phy/dp83822.c
> @@ -854,6 +854,10 @@ static int dp83822_of_init(struct phy_device *phydev)
>
> static void dp83826_of_init(struct phy_device *phydev)
> {
> + struct dp83822_private *dp83822 = phydev->priv;
> +
> + dp83822->cfg_dac_minus = DP83826_CFG_DAC_MINUS_DEFAULT;
> + dp83822->cfg_dac_plus = DP83826_CFG_DAC_PLUS_DEFAULT;
> }
> #endif /* CONFIG_OF_MDIO */
>
>
Gentle ping to know if this patch is ok (patch 2/2 is not) and if so,
should I repost a v2 maybe ?
Thanks !
JM
© 2016 - 2026 Red Hat, Inc.