Bug 53688 - Dubious looking i810 driver code
Summary: Dubious looking i810 driver code
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: XFree86
Version: 7.3
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-09-15 03:16 UTC by Alan Cox
Modified: 2007-04-18 16:37 UTC (History)
0 users

Clone Of:
Last Closed: 2002-09-02 21:06:16 UTC

Attachments (Terms of Use)

Description Alan Cox 2001-09-15 03:16:52 UTC
So I wondered about time related bogons and I found very odd looking code
in i810_accel.c - do a grep for GetTimeInMillis

Now consider what happens close to wrap time

On a reload now could reload with 0. Tripping the start = 0 case next loop.
We then fall through into the last_head = ring->head load. The same occurs 
during a wrap event where start=0x7FFFFFFFF now=0x80000000 (minus loads).
We mistakenly see it as progress. Fortunately it appears to fail safe as we
merely reset the timer.

Secondly GetTimeInMillis appears to be unsigned, its stuffed into
variables. That doesn't itself seem fatal as the (now-start) maths seems to
wrap safely - but wants checking

Thirdly there is a small delay loop. Or rather in egcs-1.1.2 there is. gcc
2.96 will optimise that to "i=2000" - i must be volatile if that loop is

Can you confirm what that loop is for and if its required ?


Comment 1 Mike A. Harris 2001-09-22 09:14:39 UTC
XFree86 4.x or 3.3.6?  I assume 3.3.6 (XFree86-Servers)..

I'll look at it and ask Alan about it.

Comment 2 Alan Cox 2001-09-22 13:40:20 UTC

Comment 3 Alan Cox 2002-09-02 21:06:09 UTC
Was fixed in 4.2

Note You need to log in before you can comment on or make changes to this bug.