netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: roel.kluin@gmail.com
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, davej@redhat.com
Subject: Re: [PATCH] via-velocity: FLOW_CNTL_RX does not disable Asymmetric pause in set_mii_flow_control()
Date: Mon, 22 Mar 2010 19:58:31 -0700 (PDT)	[thread overview]
Message-ID: <20100322.195831.233398454.davem@davemloft.net> (raw)
In-Reply-To: <4BA7D22A.6080300@gmail.com>

From: Roel Kluin <roel.kluin@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.kluin@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:

      reply	other threads:[~2010-03-23  2:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 20:25 [PATCH] via-velocity: FLOW_CNTL_RX does not disable Asymmetric pause in set_mii_flow_control() Roel Kluin
2010-03-23  2:58 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100322.195831.233398454.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roel.kluin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).