Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] via-velocity: FLOW_CNTL_RX does not disable Asymmetric pause in set_mii_flow_control()

3 views
Skip to first unread message

Roel Kluin

unread,
Mar 22, 2010, 4:30:02 PM3/22/10
to
Asymmetric pause was not disabled in the RX case.

Signed-off-by: Roel Kluin <roel....@gmail.com>
---
I spotted this because In the FLOW_CNTL_RX and FLOW_CNTL_TX_RX
cases the same code is executed, is the amendment below required?

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 3a486f3..2d478cf 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -807,7 +807,7 @@ static void set_mii_flow_control(struct velocity_info *vptr)

case FLOW_CNTL_RX:
MII_REG_BITS_ON(ANAR_PAUSE, MII_REG_ANAR, vptr->mac_regs);
- MII_REG_BITS_ON(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs);
+ MII_REG_BITS_OFF(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs);
break;

case FLOW_CNTL_TX_RX:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

David Miller

unread,
Mar 22, 2010, 11:00:01 PM3/22/10
to
From: Roel Kluin <roel....@gmail.com>
Date: Mon, 22 Mar 2010 21:25:14 +0100

> Asymmetric pause was not disabled in the RX case.
>
> Signed-off-by: Roel Kluin <roel....@gmail.com>
> ---
> I spotted this because In the FLOW_CNTL_RX and FLOW_CNTL_TX_RX
> cases the same code is executed, is the amendment below required?

The bit settings in the MII_ADVERTISE register should be:

1) RX and TX pause both requested

set only ADVERTISE_PAUSE_CAP

2) Only TX pause requested

set only ADVERTISE_PAUSE_ASYM

3) Only RX pause requested

set both ADVERTISE_PAUSE_CAP and ADVERTISE_PAUSE_ASYM

4) Neither TX nor RX pause requested

set nothing

(drivers/net/tg3.c:tg3_advert_flowctrl_1000t() is a good
reference point)

It would be easier to compare the VIA driver with the rest of
the world if it used the standard mii.h defines instead of
it's own private ones. That would be a good change to make at
some point.

Anyways, the correct fix is therefore something like:

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 3a486f3..bc278d4 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -812,7 +812,7 @@ static void set_mii_flow_control(struct velocity_info *vptr)

case FLOW_CNTL_TX_RX:


MII_REG_BITS_ON(ANAR_PAUSE, MII_REG_ANAR, vptr->mac_regs);
- MII_REG_BITS_ON(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs);
+ MII_REG_BITS_OFF(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs);
break;

case FLOW_CNTL_DISABLE:

0 new messages