[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1341449507.2058.6.camel@joe2Laptop>
Date: Wed, 04 Jul 2012 17:51:47 -0700
From: Joe Perches <joe@...ches.com>
To: Francois Romieu <romieu@...zoreil.com>
Cc: Hayes Wang <hayeswang@...ltek.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 net-next 2/2] r8169: support RTL8168G
On Thu, 2012-07-05 at 00:04 +0200, Francois Romieu wrote:
> Hayes Wang <hayeswang@...ltek.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists