[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20090130143541.4b85f22a.akpm@linux-foundation.org>
Date: Fri, 30 Jan 2009 14:35:41 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Ayaz Abdulla <aabdulla@...dia.com>
Cc: jgarzik@...ox.com, manfred@...orfullife.com,
netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH 1/5] forcedeth: mgmt unit interface
On Fri, 30 Jan 2009 13:56:26 -0500
Ayaz Abdulla <aabdulla@...dia.com> wrote:
> +static int nv_mgmt_get_version(struct net_device *dev)
> +{
> + struct fe_priv *np = netdev_priv(dev);
> + u8 __iomem *base = get_hwbase(dev);
> + u32 data_ready = readl(base + NvRegTransmitterControl);
> + u32 data_ready2;
> + int i;
> +
> + writel(NVREG_MGMTUNITGETVERSION, base + NvRegMgmtUnitGetVersion);
> + writel(data_ready ^ NVREG_XMITCTL_DATA_START, base + NvRegTransmitterControl);
> + for (i = 0; i < 100000; i++) {
> + data_ready2 = readl(base + NvRegTransmitterControl);
> + if ((data_ready & NVREG_XMITCTL_DATA_READY) != (data_ready2 & NVREG_XMITCTL_DATA_READY))
> + break;
> + udelay(50);
> + }
> +
> + if (i == 100000 || (data_ready2 & NVREG_XMITCTL_DATA_ERROR))
> + return 0;
> +
> + np->mgmt_version = readl(base + NvRegMgmtUnitVersion) & NVREG_MGMTUNITVERSION;
> +
> + return 1;
> +}
A five second busy-wait still sucks :(
Why not do
start = jiffies;
while (time_before(jiffies, start + 5*HZ)) {
...
schedule_timeout_uninterruptible(1);
}
?
--
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