netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: "fugang.duan@freescale.com" <fugang.duan@freescale.com>,
	Frank Li <lznuaa@gmail.com>, Fabio Estevam <festevam@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-arm-kernel@lists.arm.linux.org.uk"
	<linux-arm-kernel@lists.arm.linux.org.uk>,
	Shawn Guo <shawn.guo@linaro.org>,
	"Fabio.Estevam@freescale.com" <Fabio.Estevam@freescale.com>,
	"Frank.Li@freescale.com" <Frank.Li@freescale.com>,
	Sascha Hauer <kernel@pengutronix.de>
Subject: [PATCH net] eth: fec: Fix lost promiscuous mode after reconnecting cable
Date: Mon, 10 Mar 2014 19:18:56 +0100	[thread overview]
Message-ID: <531E0210.1090009@i2se.com> (raw)
In-Reply-To: <5319ED04.9070003@i2se.com>

If the Freescale i.MX28 fec is in promiscuous mode and network cable is
reconnected then the promiscuous mode get lost. The problem is caused
by a too soon call of set_multicast_list to re-enable promisc mode.
The FEC_R_CNTRL register changes are overwritten by fec_restart.

This patch fixes this by moving the call behind the init of FEC_R_CNTRL
register in fec_restart.

Successful tested on a i.MX28 board.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/net/ethernet/freescale/fec_main.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c
b/drivers/net/ethernet/freescale/fec_main.c
index 479a7cb..03a3513 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -528,13 +528,6 @@ fec_restart(struct net_device *ndev, int duplex)
     /* Clear any outstanding interrupt. */
     writel(0xffc00000, fep->hwp + FEC_IEVENT);
 
-    /* Setup multicast filter. */
-    set_multicast_list(ndev);
-#ifndef CONFIG_M5272
-    writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
-    writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
-#endif
-
     /* Set maximum receive buffer size. */
     writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE);
 
@@ -655,6 +648,13 @@ fec_restart(struct net_device *ndev, int duplex)
 
     writel(rcntl, fep->hwp + FEC_R_CNTRL);
 
+    /* Setup multicast filter. */
+    set_multicast_list(ndev);
+#ifndef CONFIG_M5272
+    writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
+    writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
+#endif
+
     if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
         /* enable ENET endian swap */
         ecntl |= (1 << 8);
-- 
1.7.10.4

  parent reply	other threads:[~2014-03-10 18:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  9:29 [Bug] net/fec on i.MX28: promiscuous mode lost after reconnecting network cable Stefan Wahren
2014-03-06 10:30 ` Fabio Estevam
2014-03-06 17:43   ` Frank Li
2014-03-07  2:10     ` fugang.duan
2014-03-07 16:00       ` Stefan Wahren
2014-03-08  1:35         ` Fabio Estevam
2014-03-10 18:18         ` Stefan Wahren [this message]
2014-03-11  1:28           ` [PATCH net] eth: fec: Fix lost promiscuous mode after reconnecting cable fugang.duan
2014-03-12  2:48           ` David Miller
2014-03-12 10:28             ` [PATCH net resend] " Stefan Wahren
2014-03-13 19:46               ` David Miller

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=531E0210.1090009@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=Fabio.Estevam@freescale.com \
    --cc=Frank.Li@freescale.com \
    --cc=davem@davemloft.net \
    --cc=festevam@gmail.com \
    --cc=fugang.duan@freescale.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=lznuaa@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shawn.guo@linaro.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 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).