All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Alex Shnitman <alexta69@yahoo.com>
Cc: bridge@lists.linux-foundation.org
Subject: Re: [Bridge] Bridge not functional after disconnect / connect
Date: Thu, 31 Jan 2008 08:50:11 -0800	[thread overview]
Message-ID: <20080131085011.036026ad@extreme> (raw)
In-Reply-To: <558132.22783.qm@web60424.mail.yahoo.com>

There were some fixes to carrier handling that went into 2.6.24.

commit 21d7f67700ad7a4523d35d43ce95755e40eae5b7
Author: Stephen Hemminger <shemminger@linux-foundation.org>
Date:   Mon Nov 26 11:54:51 2007 -0800

    skge: fiber link up/down fix
    
    The driver would not work over fibre if other end when down then
    came back up (would require reloading driver). The correct way
    to manage the link the same way for both TP and fibre.
    
    Resloves problem described in: 	 http://lkml.org/lkml/2007/11/6/395
    
    Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
    Signed-off-by: Jeff Garzik <jeff@garzik.org>

diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index b680cb0..73a4246 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -1095,16 +1095,9 @@ static void xm_link_down(struct skge_hw *hw, int port)
 {
 	struct net_device *dev = hw->dev[port];
 	struct skge_port *skge = netdev_priv(dev);
-	u16 cmd = xm_read16(hw, port, XM_MMU_CMD);
 
 	xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE);
 
-	cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
-	xm_write16(hw, port, XM_MMU_CMD, cmd);
-
-	/* dummy read to ensure writing */
-	xm_read16(hw, port, XM_MMU_CMD);
-
 	if (netif_carrier_ok(dev))
 		skge_link_down(skge);
 }
@@ -1194,6 +1187,7 @@ static void genesis_init(struct skge_hw *hw)
 static void genesis_reset(struct skge_hw *hw, int port)
 {
 	const u8 zero[8]  = { 0 };
+	u32 reg;
 
 	skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0);
 
@@ -1209,6 +1203,11 @@ static void genesis_reset(struct skge_hw *hw, int port)
 		xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff);
 
 	xm_outhash(hw, port, XM_HSM, zero);
+
+	/* Flush TX and RX fifo */
+	reg = xm_read32(hw, port, XM_MODE);
+	xm_write32(hw, port, XM_MODE, reg | XM_MD_FTF);
+	xm_write32(hw, port, XM_MODE, reg | XM_MD_FRF);
 }
 
 
@@ -1714,6 +1713,12 @@ static void genesis_stop(struct skge_port *skge)
 	struct skge_hw *hw = skge->hw;
 	int port = skge->port;
 	unsigned retries = 1000;
+	u16 cmd;
+
+ 	/* Disable Tx and Rx */
+	cmd = xm_read16(hw, port, XM_MMU_CMD);
+	cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
+	xm_write16(hw, port, XM_MMU_CMD, cmd);
 
 	genesis_reset(hw, port);
 

  parent reply	other threads:[~2008-01-31 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31  8:44 [Bridge] Bridge not functional after disconnect / connect Alex Shnitman
2008-01-31  9:59 ` Malcolm Scott
2008-01-31 16:50 ` Stephen Hemminger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-01-31 11:31 Alex Shnitman
2008-01-30 22:15 Alex Shnitman
2008-01-30 22:22 ` Stephen Hemminger

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=20080131085011.036026ad@extreme \
    --to=shemminger@linux-foundation.org \
    --cc=alexta69@yahoo.com \
    --cc=bridge@lists.linux-foundation.org \
    /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 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.