]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nv50: prevent a possible ctxprog hang
authorBen Skeggs <bskeggs@redhat.com>
Wed, 6 Jan 2010 02:00:02 +0000 (12:00 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 11 Jan 2010 04:41:16 +0000 (14:41 +1000)
commitdd98ce36f4ed8cfb7df112dc98003321a98cf01b
tree0516fdca404bc9a87271710a93159bfda5a04c77
parentc1687f23506556aaa5270de5ae4c76b0b921be66
drm/nv50: prevent a possible ctxprog hang

The below is mainly an educated guess at what's going on, docs would
sure be handy...  NVIDIA? :P

It appears it's possible for a ctxprog to run even while a GPU exception
is pending.  The GF8 and up ctxprogs appear to have a small snippet of
code which detects this, and stalls the ctxprog until it's been handled,
which essentially looks like:

if (r2 & 0x00008000) {
r0 |= 0x80000000;
while (r0 & 0x80000000) {}
}

I don't know of any way that flag would get cleared unless the driver
intervenes (and indeed, in the cases I've seen the hang, nothing steps
in to automagically clear it for us).  This patch causes the driver to
clear the flag during the PGRAPH IRQ handler.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_irq.c