Skip to content

Commit cc2180a

Browse files
committed
Merge branch 'mvpp2-fixes'
Maxime Chevallier says: ==================== net: mvpp2: Fix hangs when starting some interfaces on 7k/8k Armada 7K / 8K clock management has recently been reworked, see : commit c7e92de ("clk: mvebu: cp110: Fix clock tree representation") I have been experiencing overall system hangs on MacchiatoBin when starting the eth1 interface since then. It turns out some clocks dependencies were missing in the PPv2 and xmdio driver, the clock rework made this visible. This is the V2 series, that adds support for the missing 'MG Core clock' in mvpp2, and fixes an issue with the error path for the axi_clk. Thanks to Gregory Clement for finding the root cause of this bug. V2 : Remove all DT patches from this series, they will be merged through the mvebu tree. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents c55ca68 + 9af771c commit cc2180a

File tree

1 file changed

+23
-7
lines changed
  • drivers/net/ethernet/marvell

1 file changed

+23
-7
lines changed

drivers/net/ethernet/marvell/mvpp2.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ struct mvpp2 {
942942
struct clk *pp_clk;
943943
struct clk *gop_clk;
944944
struct clk *mg_clk;
945+
struct clk *mg_core_clk;
945946
struct clk *axi_clk;
946947

947948
/* List of pointers to port structures */
@@ -8768,18 +8769,27 @@ static int mvpp2_probe(struct platform_device *pdev)
87688769
err = clk_prepare_enable(priv->mg_clk);
87698770
if (err < 0)
87708771
goto err_gop_clk;
8772+
8773+
priv->mg_core_clk = devm_clk_get(&pdev->dev, "mg_core_clk");
8774+
if (IS_ERR(priv->mg_core_clk)) {
8775+
priv->mg_core_clk = NULL;
8776+
} else {
8777+
err = clk_prepare_enable(priv->mg_core_clk);
8778+
if (err < 0)
8779+
goto err_mg_clk;
8780+
}
87718781
}
87728782

87738783
priv->axi_clk = devm_clk_get(&pdev->dev, "axi_clk");
87748784
if (IS_ERR(priv->axi_clk)) {
87758785
err = PTR_ERR(priv->axi_clk);
87768786
if (err == -EPROBE_DEFER)
8777-
goto err_gop_clk;
8787+
goto err_mg_core_clk;
87788788
priv->axi_clk = NULL;
87798789
} else {
87808790
err = clk_prepare_enable(priv->axi_clk);
87818791
if (err < 0)
8782-
goto err_gop_clk;
8792+
goto err_mg_core_clk;
87838793
}
87848794

87858795
/* Get system's tclk rate */
@@ -8793,22 +8803,22 @@ static int mvpp2_probe(struct platform_device *pdev)
87938803
if (priv->hw_version == MVPP22) {
87948804
err = dma_set_mask(&pdev->dev, MVPP2_DESC_DMA_MASK);
87958805
if (err)
8796-
goto err_mg_clk;
8806+
goto err_axi_clk;
87978807
/* Sadly, the BM pools all share the same register to
87988808
* store the high 32 bits of their address. So they
87998809
* must all have the same high 32 bits, which forces
88008810
* us to restrict coherent memory to DMA_BIT_MASK(32).
88018811
*/
88028812
err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
88038813
if (err)
8804-
goto err_mg_clk;
8814+
goto err_axi_clk;
88058815
}
88068816

88078817
/* Initialize network controller */
88088818
err = mvpp2_init(pdev, priv);
88098819
if (err < 0) {
88108820
dev_err(&pdev->dev, "failed to initialize controller\n");
8811-
goto err_mg_clk;
8821+
goto err_axi_clk;
88128822
}
88138823

88148824
/* Initialize ports */
@@ -8821,7 +8831,7 @@ static int mvpp2_probe(struct platform_device *pdev)
88218831
if (priv->port_count == 0) {
88228832
dev_err(&pdev->dev, "no ports enabled\n");
88238833
err = -ENODEV;
8824-
goto err_mg_clk;
8834+
goto err_axi_clk;
88258835
}
88268836

88278837
/* Statistics must be gathered regularly because some of them (like
@@ -8849,8 +8859,13 @@ static int mvpp2_probe(struct platform_device *pdev)
88498859
mvpp2_port_remove(priv->port_list[i]);
88508860
i++;
88518861
}
8852-
err_mg_clk:
8862+
err_axi_clk:
88538863
clk_disable_unprepare(priv->axi_clk);
8864+
8865+
err_mg_core_clk:
8866+
if (priv->hw_version == MVPP22)
8867+
clk_disable_unprepare(priv->mg_core_clk);
8868+
err_mg_clk:
88548869
if (priv->hw_version == MVPP22)
88558870
clk_disable_unprepare(priv->mg_clk);
88568871
err_gop_clk:
@@ -8897,6 +8912,7 @@ static int mvpp2_remove(struct platform_device *pdev)
88978912
return 0;
88988913

88998914
clk_disable_unprepare(priv->axi_clk);
8915+
clk_disable_unprepare(priv->mg_core_clk);
89008916
clk_disable_unprepare(priv->mg_clk);
89018917
clk_disable_unprepare(priv->pp_clk);
89028918
clk_disable_unprepare(priv->gop_clk);

0 commit comments

Comments
 (0)