[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OF4A15F580.3A8DD1DE-ON802574BE.0047659A-802574BE.0049088D@smsc.com>
Date: Mon, 8 Sep 2008 14:17:42 +0100
From: Steve.Glendinning@...c.com
To: Masakazu Mokuno <mokuno@...sony.co.jp>
Cc: Catalin Marinas <catalin.marinas@....com>,
David Brownell <dbrownell@...rs.sourceforge.net>,
ian.saturley@...c.com, netdev@...r.kernel.org
Subject: Re: [PATCH] SMSC LAN9500 USB2.0 10/100 ethernet adapter driver
Hi Masakazu,
Thanks for the valuable feedback, I'll re-submit another attempt shortly.
> > +static int smsc95xx_eeprom_is_busy(struct usbnet *dev)
> > +{
> > + u32 val;
> > + int i;
> > +
> > + /* 40ms total */
> As smsc95xx_read_reg() uses the synchronous urb call and AFAIR ehci
> would defer the interrupts until 8 micro-frames by default, so I guess
this
> loop would take more than 40ms?
>
> > + for (i = 0; i < 1000; i++) {
> > + smsc95xx_read_reg(dev, E2P_CMD, &val);
> > + if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_))
> > + break;
> > + udelay(40);
> > + }
Yes, if no EEPROM is connected (or if the device has timed out) the loop
will
run for longer than 40ms. After 30ms the device TIMEOUT bit should go
high,
so we should only hit the end of the loop counter if something is quite
broken.
Regards,
--
Steve Glendinning
SMSC GmbH
m: +44 777 933 9124
e: steve.glendinning@...c.com
--
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