From: Stanislav Meduna <stano@meduna.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Jim Baxter <jim_baxter@mentor.com>,
Duan Fugang-B38611 <B38611@freescale.com>,
Frank Li <Frank.Li@freescale.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Russell King <linux@arm.linux.org.uk>
Subject: Re: Freescale FEC i.MX28 restart problem
Date: Fri, 18 Apr 2014 19:13:28 +0200 [thread overview]
Message-ID: <53515D38.4090400@meduna.org> (raw)
In-Reply-To: <CAOMZO5DAixbrO1Zhvm60gevdCbKVgSP652vS7QYZS+XSfbPLdQ@mail.gmail.com>
On 18.04.2014 15:05, Fabio Estevam wrote:
>> Could you try the latest Russell's FEC patches available at?
>> http://ftp.arm.linux.org.uk/cgit/linux-arm.git/log/?h=fec-testing
>
> In particular this one could help with your "MDIO timeout" issue:
> http://ftp.arm.linux.org.uk/cgit/linux-arm.git/commit/?h=fec-testing&id=ec1fac3de70b16c69d3edc9f223e91d56b1915de
Thanks for the heads-up, I was not aware that there is a larger
refactoring going on.
I did just copy the whole fec driver from that branch into
my environment (the isolated patch does not apply as it needs
the previous work) and yes, it seems to help. I'll give it
a bit more testing and I will report if there are still
some issues.
However, in my opinion the FEC_ENET_EBERR handling should be also
added (if only to print a big fat error), as if this happens
for whatever reason, the controller is now dead until reboot.
I had a problem where the MDIO communication was needed before
the controller has interrupts enabled - I am not quite sure whether
it is always the case or was caused by my unrelated patch.
I need to specify the PHY in the device tree as my hardware
uses weird MDIO address to FEC port assignment. The only change
in the logic is that in the fec_enet_mii_probe an of_phy_connect
is used instead of phy_connect and I think they both end in the
same code, but maybe I have overlooked something.
I just added a hack to poll for the MII transaction completion
and it started to work:
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1356,6 +1357,14 @@ static unsigned long fec_enet_mdio_op(struct fec_enet_pri
time_left = wait_for_completion_timeout(&fep->mdio_done,
usecs_to_jiffies(FEC_MII_TIMEOUT));
+ if (time_left == 0) {
+ u32 int_events = readl(fep->hwp + FEC_IEVENT);
+ if (int_events & FEC_ENET_MII) {
+ writel(FEC_ENET_MII, fep->hwp + FEC_IEVENT);
+ time_left = 1;
+ }
+ }
+
mutex_unlock(&fep->mutex);
return time_left;
Many thanks
--
Stano
prev parent reply other threads:[~2014-04-18 17:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-18 11:46 Freescale FEC i.MX28 restart problem Stanislav Meduna
2014-04-18 12:59 ` Fabio Estevam
2014-04-18 13:05 ` Fabio Estevam
2014-04-18 17:13 ` Stanislav Meduna [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=53515D38.4090400@meduna.org \
--to=stano@meduna.org \
--cc=B38611@freescale.com \
--cc=Frank.Li@freescale.com \
--cc=davem@davemloft.net \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=jim_baxter@mentor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=netdev@vger.kernel.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