Commit 067471e8 authored by Josua Mayer's avatar Josua Mayer Committed by Greg Kroah-Hartman

net: mvmdio: defer probe of orion-mdio if a clock is not ready

[ Upstream commit 433a06d7 ]

Defer probing of the orion-mdio interface when getting a clock returns
EPROBE_DEFER. This avoids locking up the Armada 8k SoC when mdio is used
before all clocks have been enabled.
Signed-off-by: default avatarJosua Mayer <josua@solid-run.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fd7c22ba
...@@ -321,6 +321,10 @@ static int orion_mdio_probe(struct platform_device *pdev) ...@@ -321,6 +321,10 @@ static int orion_mdio_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(dev->clk); i++) { for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
dev->clk[i] = of_clk_get(pdev->dev.of_node, i); dev->clk[i] = of_clk_get(pdev->dev.of_node, i);
if (PTR_ERR(dev->clk[i]) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
goto out_clk;
}
if (IS_ERR(dev->clk[i])) if (IS_ERR(dev->clk[i]))
break; break;
clk_prepare_enable(dev->clk[i]); clk_prepare_enable(dev->clk[i]);
...@@ -362,6 +366,7 @@ static int orion_mdio_probe(struct platform_device *pdev) ...@@ -362,6 +366,7 @@ static int orion_mdio_probe(struct platform_device *pdev)
if (dev->err_interrupt > 0) if (dev->err_interrupt > 0)
writel(0, dev->regs + MVMDIO_ERR_INT_MASK); writel(0, dev->regs + MVMDIO_ERR_INT_MASK);
out_clk:
for (i = 0; i < ARRAY_SIZE(dev->clk); i++) { for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
if (IS_ERR(dev->clk[i])) if (IS_ERR(dev->clk[i]))
break; break;
......
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