[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 8 Aug 2008 11:21:30 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linuxppc-dev@...abs.org
Cc: Segher Boessenkool <segher@...nel.crashing.org>,
benh@...nel.crashing.org, Nathan Lynch <ntl@...ox.com>,
mcarlson@...adcom.com, Michael Chan <mchan@...adcom.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: Strange tg3 regression with UMP fw. link reporting
On Friday 08 August 2008, Segher Boessenkool wrote:
> > I don't know yet for sure what happens, but a quick look at the commit
> > seems to show that the driver synchronously spin-waits for up to 2.5ms
>
> That's what the comment says, but the code says 2.5 _seconds_:
>
> + /* Wait for up to 2.5 milliseconds */
> + for (i = 0; i < 250000; i++) {
> + if (!(tr32(GRC_RX_CPU_EVENT) & GRC_RX_CPU_DRIVER_EVENT))
> + break;
> + udelay(10);
> + }
>
> (not that milliseconds wouldn't be bad already...)
It can potentially be even much longer, because each udelay will wait
for *more* than 10 microseconds, and tr32() is an mmio read that takes
additional time, possibly in the order of microseconds as well.
The correct way to implement a timeout like this would be to use
time_before() in the condition, aside from better not doing a busy-loop
in the first place.
Arnd <><
--
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