* [PATCH 1/2] b44: add calls to phy_{start,stop}
@ 2014-03-02 16:29 Hauke Mehrtens
2014-03-02 16:29 ` [PATCH 2/2] b44: always set duplex mode why phy changes Hauke Mehrtens
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Hauke Mehrtens @ 2014-03-02 16:29 UTC (permalink / raw)
To: davem; +Cc: zambrano, netdev, Hauke Mehrtens
When support for external phys was added to b44, the calls to start and
stop the phy were missing in the mac driver. This adds the calls to
phy_start() and phy_stop().
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/b44.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 1f7b5aa..e8046e1 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -1484,6 +1484,10 @@ static int b44_open(struct net_device *dev)
add_timer(&bp->timer);
b44_enable_ints(bp);
+
+ if (bp->flags & B44_FLAG_EXTERNAL_PHY)
+ phy_start(bp->phydev);
+
netif_start_queue(dev);
out:
return err;
@@ -1646,6 +1650,9 @@ static int b44_close(struct net_device *dev)
netif_stop_queue(dev);
+ if (bp->flags & B44_FLAG_EXTERNAL_PHY)
+ phy_stop(bp->phydev);
+
napi_disable(&bp->napi);
del_timer_sync(&bp->timer);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] b44: always set duplex mode why phy changes
2014-03-02 16:29 [PATCH 1/2] b44: add calls to phy_{start,stop} Hauke Mehrtens
@ 2014-03-02 16:29 ` Hauke Mehrtens
2014-03-02 18:53 ` Florian Fainelli
2014-03-03 0:06 ` David Miller
2014-03-02 18:53 ` [PATCH 1/2] b44: add calls to phy_{start,stop} Florian Fainelli
2014-03-03 0:05 ` David Miller
2 siblings, 2 replies; 6+ messages in thread
From: Hauke Mehrtens @ 2014-03-02 16:29 UTC (permalink / raw)
To: davem; +Cc: zambrano, netdev, Hauke Mehrtens
Without this patch b44_check_phy() was called when the phy called the
adjust callback. This method only change the mac duplex mode when the
carrier was off. When the phy changed the duplex mode after the carrier
was on the mac was not changed. This happened when an external phy was
used.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/b44.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index e8046e1..8a7bf7d 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -2229,7 +2229,12 @@ static void b44_adjust_link(struct net_device *dev)
}
if (status_changed) {
- b44_check_phy(bp);
+ u32 val = br32(bp, B44_TX_CTRL);
+ if (bp->flags & B44_FLAG_FULL_DUPLEX)
+ val |= TX_CTRL_DUPLEX;
+ else
+ val &= ~TX_CTRL_DUPLEX;
+ bw32(bp, B44_TX_CTRL, val);
phy_print_status(phydev);
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] b44: add calls to phy_{start,stop}
2014-03-02 16:29 [PATCH 1/2] b44: add calls to phy_{start,stop} Hauke Mehrtens
2014-03-02 16:29 ` [PATCH 2/2] b44: always set duplex mode why phy changes Hauke Mehrtens
@ 2014-03-02 18:53 ` Florian Fainelli
2014-03-03 0:05 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-03-02 18:53 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: davem, zambrano, netdev
Le dimanche 2 mars 2014, 17:29:33 Hauke Mehrtens a écrit :
> When support for external phys was added to b44, the calls to start and
> stop the phy were missing in the mac driver. This adds the calls to
> phy_start() and phy_stop().
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/ethernet/broadcom/b44.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/b44.c
> b/drivers/net/ethernet/broadcom/b44.c index 1f7b5aa..e8046e1 100644
> --- a/drivers/net/ethernet/broadcom/b44.c
> +++ b/drivers/net/ethernet/broadcom/b44.c
> @@ -1484,6 +1484,10 @@ static int b44_open(struct net_device *dev)
> add_timer(&bp->timer);
>
> b44_enable_ints(bp);
> +
> + if (bp->flags & B44_FLAG_EXTERNAL_PHY)
> + phy_start(bp->phydev);
> +
> netif_start_queue(dev);
> out:
> return err;
> @@ -1646,6 +1650,9 @@ static int b44_close(struct net_device *dev)
>
> netif_stop_queue(dev);
>
> + if (bp->flags & B44_FLAG_EXTERNAL_PHY)
> + phy_stop(bp->phydev);
> +
> napi_disable(&bp->napi);
>
> del_timer_sync(&bp->timer);
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] b44: always set duplex mode why phy changes
2014-03-02 16:29 ` [PATCH 2/2] b44: always set duplex mode why phy changes Hauke Mehrtens
@ 2014-03-02 18:53 ` Florian Fainelli
2014-03-03 0:06 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-03-02 18:53 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: davem, zambrano, netdev
Le dimanche 2 mars 2014, 17:29:34 Hauke Mehrtens a écrit :
> Without this patch b44_check_phy() was called when the phy called the
> adjust callback. This method only change the mac duplex mode when the
> carrier was off. When the phy changed the duplex mode after the carrier
> was on the mac was not changed. This happened when an external phy was
> used.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/ethernet/broadcom/b44.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/b44.c
> b/drivers/net/ethernet/broadcom/b44.c index e8046e1..8a7bf7d 100644
> --- a/drivers/net/ethernet/broadcom/b44.c
> +++ b/drivers/net/ethernet/broadcom/b44.c
> @@ -2229,7 +2229,12 @@ static void b44_adjust_link(struct net_device *dev)
> }
>
> if (status_changed) {
> - b44_check_phy(bp);
> + u32 val = br32(bp, B44_TX_CTRL);
> + if (bp->flags & B44_FLAG_FULL_DUPLEX)
> + val |= TX_CTRL_DUPLEX;
> + else
> + val &= ~TX_CTRL_DUPLEX;
> + bw32(bp, B44_TX_CTRL, val);
> phy_print_status(phydev);
> }
> }
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] b44: add calls to phy_{start,stop}
2014-03-02 16:29 [PATCH 1/2] b44: add calls to phy_{start,stop} Hauke Mehrtens
2014-03-02 16:29 ` [PATCH 2/2] b44: always set duplex mode why phy changes Hauke Mehrtens
2014-03-02 18:53 ` [PATCH 1/2] b44: add calls to phy_{start,stop} Florian Fainelli
@ 2014-03-03 0:05 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-03-03 0:05 UTC (permalink / raw)
To: hauke; +Cc: zambrano, netdev
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 2 Mar 2014 17:29:33 +0100
> When support for external phys was added to b44, the calls to start and
> stop the phy were missing in the mac driver. This adds the calls to
> phy_start() and phy_stop().
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] b44: always set duplex mode why phy changes
2014-03-02 16:29 ` [PATCH 2/2] b44: always set duplex mode why phy changes Hauke Mehrtens
2014-03-02 18:53 ` Florian Fainelli
@ 2014-03-03 0:06 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-03-03 0:06 UTC (permalink / raw)
To: hauke; +Cc: zambrano, netdev
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 2 Mar 2014 17:29:34 +0100
> Without this patch b44_check_phy() was called when the phy called the
> adjust callback. This method only change the mac duplex mode when the
> carrier was off. When the phy changed the duplex mode after the carrier
> was on the mac was not changed. This happened when an external phy was
> used.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-03-03 0:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-02 16:29 [PATCH 1/2] b44: add calls to phy_{start,stop} Hauke Mehrtens
2014-03-02 16:29 ` [PATCH 2/2] b44: always set duplex mode why phy changes Hauke Mehrtens
2014-03-02 18:53 ` Florian Fainelli
2014-03-03 0:06 ` David Miller
2014-03-02 18:53 ` [PATCH 1/2] b44: add calls to phy_{start,stop} Florian Fainelli
2014-03-03 0:05 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.