netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bgmac: start/stop PHY on netdev open/stop
@ 2013-12-10 16:19 Rafał Miłecki
  2013-12-10 17:07 ` Florian Fainelli
  2013-12-10 23:10 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Rafał Miłecki @ 2013-12-10 16:19 UTC (permalink / raw)
  To: netdev, David S. Miller; +Cc: Hauke Mehrtens, Rafał Miłecki

I've realized that I need to call ethtool command to get Ethernet
working after booting. Ex call: ethtool -s eth0 autoneg on
It was fixing Ethernet even if auto-negotiation was already on.

Adding calls to phy_start and phy_stop look like a real solution.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/net/ethernet/broadcom/bgmac.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index db71d75..055204e 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1139,6 +1139,8 @@ static int bgmac_open(struct net_device *net_dev)
 	}
 	napi_enable(&bgmac->napi);
 
+	phy_start(bgmac->phy_dev);
+
 	netif_carrier_on(net_dev);
 
 err_out:
@@ -1151,6 +1153,8 @@ static int bgmac_stop(struct net_device *net_dev)
 
 	netif_carrier_off(net_dev);
 
+	phy_stop(bgmac->phy_dev);
+
 	napi_disable(&bgmac->napi);
 	bgmac_chip_intrs_off(bgmac);
 	free_irq(bgmac->core->irq, net_dev);
-- 
1.7.10.4

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

* Re: [PATCH] bgmac: start/stop PHY on netdev open/stop
  2013-12-10 16:19 [PATCH] bgmac: start/stop PHY on netdev open/stop Rafał Miłecki
@ 2013-12-10 17:07 ` Florian Fainelli
  2013-12-10 23:10 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2013-12-10 17:07 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: netdev, David S. Miller, Hauke Mehrtens

2013/12/10 Rafał Miłecki <zajec5@gmail.com>:
> I've realized that I need to call ethtool command to get Ethernet
> working after booting. Ex call: ethtool -s eth0 autoneg on
> It was fixing Ethernet even if auto-negotiation was already on.
>
> Adding calls to phy_start and phy_stop look like a real solution.

I kind of missed that too during the review, thanks for fixing this! I
wonder if we could somehow
issue a warning in libphy if we manage to go past ndo_start_xmit() and
we have not yet started the PHY state machine.

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/bgmac.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
> index db71d75..055204e 100644
> --- a/drivers/net/ethernet/broadcom/bgmac.c
> +++ b/drivers/net/ethernet/broadcom/bgmac.c
> @@ -1139,6 +1139,8 @@ static int bgmac_open(struct net_device *net_dev)
>         }
>         napi_enable(&bgmac->napi);
>
> +       phy_start(bgmac->phy_dev);
> +
>         netif_carrier_on(net_dev);
>
>  err_out:
> @@ -1151,6 +1153,8 @@ static int bgmac_stop(struct net_device *net_dev)
>
>         netif_carrier_off(net_dev);
>
> +       phy_stop(bgmac->phy_dev);
> +
>         napi_disable(&bgmac->napi);
>         bgmac_chip_intrs_off(bgmac);
>         free_irq(bgmac->core->irq, net_dev);
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Florian

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

* Re: [PATCH] bgmac: start/stop PHY on netdev open/stop
  2013-12-10 16:19 [PATCH] bgmac: start/stop PHY on netdev open/stop Rafał Miłecki
  2013-12-10 17:07 ` Florian Fainelli
@ 2013-12-10 23:10 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-12-10 23:10 UTC (permalink / raw)
  To: zajec5; +Cc: netdev, hauke

From: Rafał Miłecki <zajec5@gmail.com>
Date: Tue, 10 Dec 2013 17:19:39 +0100

> I've realized that I need to call ethtool command to get Ethernet
> working after booting. Ex call: ethtool -s eth0 autoneg on
> It was fixing Ethernet even if auto-negotiation was already on.
> 
> Adding calls to phy_start and phy_stop look like a real solution.
> 
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

Applied.

Please in the future make it clear what tree a patch is meant for,
I assumed this is only for net-next so that's where I applied it.

Thanks.

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

end of thread, other threads:[~2013-12-10 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 16:19 [PATCH] bgmac: start/stop PHY on netdev open/stop Rafał Miłecki
2013-12-10 17:07 ` Florian Fainelli
2013-12-10 23:10 ` 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).