Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbcDMPom (ORCPT ); Wed, 13 Apr 2016 11:44:42 -0400 Received: from torres.zugschlus.de ([85.214.131.164]:55734 "EHLO torres.zugschlus.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbcDMPok (ORCPT ); Wed, 13 Apr 2016 11:44:40 -0400 Date: Wed, 13 Apr 2016 17:44:25 +0200 From: Marc Haber To: Giuseppe Cavallaro Cc: netdev@vger.kernel.org, gabriel.fernandez@linaro.org, afaerber@suse.de, fschaefer.oss@googlemail.com, dinh.linux@gmail.com, davem@davemloft.net, preid@electromag.com.au, rhgadsdon@gmail.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH (net.git) 2/3] Revert "stmmac: Fix 'eth0: No PHY found' regression" Message-ID: <20160413154425.GA30954@torres.zugschlus.de> References: <1459494436-27386-1-git-send-email-peppe.cavallaro@st.com> <1459494436-27386-3-git-send-email-peppe.cavallaro@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1459494436-27386-3-git-send-email-peppe.cavallaro@st.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4158 Lines: 107 On Fri, Apr 01, 2016 at 09:07:15AM +0200, Giuseppe Cavallaro wrote: > This reverts commit 88f8b1bb41c6208f81b6a480244533ded7b59493. > due to problems on GeekBox and Banana Pi M1 board when > connected to a real transceiver instead of a switch via > fixed-link. This reversal is still needed in Linux 4.5.1 on Banana Pi. Please consider including it in Linux 4.5.2. Greetings Marc > > Signed-off-by: Giuseppe Cavallaro > Cc: Gabriel Fernandez > Cc: Andreas Färber > Cc: Frank Schäfer > Cc: Dinh Nguyen > Cc: David S. Miller > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 11 ++++++++++- > .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 9 +-------- > include/linux/stmmac.h | 1 - > 3 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > index ea76129..af09ced 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > @@ -199,12 +199,21 @@ int stmmac_mdio_register(struct net_device *ndev) > struct stmmac_priv *priv = netdev_priv(ndev); > struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; > int addr, found; > - struct device_node *mdio_node = priv->plat->mdio_node; > + struct device_node *mdio_node = NULL; > + struct device_node *child_node = NULL; > > if (!mdio_bus_data) > return 0; > > if (IS_ENABLED(CONFIG_OF)) { > + for_each_child_of_node(priv->device->of_node, child_node) { > + if (of_device_is_compatible(child_node, > + "snps,dwmac-mdio")) { > + mdio_node = child_node; > + break; > + } > + } > + > if (mdio_node) { > netdev_dbg(ndev, "FOUND MDIO subnode\n"); > } else { > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > index dcbd2a1..9cf181f 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > @@ -146,7 +146,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) > struct device_node *np = pdev->dev.of_node; > struct plat_stmmacenet_data *plat; > struct stmmac_dma_cfg *dma_cfg; > - struct device_node *child_node = NULL; > > plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); > if (!plat) > @@ -177,19 +176,13 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) > plat->phy_node = of_node_get(np); > } > > - for_each_child_of_node(np, child_node) > - if (of_device_is_compatible(child_node, "snps,dwmac-mdio")) { > - plat->mdio_node = child_node; > - break; > - } > - > /* "snps,phy-addr" is not a standard property. Mark it as deprecated > * and warn of its use. Remove this when phy node support is added. > */ > if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0) > dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n"); > > - if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node) > + if ((plat->phy_node && !of_phy_is_fixed_link(np)) || plat->phy_bus_name) > plat->mdio_bus_data = NULL; > else > plat->mdio_bus_data = > diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h > index 4bcf5a6..6e53fa8 100644 > --- a/include/linux/stmmac.h > +++ b/include/linux/stmmac.h > @@ -114,7 +114,6 @@ struct plat_stmmacenet_data { > int interface; > struct stmmac_mdio_bus_data *mdio_bus_data; > struct device_node *phy_node; > - struct device_node *mdio_node; > struct stmmac_dma_cfg *dma_cfg; > int clk_csr; > int has_gmac; > -- > 1.7.4.4 > -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402 Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421