From: Joe Perches <joe@perches.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next 2/2] r8169: support RTL8168G
Date: Wed, 04 Jul 2012 17:51:47 -0700 [thread overview]
Message-ID: <1341449507.2058.6.camel@joe2Laptop> (raw)
In-Reply-To: <20120704220458.GA1621@electric-eye.fr.zoreil.com>
On Thu, 2012-07-05 at 00:04 +0200, Francois Romieu wrote:
> Hayes Wang <hayeswang@realtek.com> :
> > Support the new chip RTL8168G.
> - save Joe P. some work
Thanks. Just a trivial thing below:
[]
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
[]
> +#define RTL_LOOP_MAX 10000
> +
> +static void rtl_mcu_wait_list_ready(void __iomem *ioaddr)
> +{
> + int i;
> +
> + for (i = 0; i < RTL_LOOP_MAX; i++) {
> + if (RTL_R8(MCU) & LINK_LIST_RDY)
> + return;
> + udelay(100);
> + }
> +}
This pattern is used a couple more times.
There's no failure handling either.
Maybe use a macro with RTL_R8/32, register and test?
Maybe the delays could be tuned out a bit better.
Maybe a continuous read or a less frequent read
might be better.
> static void __devinit rtl_hw_init_8168g(struct rtl8169_private *tp)
> {
[]
> + for (i = 0; i < RTL_LOOP_MAX; i++) {
> + if (RTL_R32(TxConfig) & TXCFG_EMPTY)
> + break;
> udelay(100);
> + }
pattern
> + for (i = 0; i < RTL_LOOP_MAX; i++) {
> + if ((RTL_R8(MCU) & RXTX_EMPTY) == RXTX_EMPTY)
> + break;
> udelay(100);
> + }
pattern
next prev parent reply other threads:[~2012-07-05 0:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-29 10:34 [PATCH net-next 1/2] r8169: support RTL8106E Hayes Wang
2012-06-29 10:34 ` [PATCH net-next 2/2] r8169: support RTL8168G Hayes Wang
2012-06-29 13:51 ` Francois Romieu
2012-07-02 7:27 ` hayeswang
2012-06-29 13:50 ` [PATCH net-next 1/2] r8169: support RTL8106E Francois Romieu
2012-07-02 9:23 ` [PATCH v2 " Hayes Wang
2012-07-02 9:23 ` [PATCH v2 net-next 2/2] r8169: support RTL8168G Hayes Wang
2012-07-04 22:04 ` Francois Romieu
2012-07-05 0:51 ` Joe Perches [this message]
2012-07-06 15:20 ` Francois Romieu
2012-07-06 15:37 ` Joe Perches
2012-07-06 7:57 ` hayeswang
2012-07-06 15:20 ` Francois Romieu
2012-07-03 11:01 ` [PATCH v2 net-next 1/2] r8169: support RTL8106E Francois Romieu
2012-07-04 9:02 ` hayeswang
2012-07-09 6:48 ` [PATCH " David Miller
2012-07-09 10:12 ` Francois Romieu
2012-07-09 21:10 ` 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=1341449507.2058.6.camel@joe2Laptop \
--to=joe@perches.com \
--cc=hayeswang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.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).