Messages in this thread | | | Date | Sat, 19 Jun 2004 17:08:38 +0200 | From | Francois Romieu <> | Subject | Re: [PATCH] new device support for forcedeth.c second try |
| |
Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004@gmx.net> : [...] > //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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |