From: Ben Hutchings <bhutchings@solarflare.com>
To: mathieu.poirier@linaro.org
Cc: steve.glendinning@smsc.com, netdev@vger.kernel.org,
lee.jones@linaro.org, patches@linaro.org,
linus.walleij@linaro.org
Subject: Re: [PATCH] net: allow shifted address in smsc911x
Date: Fri, 25 Mar 2011 21:46:08 +0000 [thread overview]
Message-ID: <1301089568.2694.41.camel@bwh-desktop> (raw)
In-Reply-To: <1301088437-31915-1-git-send-email-mathieu.poirier@linaro.org>
On Fri, 2011-03-25 at 15:27 -0600, mathieu.poirier@linaro.org wrote:
> From: Alessandro Rubini <rubini@gnudd.com>
>
> At least one device I'm using needs address shifting to access
> registers in the LAN9221 device (smsc911x driver). This patch
> adds a shift parameter in platform_data. The feature must be
> enabled at configuration time, because shifting by a pdata
> parameter makes access slower in those devices where no shift is
> needed (I tested one, it was 20% slower).
[...]
I guess you are using 16-bit registers, so that FIFO access involves
calling smsc911x_reg_{read,write}() in a loop. And the compiler
probably can't hoist the address calculation out of the loop due to
potential aliasing between the register lock and the platform data (yes,
really).
Try calculating the FIFO address in a local variable at the top of
smsc911x_tx_writefifo() and smsc911x_rx_readfifo() and then using that
variable in the calls to smsc911x_reg_{read,write}().
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
prev parent reply other threads:[~2011-03-25 21:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 21:27 [PATCH] net: allow shifted address in smsc911x mathieu.poirier
2011-03-25 21:31 ` David Miller
2011-03-29 21:17 ` Mathieu Poirier
2011-03-25 21:46 ` Ben Hutchings [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=1301089568.2694.41.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=mathieu.poirier@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=patches@linaro.org \
--cc=steve.glendinning@smsc.com \
/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).