summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c3
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c4
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c1
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c8
-rw-r--r--include/linux/stmmac.h1
5 files changed, 15 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
index 3a14cdd01f5f..66933332c68e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
@@ -333,6 +333,9 @@ static void *tegra_eqos_probe(struct platform_device *pdev,
333 usleep_range(2000, 4000); 333 usleep_range(2000, 4000);
334 gpiod_set_value(eqos->reset, 0); 334 gpiod_set_value(eqos->reset, 0);
335 335
336 /* MDIO bus was already reset just above */
337 data->mdio_bus_data->needs_reset = false;
338
336 eqos->rst = devm_reset_control_get(&pdev->dev, "eqos"); 339 eqos->rst = devm_reset_control_get(&pdev->dev, "eqos");
337 if (IS_ERR(eqos->rst)) { 340 if (IS_ERR(eqos->rst)) {
338 err = PTR_ERR(eqos->rst); 341 err = PTR_ERR(eqos->rst);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 4304c1abc5d1..40c42637ad75 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -348,7 +348,9 @@ int stmmac_mdio_register(struct net_device *ndev)
348 max_addr = PHY_MAX_ADDR; 348 max_addr = PHY_MAX_ADDR;
349 } 349 }
350 350
351 new_bus->reset = &stmmac_mdio_reset; 351 if (mdio_bus_data->needs_reset)
352 new_bus->reset = &stmmac_mdio_reset;
353
352 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s-%x", 354 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s-%x",
353 new_bus->name, priv->plat->bus_id); 355 new_bus->name, priv->plat->bus_id);
354 new_bus->priv = ndev; 356 new_bus->priv = ndev;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 86f9c07a38cf..d5d08e11c353 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -63,6 +63,7 @@ static void common_default_data(struct plat_stmmacenet_data *plat)
63 plat->has_gmac = 1; 63 plat->has_gmac = 1;
64 plat->force_sf_dma_mode = 1; 64 plat->force_sf_dma_mode = 1;
65 65
66 plat->mdio_bus_data->needs_reset = true;
66 plat->mdio_bus_data->phy_mask = 0; 67 plat->mdio_bus_data->phy_mask = 0;
67 68
68 /* Set default value for multicast hash bins */ 69 /* Set default value for multicast hash bins */
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 73fc2524372e..333b09564b88 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -342,10 +342,16 @@ static int stmmac_dt_phy(struct plat_stmmacenet_data *plat,
342 mdio = true; 342 mdio = true;
343 } 343 }
344 344
345 if (mdio) 345 if (mdio) {
346 plat->mdio_bus_data = 346 plat->mdio_bus_data =
347 devm_kzalloc(dev, sizeof(struct stmmac_mdio_bus_data), 347 devm_kzalloc(dev, sizeof(struct stmmac_mdio_bus_data),
348 GFP_KERNEL); 348 GFP_KERNEL);
349 if (!plat->mdio_bus_data)
350 return -ENOMEM;
351
352 plat->mdio_bus_data->needs_reset = true;
353 }
354
349 return 0; 355 return 0;
350} 356}
351 357
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 7d06241582dd..7b3e354bcd3c 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -81,6 +81,7 @@ struct stmmac_mdio_bus_data {
81 unsigned int phy_mask; 81 unsigned int phy_mask;
82 int *irqs; 82 int *irqs;
83 int probed_phy_irq; 83 int probed_phy_irq;
84 bool needs_reset;
84}; 85};
85 86
86struct stmmac_dma_cfg { 87struct stmmac_dma_cfg {