[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1395171314.2812.80.camel@joe-AO722>
Date: Tue, 18 Mar 2014 12:35:14 -0700
From: Joe Perches <joe@...ches.com>
To: Byungho An <bh74.an@...sung.com>
Cc: netdev@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
devicetree@...r.kernel.org, davem@...emloft.net,
siva.kallam@...sung.com, ks.giri@...sung.com,
ilho215.lee@...sung.com, vipul.pandya@...sung.com
Subject: Re: [PATCH V5 2/8] net: sxgbe: add basic framework for Samsung 10Gb
ethernet driver
On Tue, 2014-03-18 at 11:19 -0700, Byungho An wrote:
> From: Siva Reddy <siva.kallam@...sung.com>
>
> This patch adds support for Samsung 10Gb ethernet driver(sxgbe).
More trivia, nothing that should stop this from
being applied and updated later...
> diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
[]
> +static int sxgbe_mdio_busy_wait(void __iomem *ioaddr, unsigned int mii_data)
> +{
> + unsigned long cur_time;
> + unsigned long fin_time = jiffies + 3 * HZ; /* 30 ms */
This is actually 3 seconds.
If this should be 30ms, then use msecs_to_jiffies(30)
> +
> + do {
> + cur_time = jiffies;
> + if (readl(ioaddr + mii_data) & SXGBE_MII_BUSY)
> + cpu_relax();
> + else
> + return 0;
> + } while (!time_after_eq(cur_time, fin_time));
> +
> + return -EBUSY;
> +}
This may be clearer as
unsigned long fin_time = jiffies + msecs_to_jiffies(30);
while (!time_after(jiffies, fin_time))
if (!(readl(ioaddr + mii_data) & SXGBE_MII_BUSY))
return 0;
cpu_relax();
}
return -EBUSY;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists