Op 19-08-13 14:35, Christian König schreef:Am 19.08.2013 12:17, schrieb Maarten Lankhorst:Yes, and the callers of this function call wake_up_all or wake_up_all_locked themselves, based on the return value..[SNIP]Very bad idea, when sequence numbers change, you always want to wake up the whole fence queue here.
@@ -190,25 +225,24 @@ void radeon_fence_process(struct radeon_device *rdev, int ring)
}
} while (atomic64_xchg(&rdev->fence_drv[ring].last_seq, seq) > seq);
- if (wake) {
+ if (wake)
rdev->fence_drv[ring].last_activity = jiffies;
- wake_up_all(&rdev->fence_queue);
- }
+ return wake;
}
For cross-device synchronization it would be nice to have working irqs, it allows signalling fences faster,[SNIP]Do I get that right that you rely on IRQs to be enabled and working here? Cause that would be a quite bad idea from the conceptual side.
+/**
+ * radeon_fence_enable_signaling - enable signalling on fence
+ * @fence: fence
+ *
+ * This function is called with fence_queue lock held, and adds a callback
+ * to fence_queue that checks if this fence is signaled, and if so it
+ * signals the fence and removes itself.
+ */
+static bool radeon_fence_enable_signaling(struct fence *f)
+{
+ struct radeon_fence *fence = to_radeon_fence(f);
+
+ if (atomic64_read(&fence->rdev->fence_drv[fence->ring].last_seq) >= fence->seq ||
+ !fence->rdev->ddev->irq_enabled)
+ return false;
+
and it allows for callbacks on completion to be called. For internal usage it's no more required than it was before.