Displaying 14 results from an estimated 14 matches for "nouveau_event_get".
2013 Aug 27
0
[PATCH 4/9] drm/nouveau: Allow asymmetric nouveau_event_get/_put
Most nouveau event handlers have storage in 'static' containers
(structures with lifetimes nearly equivalent to the drm_device),
but are dangerously reused via nouveau_event_get/_put. For
example, if nouveau_event_get is called more than once for a
given handler, the event handler list will be corrupted.
Migrate nouveau_event_get/_put from add/remove semantics to
enable/disable semantics.
Signed-off-by: Peter Hurley <peter at hurleysoftware.com>
---
drivers/gpu/dr...
2013 Aug 27
11
[PATCH 0/9] drm/nouveau: Cleanup event/handler design
...oiding the lock inversion.
Typical hurdles to RCU conversion include: 1) ensuring the
object lifetime exceeds the lockless access; 2) preventing
premature object reuse; and 3) verifying that stale object
use not present logical errors.
Because object reuse is not safe in RCU-based operations,
the nouveau_event_get/_put interface is migrated from
add/remove semantics to enable/disable semantics with a separate
install/remove step (which also serves to document the
handler lifetime). This also corrects an unsafe interface design
where handlers can mistakenly be reused while in use.
The nouveau driver currentl...
2013 Aug 27
0
[PATCH 5/9] drm/nouveau: Add install/remove semantics for event handlers
Complete migration of nouveau_event_get/_put from add/remove
semantics to enable/disable semantics.
Introduce nouveau_event_handler_install/_remove interface to
add/remove non-local-scope event handlers (ie., those stored in
parent containers). This change in semantics makes explicit the
handler lifetime, and distinguishes "one-of&...
2013 Aug 27
0
[PATCH 3/9] drm/nouveau: Allocate local event handlers
...+ int (*func)(struct nouveau_eventh*, int),
+ void *priv, struct nouveau_eventh **phandler)
+{
+ struct nouveau_eventh *handler;
+
+ handler = *phandler = kzalloc(sizeof(*handler), GFP_KERNEL);
+ if (!handler)
+ return -ENOMEM;
+ handler->func = func;
+ handler->priv = priv;
+ nouveau_event_get(event, index, handler);
+ return 0;
+}
+
+void
+nouveau_event_handler_destroy(struct nouveau_event *event, int index,
+ struct nouveau_eventh *handler)
+{
+ nouveau_event_put(event, index, handler);
+ kfree(handler);
+}
+
static void
nouveau_event_put_locked(struct nouveau_event *event, i...
2013 Aug 27
0
[PATCH 1/9] drm/nouveau: Add priv field for event handlers
...->drm->device);
struct nouveau_fence_priv *priv = chan->drm->fence;
- struct nouveau_fence_uevent uevent = {
- .handler.func = nouveau_fence_wait_uevent_handler,
+ struct nouveau_eventh handler = {
+ .func = nouveau_fence_wait_uevent_handler,
.priv = priv,
};
int ret = 0;
- nouveau_event_get(pfifo->uevent, 0, &uevent.handler);
+ nouveau_event_get(pfifo->uevent, 0, &handler);
if (fence->timeout) {
unsigned long timeout = fence->timeout - jiffies;
@@ -224,7 +218,7 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr)
}
}
- nouveau_event_pu...
2013 Aug 12
2
[PATCH] drm/nouveau: fix vblank deadlock
...);
+}
+
+void
+nouveau_event_disable_locked(struct nouveau_event *event, int index, int refs)
+{
+ if (index >= event->index_nr)
+ return;
+
+ event->index[index].refs -= refs;
+ if (!event->index[index].refs && event->disable)
+ event->disable(event, index);
+}
+
+void
nouveau_event_get(struct nouveau_event *event, int index,
struct nouveau_eventh *handler)
{
unsigned long flags;
+ if (index >= event->index_nr)
+ return;
+
spin_lock_irqsave(&event->lock, flags);
- if (index < event->index_nr) {
- list_add(&handler->head, &event->index...
2013 Aug 19
0
[PATCH] drm/nouveau: fix vblank deadlock
...au_event *event, int index, int refs)
> +{
> + if (index >= event->index_nr)
> + return;
> +
> + event->index[index].refs -= refs;
> + if (!event->index[index].refs && event->disable)
> + event->disable(event, index);
> +}
> +
> +void
> nouveau_event_get(struct nouveau_event *event, int index,
> struct nouveau_eventh *handler)
> {
> unsigned long flags;
>
> + if (index >= event->index_nr)
> + return;
> +
> spin_lock_irqsave(&event->lock, flags);
> - if (index < event->index_nr) {
> -...
2013 Aug 28
0
[PATCH 0/9] drm/nouveau: Cleanup event/handler design
...ypical hurdles to RCU conversion include: 1) ensuring the
> object lifetime exceeds the lockless access; 2) preventing
> premature object reuse; and 3) verifying that stale object
> use not present logical errors.
>
> Because object reuse is not safe in RCU-based operations,
> the nouveau_event_get/_put interface is migrated from
> add/remove semantics to enable/disable semantics with a separate
> install/remove step (which also serves to document the
> handler lifetime). This also corrects an unsafe interface design
> where handlers can mistakenly be reused while in use.
>
>...
2013 Aug 27
0
[PATCH 6/9] drm/nouveau: Convert event handler list to RCU
...ady depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&(&event->lock)->rlock){-.....}:
[<ffffffff810b6d62>] lock_acquire+0x92/0x1f0
[<ffffffff8175e926>] _raw_spin_lock_irqsave+0x46/0x60
[<ffffffffa0101cf7>] nouveau_event_get+0x27/0xa0 [nouveau]
[<ffffffffa01807bd>] nouveau_drm_vblank_enable+0x8d/0xf0 [nouveau]
[<ffffffffa00856d8>] drm_vblank_get+0xf8/0x2c0 [drm]
[<ffffffffa00867f4>] drm_wait_vblank+0x84/0x6f0 [drm]
[<ffffffffa0081719>] drm_ioctl+0x559/0x690 [drm]...
2013 Mar 23
1
[bisected][3.9.0-rc3] NULL ptr dereference from nv50_disp_intr()
On Tue, 2013-03-19 at 11:13 -0400, Peter Hurley wrote:
> On vanilla 3.9.0-rc3, I get this 100% repeatable oops after login when
> the user X session is coming up:
Perhaps I wasn't clear that this happens on every boot and is a
regression from 3.8
I'd be happy to help resolve this but time is of the essence; it would
be a shame to have to revert all of this for 3.9
Regards,
Peter
2014 May 14
0
[RFC PATCH v1 07/16] drm/nouveau: rework to new fence interface
...= 0;
+ t = jiffies;
- ret = nouveau_event_new(pfifo->uevent, 0,
- nouveau_fence_wait_uevent_handler,
- priv, &handler);
- if (ret)
- return ret;
+ if (wait != MAX_SCHEDULE_TIMEOUT && time_after_eq(t, timeout)) {
+ __set_current_state(TASK_RUNNING);
+ return 0;
+ }
- nouveau_event_get(handler);
+ __set_current_state(intr ? TASK_INTERRUPTIBLE :
+ TASK_UNINTERRUPTIBLE);
- if (fence->timeout) {
- unsigned long timeout = fence->timeout - jiffies;
-
- if (time_before(jiffies, fence->timeout)) {
- if (intr) {
- ret = wait_event_interruptible_timeout(
- p...
2014 May 14
17
[RFC PATCH v1 00/16] Convert all ttm drivers to use the new reservation interface
This series depends on the previously posted reservation api patches.
2 of them are not yet in for-next-fences branch of
git://git.linaro.org/people/sumit.semwal/linux-3.x.git
The missing patches are still in my vmwgfx_wip branch at
git://people.freedesktop.org/~mlankhorst/linux
All ttm drivers are converted to the fence api, fence_lock is removed
and rcu is used in its place.
qxl is the first
2014 Jul 31
19
[PATCH 01/19] fence: add debugging lines to fence_is_signaled for the callback
fence_is_signaled callback should support being run in
atomic context, but not in irq context.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
---
include/linux/fence.h | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/include/linux/fence.h b/include/linux/fence.h
index d174585b874b..c1a4519ba2f5 100644
---
2014 Jul 09
22
[PATCH 00/17] Convert TTM to the new fence interface.
This series applies on top of the driver-core-next branch of
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
Before converting ttm to the new fence interface I had to fix some
drivers to require a reservation before poking with fence_obj.
After flipping the switch RCU becomes available instead, and
the extra reservations can be dropped again. :-)
I've done at least basic