Re: [PATCH 5.10 46/52] net: stmmac: power up/down serdes in stmmac_open/release
From: Pavel Machek
Date: Tue Oct 04 2022 - 06:16:40 EST
Hi!
> The issue is related with serdes which impacts clock. There is
> serdes in ADLink I-Pi SMARC board ethernet controller. Please refer to
> commit b9663b7ca6ff78 ("net: stmmac: Enable SERDES power up/down sequence")
> for detial. When issue is reproduced, DMA engine clock is not ready
> because serdes is not powered up.
I don't believe you got the error handling right.
> index 27b7bb64a028..41e71a26b1ad 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -2907,6 +2907,15 @@ static int stmmac_open(struct net_device *dev)
> goto init_error;
> }
>
> + if (priv->plat->serdes_powerup) {
> + ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
> + if (ret < 0) {
> + netdev_err(priv->dev, "%s: Serdes powerup failed\n",
> + __func__);
> + goto init_error;
> + }
> + }
Ok, so serdes is powered up here.
> ret = stmmac_hw_setup(dev, true);
> if (ret < 0) {
> netdev_err(priv->dev, "%s: Hw setup failed\n",
But this goes to init_error, and exits w/o powering serdes down. Error
handling needs to be fixed AFAICT.
Best regards,
Pavel
--
echo 'DENX Software Engineering GmbH, Managing Director: Wolfgang Denk'
echo 'HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany'
Attachment:
signature.asc
Description: PGP signature