linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: revert "support future possible different internal phy mode"
@ 2017-07-12  7:32 Corentin Labbe
  2017-07-12 21:42 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Corentin Labbe @ 2017-07-12  7:32 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, maxime.ripard, wens
  Cc: netdev, linux-arm-kernel, linux-kernel, Corentin Labbe

Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i.
Furthermore, all DT patchs which comes with this patch were cleaned, so
the current state is broken.
This reverts commit 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")

Fixes: 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 6c2d1da05588..fffd6d5fc907 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -638,7 +638,7 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
 {
 	struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
 	struct device_node *node = priv->device->of_node;
-	int ret, phy_interface;
+	int ret;
 	u32 reg, val;
 
 	regmap_read(gmac->regmap, SYSCON_EMAC_REG, &val);
@@ -718,11 +718,7 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
 	if (gmac->variant->support_rmii)
 		reg &= ~SYSCON_RMII_EN;
 
-	phy_interface = priv->plat->interface;
-	/* if PHY is internal, select the mode (xMII) used by the SoC */
-	if (gmac->use_internal_phy)
-		phy_interface = gmac->variant->internal_phy;
-	switch (phy_interface) {
+	switch (priv->plat->interface) {
 	case PHY_INTERFACE_MODE_MII:
 		/* default */
 		break;
@@ -936,7 +932,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
 	}
 
 	plat_dat->interface = of_get_phy_mode(dev->of_node);
-	if (plat_dat->interface == PHY_INTERFACE_MODE_INTERNAL) {
+	if (plat_dat->interface == gmac->variant->internal_phy) {
 		dev_info(&pdev->dev, "Will use internal PHY\n");
 		gmac->use_internal_phy = true;
 		gmac->ephy_clk = of_clk_get(plat_dat->phy_node, 0);
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: stmmac: revert "support future possible different internal phy mode"
  2017-07-12  7:32 [PATCH] net: stmmac: revert "support future possible different internal phy mode" Corentin Labbe
@ 2017-07-12 21:42 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-07-12 21:42 UTC (permalink / raw)
  To: clabbe.montjoie
  Cc: peppe.cavallaro, alexandre.torgue, maxime.ripard, wens, netdev,
	linux-arm-kernel, linux-kernel

From: Corentin Labbe <clabbe.montjoie@gmail.com>
Date: Wed, 12 Jul 2017 09:32:34 +0200

> Since internal phy-mode is reserved for non-xMII protocol we cannot use
> it with dwmac-sun8i.
> Furthermore, all DT patchs which comes with this patch were cleaned, so
> the current state is broken.
> This reverts commit 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")
> 
> Fixes: 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-12 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-12  7:32 [PATCH] net: stmmac: revert "support future possible different internal phy mode" Corentin Labbe
2017-07-12 21:42 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).