Skip to content

Commit

Permalink
hsa/radeon: Fix Auto-reset events behavior
Browse files Browse the repository at this point in the history
This patch changes the behavior of the auto-reset functionallity
in the events code. The new behavior is that only after the
events have been consumed by a waiter, they are being reset, if the
auto-reset property is enabled.

Signed-off-by: Andrew Lewycky <Andrew.Lewycky@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
  • Loading branch information
Andrew Lewycky authored and Oded Gabbay committed Jul 2, 2014
1 parent c9a5ff5 commit c643dd9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/hsa/radeon/kfd_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ static void set_event(struct kfd_event *ev)
struct kfd_event_waiter *waiter;
struct kfd_event_waiter *next;

ev->signaled = true;
/* Auto reset if the list is non-empty and we're waking someone. */
ev->signaled = !ev->auto_reset || list_empty(&ev->waiters);

list_for_each_entry_safe(waiter, next, &ev->waiters, waiters) {
waiter->activated = true;
Expand All @@ -456,9 +457,6 @@ static void set_event(struct kfd_event *ev)

wake_up_process(waiter->sleeping_task);
}

if (ev->auto_reset)
ev->signaled = false;
}

/* Assumes that p is current. */
Expand Down Expand Up @@ -586,6 +584,7 @@ static int init_event_waiter(struct kfd_process *p, struct kfd_event_waiter *wai
return -EINVAL;

waiter->activated = ev->signaled;
ev->signaled = ev->signaled && !ev->auto_reset;

list_add(&waiter->waiters, &ev->waiters);

Expand Down

0 comments on commit c643dd9

Please sign in to comment.