From: Stefan Wahren <stefan.wahren@i2se.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk,
Shawn Guo <shawn.guo@linaro.org>,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: [Bug] net/fec on i.MX28: promiscuous mode lost after reconnecting network cable
Date: Thu, 06 Mar 2014 10:29:48 +0100 [thread overview]
Message-ID: <5318400C.8060508@i2se.com> (raw)
Hello,
i'm using a i.MX28 custom board (I2SE Duckbill) with 2 different
Ethernet interfaces. Both interfaces should be used as bridge using
bridge utils. One Ethernet interface is the buildin fec and the other is
connect by spi. The board runs under Linux mainline 3.10. But the
following problem still occurs on 3.14-rc4.
Here is the problem, if i disconnect and reconnect the Ethernet cable on
the buildin fec (eth0), the bridge says the port comes up, but it
doesn't work. After that any traffic to the fec is okay, but traffic
"through" the bridge is lost. But i expect no traffic is lost, after
reconnect the network cable.
If i reset the board without disconnecting the cables, the traffic
"through" the bridge works. If i force the promiscuous mode on the fec
(eth0) after the reconnect, the bridge works too:
ifconfig eth0 promisc
After that, i made some research and probably found the cause of the
problem. In the case that the bridge works (link state connected since
reboot) the register HW_ENET_MAC_RCR of the i.MX28 returns 0x45EE011C
(PROM=1, promiscuous mode on). Then I disconnect the ethernet cable and
reconnect it. After that the register returns 0x45EE0114 (PROM=0,
promiscuous mode off) and the bridge doesn't work.
Based on this information, i created a patch against Linux 3.10. I'm not
sure it's a good solution but it works. After a fec reset all register
values of HW_ENET_MAC_RCR must be restored, but fec_restart do not
handle them at all. So set_multicast_list is called after fec_restart to
restore the promiscuous mode of the fec.
diff --git a/drivers/net/ethernet/freescale/fec_main.c
b/drivers/net/ethernet/freescale/fec_main.c
index d48099f..cb6b66e 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1063,6 +1063,8 @@ static void fec_get_mac(struct net_device *ndev)
/*
------------------------------------------------------------------------- */
+static void set_multicast_list(struct net_device *ndev);
+
/*
* Phy section
*/
@@ -1093,8 +1095,10 @@ static void fec_enet_adjust_link(struct
net_device *ndev)
}
/* if any of the above changed restart the FEC */
- if (status_change)
+ if (status_change) {
fec_restart(ndev, phy_dev->duplex);
+ set_multicast_list(ndev);
+ }
} else {
if (fep->link) {
fec_stop(ndev);
Is this solution correct?
Do you need more information?
Best regards
Stefan Wahren
next reply other threads:[~2014-03-06 9:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-06 9:29 Stefan Wahren [this message]
2014-03-06 10:30 ` [Bug] net/fec on i.MX28: promiscuous mode lost after reconnecting network cable 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 ` [PATCH net] eth: fec: Fix lost promiscuous mode after reconnecting cable Stefan Wahren
2014-03-11 1:28 ` 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=5318400C.8060508@i2se.com \
--to=stefan.wahren@i2se.com \
--cc=davem@davemloft.net \
--cc=fabio.estevam@freescale.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--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).