<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/char/drm/drm_lock.c, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/char/drm/drm_lock.c?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/char/drm/drm_lock.c?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2008-07-14T00:45:01Z</updated>
<entry>
<title>drm: reorganise drm tree to be more future proof.</title>
<updated>2008-07-14T00:45:01Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2008-05-29T00:09:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c0e09200dc0813972442e550a5905a132768e56c'/>
<id>urn:sha1:c0e09200dc0813972442e550a5905a132768e56c</id>
<content type='text'>
With the coming of kernel based modesetting and the memory manager stuff,
the everything in one directory approach was getting very ugly and
starting to be unmanageable.

This restructures the drm along the lines of other kernel components.

It creates a drivers/gpu/drm directory and moves the hw drivers into
subdirectores. It moves the includes into an include/drm, and
sets up the unifdef for the userspace headers we should be exporting.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm: disable tasklets not IRQs when taking the drm lock spinlock</title>
<updated>2008-05-07T02:22:39Z</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thomas-at-tungstengraphics-dot-com</email>
</author>
<published>2008-05-07T02:22:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f116cc561eae0a426b8fa6b3e22e80ba0bcf7aee'/>
<id>urn:sha1:f116cc561eae0a426b8fa6b3e22e80ba0bcf7aee</id>
<content type='text'>
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm: Fix race that can lockup the kernel</title>
<updated>2008-03-16T23:54:58Z</updated>
<author>
<name>Mike Isely</name>
<email>isely@isely.net</email>
</author>
<published>2008-03-13T20:30:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9df5808cca52f33e1deb52b5010c68c6ed1656fe'/>
<id>urn:sha1:9df5808cca52f33e1deb52b5010c68c6ed1656fe</id>
<content type='text'>
The i915_vblank_swap() function schedules an automatic buffer swap
upon receipt of the vertical sync interrupt.  Such an operation is
lengthy so it can't be allowed to happen in normal interrupt context,
thus the DRM implements this by scheduling the work in a kernel
softirq-scheduled tasklet.  In order for the buffer swap to work
safely, the DRM's central lock must be taken, via a call to
drm_lock_take() located in drivers/char/drm/drm_irq.c within the
function drm_locked_tasklet_func().  The lock-taking logic uses a
non-interrupt-blocking spinlock to implement the manipulations needed
to take the lock.  This semantic would be safe if all attempts to use
the spinlock only happen from process context.  However this buffer
swap happens from softirq context which is really a form of interrupt
context.  Thus we have an unsafe situation, in that
drm_locked_tasklet_func() can block on a spinlock already taken by a
thread in process context which will never get scheduled again because
of the blocked softirq tasklet.  This wedges the kernel hard.

To trigger this bug, run a dual-head cloned mode configuration which
uses the i915 drm, then execute an opengl application which
synchronizes buffer swaps against the vertical sync interrupt.  In my
testing, a lockup always results after running anywhere from 5 minutes
to an hour and a half.  I believe dual-head is needed to really
trigger the problem because then the vertical sync interrupt handling
is no longer predictable (due to being interrupt-sourced from two
different heads running at different speeds).  This raises the
probability of the tasklet trying to run while the userspace DRI is
doing things to the GPU (and manipulating the DRM lock).

The fix is to change the relevant spinlock semantics to be the
interrupt-blocking form.  After this change I am no longer able to
trigger the lockup; the longest test run so far was 20 hours (test
stopped after that point).

Note: I have examined the places where this spinlock is being
employed; all are reasonably short bounded sequences and should be
suitable for interrupts being blocked without impacting overall kernel
interrupt response latency.

Signed-off-by: Mike Isely &lt;isely@pobox.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>Use helpers to obtain task pid in printks</title>
<updated>2007-10-19T18:53:43Z</updated>
<author>
<name>Pavel Emelyanov</name>
<email>xemul@openvz.org</email>
</author>
<published>2007-10-19T06:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ba25f9dcc4ea6e30839fcab5a5516f2176d5bfed'/>
<id>urn:sha1:ba25f9dcc4ea6e30839fcab5a5516f2176d5bfed</id>
<content type='text'>
The task_struct-&gt;pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.

The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.

[akpm@linux-foundation.org: git-drm went and changed lots of stuff]
Signed-off-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Cc: Dave Airlie &lt;airlied@linux.ie&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drm: Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.</title>
<updated>2007-10-15T00:38:20Z</updated>
<author>
<name>Eric Anholt</name>
<email>eric@anholt.net</email>
</author>
<published>2007-09-03T02:06:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c153f45f9b7e30289157bba3ff5682291df16caa'/>
<id>urn:sha1:c153f45f9b7e30289157bba3ff5682291df16caa</id>
<content type='text'>
The data is now in kernel space, copied in/out as appropriate according to t
This results in DRM_COPY_{TO,FROM}_USER going away, and error paths to deal
with those failures.  This also means that XFree86 4.2.0 support for i810 DR
is lost.

Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
</entry>
<entry>
<title>drm: Replace filp in ioctl arguments with drm_file *file_priv.</title>
<updated>2007-10-15T00:38:20Z</updated>
<author>
<name>Eric Anholt</name>
<email>eric@anholt.net</email>
</author>
<published>2007-08-25T10:23:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6c340eac0285f3d62406d2d902d0e96fbf2a5dc0'/>
<id>urn:sha1:6c340eac0285f3d62406d2d902d0e96fbf2a5dc0</id>
<content type='text'>
As a fallout, replace filp storage with file_priv storage for "unique
identifier of a client" all over the DRM.  There is a 1:1 mapping, so this
should be a noop.  This could be a minor performance improvement, as everyth
on Linux dereferenced filp to get file_priv anyway, while only the mmap ioct
went the other direction.

Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
</entry>
<entry>
<title>drm: Remove DRM_ERR OS macro.</title>
<updated>2007-10-15T00:38:19Z</updated>
<author>
<name>Eric Anholt</name>
<email>eric@anholt.net</email>
</author>
<published>2007-08-25T09:22:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=20caafa6ecb2487d9b223aa33e7cc704f912a758'/>
<id>urn:sha1:20caafa6ecb2487d9b223aa33e7cc704f912a758</id>
<content type='text'>
This was used to make all ioctl handlers return -errno on linux and errno on
*BSD.  Instead, just return -errno in shared code, and flip sign on return f
shared code to *BSD code.

Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
</entry>
<entry>
<title>drm: detypedeffing continues...</title>
<updated>2007-07-11T06:53:40Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@linux.ie</email>
</author>
<published>2007-07-11T06:53:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=55910517af381eba4f978740e5e46e23eb269326'/>
<id>urn:sha1:55910517af381eba4f978740e5e46e23eb269326</id>
<content type='text'>
Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
</entry>
<entry>
<title>drm: remove drm_file_t, drm_device_t and drm_head_t typedefs</title>
<updated>2007-07-11T05:53:27Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@linux.ie</email>
</author>
<published>2007-07-11T05:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=84b1fd103dbbe01b5905db1444d3fc8afa9a7207'/>
<id>urn:sha1:84b1fd103dbbe01b5905db1444d3fc8afa9a7207</id>
<content type='text'>
some drivers still todo.

Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
</entry>
<entry>
<title>drm: remove a bunch of typedefs on the userspace interface</title>
<updated>2007-07-11T05:27:12Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@linux.ie</email>
</author>
<published>2007-07-11T05:27:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c60ce623bd16137627009d05e311d877729f2ad6'/>
<id>urn:sha1:c60ce623bd16137627009d05e311d877729f2ad6</id>
<content type='text'>
This moves a bunch of typedefs into a !defined __KERNEL__ to keep userspace
API compatiblity, it changes all internal usages to structs/enum/unions.

Signed-off-by: Dave Airlie &lt;airlied@linux.ie&gt;
</content>
</entry>
</feed>
