Re: [PATCH] new device support for forcedeth.c second try

From: Francois Romieu
Date: Sat Jun 19 2004 - 10:15:31 EST


Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004@xxxxxxx> :
[...]
> //must wait till reset is deasserted
> while (miicontrol & BMCR_RESET) {
> udelay(NV_MIIBUSY_DELAY);
> miicontrol = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
> /* FIXME: 1000 tries seem excessive */
> if (tries++ > 1000)
> return -1;
> }
> return 0;
> }
>
>
> Better?

Fine: at least the FIXME clearly says that it must be fixed :o)

NV_MIIBUSY_DELAY is only 50us but it still means a pair of cycles on
nowadays CPU. If memory serves me right, the reset can take quite some
time per 802.3. So I would simply schedule_timeout() if going through
the while() loop is required at all.

--
Ueimor
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/