Public bug reported:

I am using Ubuntu 8.10 AMD64 with openchrome on a VIA K8M890 board,
using the on board graphics VIA Chrome9 HC. This is working fine, except
that during the startup of graphical applications, the system would
freeze for about 5 seconds at a time. I have now found the cause of
these freezes, and I think I have a fix.

The bug is in via_wait_idle(), in the DRM module via.ko. This function
(I assume) is supposed to wait until the GPU is idle. First it waits for
the GPU to become busy, but this may never happen. It then times out,
but that causes the observed freeze of the system.

The statement to wait for the GPU to become busy was introduced in
2.6.22,
http://www.linuxhq.com/kernel/v2.6/21-git13/drivers/char/drm/via_dma.c
to be precise. I assume that there is a reason for this change (maybe
the routine is sometimes called before the GPU is marked as busy), but
even then it is not the correct solution.

Now one of the problems is that this first bug interacts with a second
one: the timeout of via_wait_idle() is ignored in
via_driver_dma_quiescent(). The return value indication a timetout is
-1, but the check assumes it would be 0.

The combination of both bugs means that we do not want to handle
timeouts caused by the GPU being already idle. And I am not even sure
whether we want to handle timeouts at all: it would be a good idea, but
the code so far does not.

Anyway, I have a patch below that fixes the two bugs, explains what is
going on, and most of all works for me. I would be interested to here
how it works for other people. (To be honest I could not get openchrome
to work under i386 on my system, but maybe somebody has more luck.)

One of the annoying aspects of this bug is that there is no error
message anywhere. I think this is because DRM does not usually log error
messages, and because the return code of via_wait_idle() is handled
incorrectly. If I enable debugging with insmod drm.ko debug=1, I get the
lines attached as dmesg.log, indicating that the patch is working as
intended.

This bug may be related to https://bugs.launchpad.net/ubuntu/+source
/xserver-xorg-video-openchrome/+bug/158999, because that is probably
caused by the same patch set in linux 2.6.22. This may even be the
solution, but I cannot test that.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Freezes with K8M890 and openchrome driver
https://bugs.launchpad.net/bugs/326583
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to