Commit 90f522a2 authored by Eugeniy Paltsev's avatar Eugeniy Paltsev Committed by David S. Miller

NET: dwmac: Make dwmac reset unconditional

Unconditional reset dwmac before HW init if reset controller is present.

In existing implementation we reset dwmac only after second module
probing:
(module load -> unload -> load again [reset happens])

Now we reset dwmac at every module load:
(module load [reset happens] -> unload -> load again [reset happens])

Also some reset controllers have only reset callback instead of
assert + deassert callbacks pair, so handle this case.
Signed-off-by: default avatarEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63679112
...@@ -4120,8 +4120,15 @@ int stmmac_dvr_probe(struct device *device, ...@@ -4120,8 +4120,15 @@ int stmmac_dvr_probe(struct device *device,
if ((phyaddr >= 0) && (phyaddr <= 31)) if ((phyaddr >= 0) && (phyaddr <= 31))
priv->plat->phy_addr = phyaddr; priv->plat->phy_addr = phyaddr;
if (priv->plat->stmmac_rst) if (priv->plat->stmmac_rst) {
ret = reset_control_assert(priv->plat->stmmac_rst);
reset_control_deassert(priv->plat->stmmac_rst); reset_control_deassert(priv->plat->stmmac_rst);
/* Some reset controllers have only reset callback instead of
* assert + deassert callbacks pair.
*/
if (ret == -ENOTSUPP)
reset_control_reset(priv->plat->stmmac_rst);
}
/* Init MAC and get the capabilities */ /* Init MAC and get the capabilities */
ret = stmmac_hw_init(priv); ret = stmmac_hw_init(priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment