From: Eugene Surovegin <ebs@ebshome.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, linuxppc-embedded@ozlabs.org
Subject: Re: shared config registers and locking
Date: Tue, 5 Dec 2006 22:06:25 -0800 [thread overview]
Message-ID: <20061206060625.GA30005@gate.ebshome.net> (raw)
In-Reply-To: <1165382189.5469.76.camel@localhost.localdomain>
On Wed, Dec 06, 2006 at 04:16:29PM +1100, Benjamin Herrenschmidt wrote:
> > On my work in porting emac over to arch/powerpc (and make it work on SMP
> > platforms since there's at least one coming, possibly too), I ended up
> > with a problem with things like the workarounds for the EMAC loss of RX
> > clock (CONFIG_IBM_EMAC_PHY_RX_CLK_FIX) that I think uncovers a more
> > generic problem about access global system wide configuration registers
> > in a race free way.
>
> BTW, Eugene, in the specific case of this RX clock problem causing the
> transmitter to stall...
>
> I've had this problem with sungem in the past and a few other drivers
> have to deal with it as well. The general approach seems to be a bit
> different, and if you think it can work for EMAC, I'll implement it that
> way in the driver I'm working on.
>
> The idea is rather to try to find magic bits to force the chip clocks on
> when there is no link, simply ack the fact that when there is no link,
> nothing gets transmitted and thus ignore tx timeouts. Doing
> netif_carrier_off() (which is the right thing to do when the link is
> down anyway) should cause the net stack to ignore them.
>
> Now, some chips (like GEM) have a problem recovering when the link
> finally comes back up and thus can have the transmitter stuck. That's
> why drivers like this will simply reset the TX side when the link is
> back up.
>
> That should be simpler and avoid the need for the workaround, don't you
> think ?
No, it's not simpler. This just does not handle the problem this
workaround was implemented for.
You don't understand what this workaround does. It has nothing to do
with TX path at all. It deals with RX one and the fact that in that
particular MAC design whole RX domain is clocked from this clock,
meaning some parts of EMAC just simply stop working. For some modes
(e.g. SMII) this problem will not arise as this clock is always
present, there are other cases when it's not needed (like sane PHY).
For example, how do you handle PHY detection if you cannot talk to the
PHY?
Ben, my suggestion, before you start "forking" and "cleaning up" this
code, understand what it does.
--
Eugene
next prev parent reply other threads:[~2006-12-06 6:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-06 5:10 shared config registers and locking Benjamin Herrenschmidt
2006-12-06 5:16 ` Benjamin Herrenschmidt
2006-12-06 6:06 ` Eugene Surovegin [this message]
2006-12-06 6:36 ` Benjamin Herrenschmidt
2006-12-06 21:57 ` Roger Larsson
2006-12-06 22:57 ` Benjamin Herrenschmidt
2006-12-06 23:14 ` Michael Galassi
2006-12-06 23:34 ` Benjamin Herrenschmidt
2006-12-07 1:22 ` Roger Larsson
2006-12-07 2:47 ` Benjamin Herrenschmidt
2006-12-07 18:18 ` Roger Larsson
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=20061206060625.GA30005@gate.ebshome.net \
--to=ebs@ebshome.net \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxppc-embedded@ozlabs.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).